patch-2.4.0-test2 linux/fs/nfsd/vfs.c

Next file: linux/fs/ntfs/fs.c
Previous file: linux/fs/nfsd/nfsxdr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c
@@ -30,6 +30,8 @@
 #include <linux/unistd.h>
 #include <linux/malloc.h>
 #include <linux/in.h>
+#define __NO_VERSION__
+#include <linux/module.h>
 
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
@@ -451,7 +453,7 @@
 		goto out_nfserr;
 
 	memset(filp, 0, sizeof(*filp));
-	filp->f_op    = inode->i_fop;
+	filp->f_op    = fops_get(inode->i_fop);
 	atomic_set(&filp->f_count, 1);
 	filp->f_dentry = dentry;
 	if (access & MAY_WRITE) {
@@ -467,6 +469,7 @@
 	if (filp->f_op && filp->f_op->open) {
 		err = filp->f_op->open(inode, filp);
 		if (err) {
+			fops_put(filp->f_op);
 			if (access & MAY_WRITE)
 				put_write_access(inode);
 
@@ -492,16 +495,11 @@
 	struct dentry	*dentry = filp->f_dentry;
 	struct inode	*inode = dentry->d_inode;
 
-	if (!inode->i_count)
-		printk(KERN_WARNING "nfsd: inode count == 0!\n");
-	if (!dentry->d_count)
-		printk(KERN_WARNING "nfsd: wheee, %s/%s d_count == 0!\n",
-			dentry->d_parent->d_name.name, dentry->d_name.name);
 	if (filp->f_op && filp->f_op->release)
 		filp->f_op->release(inode, filp);
-	if (filp->f_mode & FMODE_WRITE) {
+	fops_put(filp->f_op);
+	if (filp->f_mode & FMODE_WRITE)
 		put_write_access(inode);
-	}
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)