[SSI] openssi/kernel/cluster/ssi/cfs dir.c,1.34,1.35

Roger Tsang <[email protected]> Wed, 15 Dec 2010 07:32:23 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv18920/kernel/cluster/ssi/cfs

Modified Files:
      Tag: OPENSSI-FC
	dir.c 
Log Message:
cluster/ssi/cfs/dir.c (#ifdef CFSTOK_INTR)
- cfs_readdir: return -ERESTARTSYS instead of -EINTR
- cfs_lookup: return -ERESTARTSYS instead of -EINTR
- cfs_create: return -ERESTARTSYS instead of -EINTR
- cfs_mknod: return -ERESTARTSYS instead of -EINTR
- cfs_mkdir: return -ERESTARTSYS instead of -EINTR
- cfs_symlink: return -ERESTARTSYS instead of -EINTR
- cfs_permission: return -ERESTARTSYS instead of -EINTR

cluster/ssi/cfs/dir.c (#ifdef SSI_CFS_SKIP)
- cfs_permission: don't obtain token, just force getattr(). Linux VFS looks at permissions in real-time. reduce Linux link_path_walk() latency when client does not have CFSTOK_EXCL mode token. avoid unnecessary token architecture REVOKE on the cluster.


Index: dir.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/dir.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- dir.c	15 Dec 2010 07:01:05 -0000	1.34
+++ dir.c	15 Dec 2010 07:32:21 -0000	1.35
@@ -481,7 +481,7 @@
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
-		return -EINTR;
+		return -ERESTARTSYS;
 	}
 #endif
 	SSI_ASSERT(res == CFSTOK_HELD);
@@ -1000,7 +1000,7 @@
 		CFSTOK_HOLD|CFSTOK_BLOCK, NON_RANGE, NULL);
 #ifdef CFSTOK_INTR
 	if (error == CFSTOK_INTERRUPTED) {
-		res = ERR_PTR(-EINTR);
+		res = ERR_PTR(-ERESTARTSYS);
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
@@ -1097,7 +1097,7 @@
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
-		return -EINTR;
+		return -ERESTARTSYS;
 	}
 #endif
 	SSI_ASSERT(error == CFSTOK_HELD);
@@ -1155,7 +1155,7 @@
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
-		return -EINTR;
+		return -ERESTARTSYS;
 	}
 #endif
 	SSI_ASSERT(error == CFSTOK_HELD);
@@ -1212,7 +1212,7 @@
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
-		return -EINTR;
+		return -ERESTARTSYS;
 	}
 #endif
 	SSI_ASSERT(error == CFSTOK_HELD);
@@ -1403,7 +1403,7 @@
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
-		return -EINTR;
+		return -ERESTARTSYS;
 	}
 #endif
 	SSI_ASSERT(error == CFSTOK_HELD);
@@ -1818,6 +1818,7 @@
 	}
 #endif /* !KERNEL2616_53 */
 
+#ifdef SSI_CFS_SKIP
 	/* In order to properly verify the permission in the cluster, we must
 	 * update the attributes under tokens.  This function is called
 	 * with tokens held.
@@ -1829,26 +1830,36 @@
 #ifdef DEBUG
 		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
 #endif
-		return -EINTR;
+		return -ERESTARTSYS;
 	}
 #endif
 	SSI_ASSERT(res == CFSTOK_HELD);
+#endif /* SSI_CFS_SKIP */
 #ifdef KERNEL2616_53
-	res = cfs_revalidate_inode(inode);
+	/* Force getattr() since we don't have token. */
+	LOCK_COND_LOCK(&itoc(inode)->c_statelock);
+	if (!(CFS_FLAGS(inode) & CFS_INO_INVALID_ATTR))
+		CFS_FLAGS(inode) |= CFS_INO_INVALID_ATTR;
+	UNLOCK_COND_LOCK(&itoc(inode)->c_statelock);
+	res = __cfs_revalidate_inode(inode);
 	if (res == 0)
 		res = generic_permission(inode, mask, NULL);
 
+#ifdef SSI_CFS_SKIP
 	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_READ, NON_RANGE);
+#endif
 out:
  	return res;
 #else
 	//(void)cfs_revalidate_inode(inode, 1);
 	res = _cfs_permission(inode, mask);
 
+#ifdef SSI_CFS_SKIP
 	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_READ, NON_RANGE);
+#endif
 
 	return res;
-#endif
+#endif /* !KERNEL2616_53 */
 }
 
 /*


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d