[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/kernel/linux-2.6: dcache.c pvfs2-kernel.h

CVS commit program cvs at parl.clemson.edu
Fri Apr 11 13:07:27 EDT 2008


Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv20846/src/kernel/linux-2.6

Modified Files:
      Tag: pvfs-2-7-branch
	dcache.c pvfs2-kernel.h 
Log Message:
merge i_sem/i_mutex configure check from trunk to pvfs-2-7-branch


Index: dcache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/dcache.c,v
diff -p -u -r1.32.2.5 -r1.32.2.6
--- dcache.c	25 Mar 2008 23:56:20 -0000	1.32.2.5
+++ dcache.c	11 Apr 2008 17:07:26 -0000	1.32.2.6
@@ -109,9 +109,9 @@ static int pvfs2_d_revalidate_common(str
     gossip_debug(GOSSIP_DCACHE_DEBUG,
                  "%s: doing getattr: inode: %p, handle: %llu)\n",
                  __func__, inode, llu(get_handle_from_ino(inode)));
-    mutex_lock(&inode->i_mutex);
+    pvfs2_inode_lock(inode);
     ret = pvfs2_inode_getattr(inode, PVFS_ATTR_SYS_ALL_NOHINT);
-    mutex_unlock(&inode->i_mutex);
+    pvfs2_inode_unlock(inode);
     gossip_debug(GOSSIP_DCACHE_DEBUG,
                  "%s: getattr %s (ret = %d), returning %s for dentry\n",
                  __func__,

Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -p -u -r1.145.2.4 -r1.145.2.5
--- pvfs2-kernel.h	1 Apr 2008 23:25:20 -0000	1.145.2.4
+++ pvfs2-kernel.h	11 Apr 2008 17:07:26 -0000	1.145.2.5
@@ -1225,17 +1225,29 @@ static inline int dcache_dir_close(struc
 
 #endif /* PVFS2_LINUX_KERNEL_2_4 */
 
+#ifdef HAVE_I_SEM_IN_STRUCT_INODE
+#define pvfs2_inode_lock(__i) do \
+{ down(&(__i)->i_sem); } while (0)
+#define pvfs2_inode_unlock(__i) do \
+{ up(&(__i)->i_sem); } while (0)
+#else
+#define pvfs2_inode_lock(__i) do \
+{ mutex_lock(&(__i)->i_mutex); } while (0)
+#define pvfs2_inode_unlock(__i) do \
+{ mutex_unlock(&(__i)->i_mutex); } while (0)
+#endif /* HAVE_I_SEM_IN_STRUCT_INODE */
+
 static inline void pvfs2_i_size_write(struct inode *inode, loff_t i_size)
 {
 #ifndef HAVE_I_SIZE_WRITE
     inode->i_size = i_size;
 #else
     #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
-    mutex_lock(&inode->i_mutex);
+    pvfs2_inode_lock(inode);
     #endif
     i_size_write(inode, i_size);
     #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
-    mutex_unlock(&inode->i_mutex);
+    pvfs2_inode_unlock(inode);
     #endif
 #endif
     return;



More information about the Pvfs2-cvs mailing list