Linux: Use inode lock compat function

We've now got a compatibilty function for locking and unlocking an
inode. Use that in osi_file, rather than a local set of #ifdefs

Change-Id: Ie64f0b758df0b90d0df2033d57729c8b09652c39
Reviewed-on: http://gerrit.openafs.org/2389
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2010-07-12 12:04:20 +01:00 committed by Derrick Brashear
parent cdef1c67ae
commit 73716de680

View File

@ -173,11 +173,7 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
return code;
ObtainWriteLock(&afs_xosi, 321);
AFS_GUNLOCK();
#ifdef STRUCT_INODE_HAS_I_MUTEX
mutex_lock(&inode->i_mutex);
#else
down(&inode->i_sem);
#endif
afs_linux_lock_inode(inode);
#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
down_write(&inode->i_alloc_sem);
#endif
@ -203,11 +199,7 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
up_write(&inode->i_alloc_sem);
#endif
#ifdef STRUCT_INODE_HAS_I_MUTEX
mutex_unlock(&inode->i_mutex);
#else
up(&inode->i_sem);
#endif
afs_linux_unlock_inode(inode);
AFS_GLOCK();
ReleaseWriteLock(&afs_xosi);
return code;