Linux: Use inode lock compat function
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Mon, 12 Jul 2010 11:04:20 +0000 (12:04 +0100)
committerDerrick Brashear <shadow@dementia.org>
Mon, 12 Jul 2010 21:34:06 +0000 (14:34 -0700)
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>

src/afs/LINUX/osi_file.c

index 53784ca..13eb59d 100644 (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;