[SSI] openssi/kernel/cluster/ssi/cfs file.c,1.28,1.29

Roger Tsang <[email protected]> Wed, 15 Dec 2010 08:07:16 +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-serv25852/kernel/cluster/ssi/cfs

Modified Files:
      Tag: OPENSSI-FC
	file.c 
Log Message:
- cfs_file_flush: return immediately if there is no data to flush.
- cfs_file_flush: no need to acquire CFSTOK_ATTR token. not changing attributes.
- cfs_file_flush: no need to revalidate since attributes are piggybacked.
- cfs_shared_nopage: no need to acquire CFSTOK_ATTR token. not changing attributes.
- cfs_private_nopage: no need to acquire CFSTOK_ATTR token. not changing attributes.
- cfs_fsync: return immediately if there is no data to flush.
- cfs_fsync: no need to acquire CFSTOK_ATTR token. not changing attributes.


Index: file.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/file.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- file.c	15 Dec 2010 07:33:16 -0000	1.28
+++ file.c	15 Dec 2010 08:07:14 -0000	1.29
@@ -191,48 +191,18 @@
 	struct inode	*inode = file->f_dentry->d_inode;
 	int		status;
 
-
 	if ((file->f_mode & FMODE_WRITE) == 0)
 		return 0;
-
-	/* Avoid invalidate_inode_pages race */
-#ifdef SSI_CFSTOK_SU
-	status = cfstok_req(inode, CFSTOK_ATTR, CFSTOK_SU,
-		CFSTOK_HOLD|CFSTOK_BLOCK, NON_RANGE, NULL);
-#else
-	status = cfstok_req(inode, CFSTOK_ATTR, CFSTOK_EXCL,
-		CFSTOK_HOLD|CFSTOK_BLOCK, NON_RANGE, NULL);
-#endif
-#ifdef CFSTOK_INTR
-	if (status == CFSTOK_INTERRUPTED) {
-#ifdef DEBUG
-		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
-#endif
-		return -ERESTARTSYS;
-	}
-#endif
-	SSI_ASSERT(status == CFSTOK_HELD);
+	if (inode->i_data.nrpages == 0)
+		return 0;
 
 	/* Ensure that data+attribute caches are up to date after close() */
 	status = cfs_wb_all(inode);
 	if (!status) {
 		status = file->f_error;
 		file->f_error = 0;
-#ifdef CFS_ZAP_CACHES
-		if (!status) 
-#ifdef KERNEL2616_53
-			cfs_revalidate_inode(inode);
-#else
-			__cfs_revalidate_inode(inode);
-#endif
-#endif
 	}
 
-#ifdef SSI_CFSTOK_SU
-	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_SU, NON_RANGE);
-#else
-	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_EXCL, NON_RANGE);
-#endif
 	return status;
 }
 
@@ -356,36 +326,15 @@
 cfs_shared_nopage(struct vm_area_struct *area,
 		  unsigned long address, int *typep)
 {
-	struct page *result = NULL;
-	struct inode *inode = area->vm_file->f_dentry->d_inode;
+	struct page *result;
 	int prio = ics_getpriority();
-#ifdef CFSTOK_INTR
-	int status;
-#endif
 
 	/* Up icsprio to avoid deadlock */
 	if (prio < ICS_MAX_PRIO)
 		ics_setpriority(prio + 1);
 
-#ifdef CFSTOK_INTR
-	status = cfstok_req(inode, CFSTOK_ATTR, CFSTOK_EXCL,
-			 CFSTOK_BLOCK|CFSTOK_HOLD, NON_RANGE, NULL);
-	if (status == CFSTOK_INTERRUPTED) {
-#ifdef DEBUG
-		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
-#endif
-		return ERR_PTR(-ERESTARTSYS);
-	}
-#else
-	(void)cfstok_req(inode, CFSTOK_ATTR, CFSTOK_EXCL,
-			 CFSTOK_BLOCK|CFSTOK_HOLD, NON_RANGE, NULL);
-#endif
-
 	result = filemap_nopage(area, address, typep);
 
-	cfstok_relsex(inode, CFSTOK_ATTR, CFSTOK_EXCL, NON_RANGE,
-		CFSTOK_DELAY, 0);
-
 	/* restore icsprio */
 	ics_setpriority(prio);
 
@@ -409,35 +358,15 @@
 cfs_private_nopage(struct vm_area_struct *area,
 		   unsigned long address, int *typep)
 {
-	struct inode *inode = area->vm_file->f_dentry->d_inode;
-	struct page *result = NULL;
+	struct page *result;
 	int prio = ics_getpriority();
-#ifdef CFSTOK_INTR
-	int status;
-#endif
 
 	/* Up icsprio to avoid deadlock */
 	if (prio < ICS_MAX_PRIO)
 		ics_setpriority(prio + 1);
 
-#ifdef CFSTOK_INTR
-	status = cfstok_req(inode, CFSTOK_ATTR, CFSTOK_READ,
-			 CFSTOK_BLOCK|CFSTOK_HOLD, NON_RANGE, NULL);
-	if (status == CFSTOK_INTERRUPTED) {
-#ifdef DEBUG
-		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
-#endif
-		return ERR_PTR(-ERESTARTSYS);
-	}
-#else
-	(void)cfstok_req(inode, CFSTOK_ATTR, CFSTOK_READ,
-			 CFSTOK_BLOCK|CFSTOK_HOLD, NON_RANGE, NULL);
-#endif
-
 	result = filemap_nopage(area, address, typep);
 
-	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_READ, NON_RANGE);
-
 	/* restore icsprio */
 	ics_setpriority(prio);
 
@@ -504,33 +433,15 @@
 
 	dfprintk(VFS, "cfs: fsync(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
 
-#ifdef SSI_CFSTOK_SU
-	status = cfstok_req(inode, CFSTOK_ATTR, CFSTOK_SU,
-		CFSTOK_HOLD|CFSTOK_BLOCK, NON_RANGE, NULL);
-#else
-	status = cfstok_req(inode, CFSTOK_ATTR, CFSTOK_EXCL,
-		CFSTOK_HOLD|CFSTOK_BLOCK, NON_RANGE, NULL);
-#endif
-#ifdef CFSTOK_INTR
-	if (status == CFSTOK_INTERRUPTED) {
-#ifdef DEBUG
-		printk(KERN_DEBUG "%s: Interrupted\n", __FUNCTION__);
-#endif
-		return -ERESTARTSYS;
-	}
-#endif
-	SSI_ASSERT(status == CFSTOK_HELD);
+	if (inode->i_data.nrpages == 0)
+		return 0;
+
 	status = cfs_wb_all(inode);
 	if (!status) {
 		status = file->f_error;
 		file->f_error = 0;
 	}
 
-#ifdef SSI_CFSTOK_SU
-	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_SU, NON_RANGE);
-#else
-	cfstok_relse(inode, CFSTOK_ATTR, CFSTOK_EXCL, NON_RANGE);
-#endif
 	return status;
 }
 


------------------------------------------------------------------------------
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