patch-2.1.45 linux/include/linux/nfsd/nfsfh.h

Next file: linux/include/linux/omirr.h
Previous file: linux/include/linux/nametrans.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/include/linux/nfsd/nfsfh.h linux/include/linux/nfsd/nfsfh.h
@@ -57,7 +57,7 @@
 typedef struct svc_fh {
 	struct knfs_fh		fh_handle;	/* FH data */
 	struct svc_export *	fh_export;	/* export pointer */
-	struct inode *		fh_inode;	/* inode */
+	struct dentry *		fh_dentry;	/* file */
 	size_t			fh_pre_size;	/* size before operation */
 	time_t			fh_pre_mtime;	/* mtime before oper */
 	time_t			fh_pre_ctime;	/* ctime before oper */
@@ -98,7 +98,7 @@
 static inline void
 fh_lock(struct svc_fh *fhp)
 {
-	struct inode	*inode = fhp->fh_inode;
+	struct inode	*inode = fhp->fh_dentry->d_inode;
 
 	/*
 	dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n",
@@ -118,7 +118,7 @@
 static inline void
 fh_unlock(struct svc_fh *fhp)
 {
-	struct inode	*inode = fhp->fh_inode;
+	struct inode	*inode = fhp->fh_dentry->d_inode;
 
 	if (fhp->fh_locked) {
 		if (!fhp->fh_post_version)
@@ -135,9 +135,9 @@
 static inline void
 fh_put(struct svc_fh *fhp)
 {
-	if (fhp->fh_inode) {
+	if (fhp->fh_dentry) {
 		fh_unlock(fhp);
-		iput(fhp->fh_inode);
+		dput(fhp->fh_dentry);
 	}
 }
 #else
@@ -146,19 +146,19 @@
 static inline void
 __fh_put(struct svc_fh *fhp, char *file, int line)
 {
-	struct inode	*inode;
+	struct dentry	*dentry;
 
-	if (!(inode = fhp->fh_inode))
+	if (!(dentry = fhp->fh_dentry))
 		return;
 
-	if (!atomic_read(&inode->i_count)) {
-		printk("nfsd: trying to free free inode in %s:%d\n"
-		       "      dev %04x ino %ld, mode %07o\n",
-		       file, line, inode->i_dev,
-		       inode->i_ino, inode->i_mode);
+	if (!dentry->d_count) {
+		printk("nfsd: trying to free free dentry in %s:%d\n"
+		       "      file %s/%s\n",
+		       file, line,
+		       dentry->d_parent->d_name.name, dentry->d_name.name);
 	} else {
 		fh_unlock(fhp);
-		iput(inode);
+		dput(dentry);
 	}
 }
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov