Added function for translate spinlock to afs program