[SSI] openssi/kernel/cluster/ssi/vproc reopen.c,1.36,1.37

Roger Tsang <[email protected]> Mon, 17 Jan 2011 06:21:24 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv24540/cluster/ssi/vproc

Modified Files:
      Tag: OPENSSI-FC
	reopen.c 
Log Message:
- reop_export_file: remove if-test when assigning value to isreg variable. not needed.
- reop_export_file_free: test for non-NULL argument to rmtfb_putsvr().
- reop_import_file: add comment to explain why we skipped get_file() when copying reference to file struct.


Index: reopen.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/reopen.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- reopen.c	15 Dec 2010 07:10:24 -0000	1.36
+++ reopen.c	17 Jan 2011 06:21:22 -0000	1.37
@@ -1027,11 +1027,9 @@
 		goto free_out;
 
 	SSI_ASSERT(!S_ISLNK(mode));
-	if ((cfs_inode_is_cfs(inode) && (S_ISREG(mode) || S_ISDIR(mode))) ||
-						reop_reopen_local(inode))
-		isreg = 1;
-	else
-		isreg = 0;
+	isreg = ((cfs_inode_is_cfs(inode) &&
+		  (S_ISREG(mode) || S_ISDIR(mode))) ||
+		 reop_reopen_local(inode));
 
 	cli = rmtfb_getcli_file(file);
 	if (cli) {
@@ -1093,15 +1091,16 @@
 }
 
 void
-reop_export_file_free(
-		fb_data **fb_datapp)
+reop_export_file_free(fb_data **fb_datapp)
 {
-	fb_data	*fb_datap = *fb_datapp;
+	fb_data	*fb_datap;
 
-	if (!fb_datap)
+	if (!*fb_datapp)
 		return;
+	fb_datap = *fb_datapp;
 
-	rmtfb_putsvr((struct rmtfb_svr *) fb_datap->rfb);
+	if (fb_datap->rfb)
+		rmtfb_putsvr((struct rmtfb_svr *) fb_datap->rfb);
 	reop_export_path_free(&fb_datap->path);
 	kfree(fb_datap);
 	*fb_datapp = NULL;
@@ -1205,6 +1204,11 @@
 			error = PTR_ERR(cli);
 			goto out;
 		}
+
+		/* NB: Skipped get_file() on rfb_file. It has the active
+		 * reference to rmtfb_cli struct which is released during
+		 * final fput().
+		 */
 		file = cli->common.rfb_file;
 		rmtfb_putcli(cli);
 	}


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl