[PATCH 33/38] pnfsd: pass layout stateid down to fs on layoutget

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

 



rather than the clientid which is deprecated from the fs pnfs api

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxx>
---
 fs/nfsd/nfs4pnfsd.c             | 7 +++++--
 fs/nfsd/nfs4proc.c              | 3 +--
 fs/nfsd/xdr4.h                  | 1 +
 include/linux/nfsd/nfsd4_pnfs.h | 1 +
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index 7a5ba09..1a65f85 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -691,7 +691,7 @@ struct super_block *
 
 	nfs4_lock_state();
 	fp = find_alloc_file(ino, lgp->lg_fhp);
-	clp = find_confirmed_client((clientid_t *)&lgp->lg_seg.clientid, true,
+	clp = find_confirmed_client(&lgp->lg_clientid, true,
 				    net_generic(SVC_NET(rqstp), nfsd_net_id));
 	dprintk("pNFS %s: fp %p clp %p\n", __func__, fp, clp);
 	if (!fp || !clp) {
@@ -718,10 +718,13 @@ struct super_block *
 		goto out_unlock;
 	}
 
+	memcpy(&args.lg_sid, &lgp->lg_sid, sizeof(args.lg_sid));
+
 	dprintk("pNFS %s: pre-export type 0x%x maxcount %Zd "
-		"iomode %u offset %llu length %llu\n",
+		"ls %p stateid " STATEID_FMT " iomode %u offset %llu length %llu\n",
 		__func__, lgp->lg_seg.layout_type,
 		exp_xdr_qbytes(xdr->end - xdr->p),
+		ls, STATEID_VAL(&lgp->lg_sid),
 		lgp->lg_seg.iomode, lgp->lg_seg.offset, lgp->lg_seg.length);
 
 	/* FIXME: need to eliminate the use of the state lock */
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 4fd5549..e962dc6 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1193,9 +1193,8 @@ static int fill_in_write_vector(struct kvec *vec, struct nfsd4_write *write)
 		goto out;
 	}
 
-	/* Set up arguments so layout can be retrieved at encode time */
 	lgp->lg_fhp = current_fh;
-	copy_clientid((clientid_t *)&lgp->lg_seg.clientid, cstate->session);
+	copy_clientid(&lgp->lg_clientid, cstate->session);
 	status = nfs_ok;
 out:
 	return status;
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index 459d8ba..1862b16 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -452,6 +452,7 @@ struct nfsd4_pnfs_layoutget {
 	stateid_t		lg_sid;		/* request/response */
 	struct nfsd4_layout_seg	lg_seg;		/* request/response */
 	u32			lg_roc;		/* response */
+	clientid_t		lg_clientid;
 };
 
 struct nfsd4_pnfs_layoutcommit {
diff --git a/include/linux/nfsd/nfsd4_pnfs.h b/include/linux/nfsd/nfsd4_pnfs.h
index a10bcf2..2f311ac 100644
--- a/include/linux/nfsd/nfsd4_pnfs.h
+++ b/include/linux/nfsd/nfsd4_pnfs.h
@@ -81,6 +81,7 @@ struct nfsd4_pnfs_layoutget_arg {
 	u64			lg_minlength;
 	u64			lg_sbid;
 	const struct knfsd_fh	*lg_fh;
+	nfs4_stateid		lg_sid;
 };
 
 struct nfsd4_pnfs_layoutget_res {
-- 
1.7.11.7

--
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