diff mbox

[v2,15/18] nfsd: have set_version_and_fsid_type take a knfsd_fh instead of svc_fh

Message ID 1438809216-4846-16-git-send-email-jeff.layton@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Aug. 5, 2015, 9:13 p.m. UTC
Note however that we do still have it take a svc_fh for the ref_fh, but
that could be changed in the future if it's helpful to do so.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
---
 fs/nfsd/nfsfh.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Christoph Hellwig Aug. 9, 2015, 7:21 a.m. UTC | #1
On Wed, Aug 05, 2015 at 05:13:33PM -0400, Jeff Layton wrote:
> Note however that we do still have it take a svc_fh for the ref_fh, but
> that could be changed in the future if it's helpful to do so.
> 
> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index a945500db17c..b601f291d825 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -454,7 +454,9 @@  static bool fsid_type_ok_for_exp(u8 fsid_type, struct svc_export *exp)
 }
 
 
-static void set_version_and_fsid_type(struct svc_fh *fhp, struct svc_export *exp, struct svc_fh *ref_fh)
+static void
+set_version_and_fsid_type(struct knfsd_fh *kfh, int maxsize,
+			  struct svc_export *exp, struct svc_fh *ref_fh)
 {
 	u8 version;
 	u8 fsid_type;
@@ -487,7 +489,7 @@  retry:
 	} else if (exp->ex_flags & NFSEXP_FSID) {
 		fsid_type = FSID_NUM;
 	} else if (exp->ex_uuid) {
-		if (fhp->fh_maxsize >= 64) {
+		if (maxsize >= 64) {
 			if (is_root_export(exp))
 				fsid_type = FSID_UUID16;
 			else
@@ -503,9 +505,9 @@  retry:
 		fsid_type = FSID_ENCODE_DEV;
 	else
 		fsid_type = FSID_DEV;
-	fhp->fh_handle.fh_version = version;
+	kfh->fh_version = version;
 	if (version)
-		fhp->fh_handle.fh_fsid_type = fsid_type;
+		kfh->fh_fsid_type = fsid_type;
 }
 
 __be32
@@ -533,7 +535,8 @@  fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
 	 * the reference filehandle (if it is in the same export)
 	 * or the export options.
 	 */
-	 set_version_and_fsid_type(fhp, exp, ref_fh);
+	 set_version_and_fsid_type(&fhp->fh_handle, fhp->fh_maxsize,
+				   exp, ref_fh);
 
 	if (ref_fh == fhp)
 		fh_put(ref_fh);