[PATCH v2 14/18] nfsd: have _fh_update take a knfsd_fh instead of a svc_fh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This also mandates that we pass in the fh_maxsize parm as a separate
value.

Signed-off-by: Jeff Layton <jeff.layton@xxxxxxxxxxxxxxx>
---
 fs/nfsd/nfsfh.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 350041a40fe5..a945500db17c 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -388,20 +388,20 @@ out:
  * an inode.  In this case a call to fh_update should be made
  * before the fh goes out on the wire ...
  */
-static void _fh_update(struct svc_fh *fhp, struct svc_export *exp,
-		struct dentry *dentry)
+static void _fh_update(struct knfsd_fh *kfh, int fh_maxsize,
+		struct svc_export *exp, struct dentry *dentry)
 {
 	if (dentry != exp->ex_path.dentry) {
-		struct fid *fid = (struct fid *)
-			(fhp->fh_handle.fh_fsid + fhp->fh_handle.fh_size/4 - 1);
-		int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4;
+		struct fid *fid =
+			(struct fid *)(kfh->fh_fsid + kfh->fh_size/4 - 1);
+		int maxsize = (fh_maxsize - kfh->fh_size)/4;
 		int subtreecheck = !(exp->ex_flags & NFSEXP_NOSUBTREECHECK);
 
-		fhp->fh_handle.fh_fileid_type =
+		kfh->fh_fileid_type =
 			exportfs_encode_fh(dentry, fid, &maxsize, subtreecheck);
-		fhp->fh_handle.fh_size += maxsize * 4;
+		kfh->fh_size += maxsize * 4;
 	} else {
-		fhp->fh_handle.fh_fileid_type = FILEID_ROOT;
+		kfh->fh_fileid_type = FILEID_ROOT;
 	}
 }
 
@@ -574,7 +574,8 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
 			exp->ex_fsid, exp->ex_uuid);
 
 		if (inode)
-			_fh_update(fhp, exp, dentry);
+			_fh_update(&fhp->fh_handle, fhp->fh_maxsize,
+					exp, dentry);
 		if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) {
 			fh_put(fhp);
 			return nfserr_opnotsupp;
@@ -605,7 +606,8 @@ fh_update(struct svc_fh *fhp)
 		if (fhp->fh_handle.fh_fileid_type != FILEID_ROOT)
 			return 0;
 
-		_fh_update(fhp, fhp->fh_export, dentry);
+		_fh_update(&fhp->fh_handle, fhp->fh_maxsize,
+				fhp->fh_export, dentry);
 		if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID)
 			return nfserr_opnotsupp;
 	}
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux