All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <kolga@netapp.com>
To: <bfields@redhat.com>
Cc: <linux-nfs@vger.kernel.org>
Subject: [RFC v1 11/18] NFSD xdr callback stateid in async COPY reply
Date: Thu, 2 Mar 2017 11:01:35 -0500	[thread overview]
Message-ID: <20170302160142.30413-12-kolga@netapp.com> (raw)
In-Reply-To: <20170302160142.30413-1-kolga@netapp.com>

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfsd/nfs4xdr.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 26630ae..a101940 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -4356,15 +4356,27 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
 #endif /* CONFIG_NFSD_PNFS */
 
 static __be32
-nfsd42_encode_write_res(struct nfsd4_compoundres *resp, struct nfsd42_write_res *write)
+nfsd42_encode_write_res(struct nfsd4_compoundres *resp,
+		struct nfsd42_write_res *write, bool sync)
 {
 	__be32 *p;
+	p = xdr_reserve_space(&resp->xdr, 4);
+	if (!p)
+		return nfserr_resource;
 
-	p = xdr_reserve_space(&resp->xdr, 4 + 8 + 4 + NFS4_VERIFIER_SIZE);
+	if (sync)
+		*p++ = cpu_to_be32(0);
+	else {
+		__be32 nfserr;
+		*p++ = cpu_to_be32(1);
+		nfserr = nfsd4_encode_stateid(&resp->xdr, &write->cb_stateid);
+		if (nfserr)
+			return nfserr;
+	}
+	p = xdr_reserve_space(&resp->xdr, 8 + 4 + NFS4_VERIFIER_SIZE);
 	if (!p)
 		return nfserr_resource;
 
-	*p++ = cpu_to_be32(0);
 	p = xdr_encode_hyper(p, write->wr_bytes_written);
 	*p++ = cpu_to_be32(write->wr_stable_how);
 	p = xdr_encode_opaque_fixed(p, write->wr_verifier.data,
@@ -4425,7 +4437,8 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
 	__be32 *p;
 
 	if (!nfserr) {
-		nfserr = nfsd42_encode_write_res(resp, &copy->cp_res);
+		nfserr = nfsd42_encode_write_res(resp, &copy->cp_res,
+				copy->cp_synchronous);
 		if (nfserr)
 			return nfserr;
 
-- 
1.8.3.1


  parent reply	other threads:[~2017-03-02 16:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 16:01 [RFC v1 00/17] NFSD support for inter+async COPY Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 01/18] NFSD add ca_source_server<> to COPY Olga Kornievskaia
2017-09-01 19:52   ` J. Bruce Fields
2017-09-01 20:14     ` Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 02/18] NFSD add COPY_NOTIFY operation Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 03/18] NFSD generalize nfsd4_compound_state flag names Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 04/18] NFSD: allow inter server COPY to have a STALE source server fh Olga Kornievskaia
2017-09-01 20:23   ` J. Bruce Fields
2017-09-01 20:25     ` Olga Kornievskaia
2017-09-01 21:16       ` J. Bruce Fields
2017-09-01 21:24         ` J. Bruce Fields
2017-03-02 16:01 ` [RFC v1 05/18] NFSD add nfs4 inter ssc to nfsd4_copy Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 06/18] NFSD return nfs4_stid in nfs4_preprocess_stateid_op Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 07/18] NFSD Unique stateid_t for inter server to server COPY authentication Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 08/18] NFSD CB_OFFLOAD xdr Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 09/18] NFSD OFFLOAD_STATUS xdr Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 10/18] NFSD OFFLOAD_CANCEL xdr Olga Kornievskaia
2017-03-02 16:01 ` Olga Kornievskaia [this message]
2017-03-02 16:01 ` [RFC v1 12/18] NFSD first draft of async copy Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 13/18] NFSD handle OFFLOAD_CANCEL op Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 14/18] NFSD stop queued async copies on client shutdown Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 15/18] NFSD create new stateid for async copy Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 16/18] NFSD define EBADF in nfserrno Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 17/18] NFSD support OFFLOAD_STATUS Olga Kornievskaia
2017-03-02 16:01 ` [RFC v1 18/18] NFSD remove copy stateid when vfs_copy_file_range completes Olga Kornievskaia
2017-03-17 21:21 ` [RFC v1 00/17] NFSD support for inter+async COPY Olga Kornievskaia
2017-03-20 15:30   ` J. Bruce Fields
2017-03-27 21:49     ` Olga Kornievskaia
2017-09-01 19:41 ` J. Bruce Fields
2017-09-01 19:42   ` J. Bruce Fields
2017-09-01 19:48   ` Olga Kornievskaia
2017-09-01 19:53     ` J. Bruce Fields
2017-09-01 20:02       ` Olga Kornievskaia
2017-09-01 20:09         ` J. Bruce Fields
2017-09-01 20:34           ` Olga Kornievskaia
2017-09-01 21:19             ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170302160142.30413-12-kolga@netapp.com \
    --to=kolga@netapp.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.