All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <kolga@netapp.com>
To: Anna Schumaker <schumaker.anna@gmail.com>
Cc: <Trond.Myklebust@primarydata.com>, <anna.schumaker@netapp.com>,
	<bfields@redhat.com>, <linux-nfs@vger.kernel.org>
Subject: Re: [RFC v3 04/42] NFS OFFLOAD_STATUS xdr
Date: Wed, 12 Jul 2017 13:23:35 -0400	[thread overview]
Message-ID: <8B2DF11C-B157-419E-A061-F5BF61232061@netapp.com> (raw)
In-Reply-To: <6d091764-568e-1816-3bc8-074eb16d8f3f@gmail.com>


Is there an ETA on when the casting patches will go in? If it=E2=80=99s =
soon, I would rebase then and fix the new calls.

> On Jul 11, 2017, at 5:01 PM, Anna Schumaker <schumaker.anna@gmail.com> =
wrote:
>=20
> Hi Olga,
>=20
> On 07/11/2017 12:43 PM, Olga Kornievskaia wrote:
>> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
>> ---
>> fs/nfs/nfs42xdr.c         | 87 =
+++++++++++++++++++++++++++++++++++++++++++++++
>> fs/nfs/nfs4proc.c         |  1 +
>> fs/nfs/nfs4xdr.c          |  1 +
>> include/linux/nfs4.h      |  1 +
>> include/linux/nfs_fs_sb.h |  1 +
>> include/linux/nfs_xdr.h   | 12 +++++++
>> 6 files changed, 103 insertions(+)
>>=20
>> diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c
>> index 528362f..e369de1 100644
>> --- a/fs/nfs/nfs42xdr.c
>> +++ b/fs/nfs/nfs42xdr.c
>> @@ -25,6 +25,11 @@
>> 					 NFS42_WRITE_RES_SIZE + \
>> 					 1 /* cr_consecutive */ + \
>> 					 1 /* cr_synchronous */)
>> +#define encode_offload_status_maxsz	(op_encode_hdr_maxsz + \
>> +					 XDR_QUADLEN(NFS4_STATEID_SIZE))
>> +#define decode_offload_status_maxsz	(op_decode_hdr_maxsz + \
>> +					 2 /* osr_count */ + \
>> +					 1 + 1 /* osr_complete<1> */)
>> #define encode_deallocate_maxsz		(op_encode_hdr_maxsz + \
>> 					 encode_fallocate_maxsz)
>> #define decode_deallocate_maxsz		(op_decode_hdr_maxsz)
>> @@ -74,6 +79,12 @@
>> 					 decode_putfh_maxsz + \
>> 					 decode_copy_maxsz + \
>> 					 decode_commit_maxsz)
>> +#define NFS4_enc_offload_status_sz	(compound_encode_hdr_maxsz + \
>> +					 encode_putfh_maxsz + \
>> +					 encode_offload_status_maxsz)
>> +#define NFS4_dec_offload_status_sz	(compound_decode_hdr_maxsz + \
>> +					 decode_putfh_maxsz + \
>> +					 decode_offload_status_maxsz)
>> #define NFS4_enc_deallocate_sz		=
(compound_encode_hdr_maxsz + \
>> 					 encode_putfh_maxsz + \
>> 					 encode_deallocate_maxsz + \
>> @@ -144,6 +155,14 @@ static void encode_copy(struct xdr_stream *xdr,
>> 	encode_uint32(xdr, 0); /* src server list */
>> }
>>=20
>> +static void encode_offload_status(struct xdr_stream *xdr,
>> +				  struct nfs42_offload_status_args =
*args,
>> +				  struct compound_hdr *hdr)
>> +{
>> +	encode_op_hdr(xdr, OP_OFFLOAD_STATUS, =
decode_offload_status_maxsz, hdr);
>> +	encode_nfs4_stateid(xdr, &args->osa_stateid);
>> +}
>> +
>> static void encode_deallocate(struct xdr_stream *xdr,
>> 			      struct nfs42_falloc_args *args,
>> 			      struct compound_hdr *hdr)
>> @@ -258,6 +277,24 @@ static void nfs4_xdr_enc_copy(struct rpc_rqst =
*req,
>> }
>>=20
>> /*
>> + * Encode OFFLOAD_STATUS request
>> + */
>> +static void nfs4_xdr_enc_offload_status(struct rpc_rqst *req,
>> +					struct xdr_stream *xdr,
>> +					struct nfs42_offload_status_args =
*args)
>=20
> This last argument should now be: "const void *data"
>=20
>> +{
>> +	struct compound_hdr hdr =3D {
>> +		.minorversion =3D =
nfs4_xdr_minorversion(&args->osa_seq_args),
>> +	};
>> +
>> +	encode_compound_hdr(xdr, req, &hdr);
>> +	encode_sequence(xdr, &args->osa_seq_args, &hdr);
>> +	encode_putfh(xdr, args->osa_src_fh, &hdr);
>> +	encode_offload_status(xdr, args, &hdr);
>> +	encode_nops(&hdr);
>> +}
>> +
>> +/*
>>  * Encode DEALLOCATE request
>>  */
>> static void nfs4_xdr_enc_deallocate(struct rpc_rqst *req,
>> @@ -406,6 +443,31 @@ static int decode_copy(struct xdr_stream *xdr, =
struct nfs42_copy_res *res)
>> 	return decode_copy_requirements(xdr, res);
>> }
>>=20
>> +static int decode_offload_status(struct xdr_stream *xdr,
>> +				 struct nfs42_offload_status_res *res)
>> +{
>> +	__be32 *p;
>> +	uint32_t count;
>> +	int status;
>> +
>> +	status =3D decode_op_hdr(xdr, OP_OFFLOAD_STATUS);
>> +	if (status)
>> +		return status;
>> +	p =3D xdr_inline_decode(xdr, 8 + 4);
>> +	if (unlikely(!p))
>> +		goto out_overflow;
>> +	p =3D xdr_decode_hyper(p, &res->osr_count);
>> +	count =3D be32_to_cpup(p++);
>> +	if (count) {
>> +		p =3D xdr_inline_decode(xdr, 4);
>> +		res->osr_status =3D nfs4_stat_to_errno(be32_to_cpup(p));
>> +	}
>> +	return 0;
>> +out_overflow:
>> +	print_overflow_msg(__func__, xdr);
>> +	return -EIO;
>> +}
>> +
>> static int decode_deallocate(struct xdr_stream *xdr, struct =
nfs42_falloc_res *res)
>> {
>> 	return decode_op_hdr(xdr, OP_DEALLOCATE);
>> @@ -504,6 +566,31 @@ static int nfs4_xdr_dec_copy(struct rpc_rqst =
*rqstp,
>> }
>>=20
>> /*
>> + * Decode OFFLOAD_STATUS response
>> + */
>> +static int nfs4_xdr_dec_offload_status(struct rpc_rqst *rqstp,
>> +				       struct xdr_stream *xdr,
>> +				       struct nfs42_offload_status_res =
*res)
>=20
> And this one should be "void *data"
>=20
> Thanks,
> Anna
>=20
>> +{
>> +	struct compound_hdr hdr;
>> +	int status;
>> +
>> +	status =3D decode_compound_hdr(xdr, &hdr);
>> +	if (status)
>> +		goto out;
>> +	status =3D decode_sequence(xdr, &res->osr_seq_res, rqstp);
>> +	if (status)
>> +		goto out;
>> +	status =3D decode_putfh(xdr);
>> +	if (status)
>> +		goto out;
>> +	status =3D decode_offload_status(xdr, res);
>> +
>> +out:
>> +	return status;
>> +}
>> +
>> +/*
>>  * Decode DEALLOCATE request
>>  */
>> static int nfs4_xdr_dec_deallocate(struct rpc_rqst *rqstp,
>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>> index dbfa189..90be5c1 100644
>> --- a/fs/nfs/nfs4proc.c
>> +++ b/fs/nfs/nfs4proc.c
>> @@ -9229,6 +9229,7 @@ static bool nfs4_match_stateid(const =
nfs4_stateid *s1,
>> 		| NFS_CAP_ATOMIC_OPEN_V1
>> 		| NFS_CAP_ALLOCATE
>> 		| NFS_CAP_COPY
>> +		| NFS_CAP_OFFLOAD_STATUS
>> 		| NFS_CAP_DEALLOCATE
>> 		| NFS_CAP_SEEK
>> 		| NFS_CAP_LAYOUTSTATS
>> diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
>> index 3aebfdc..8b41f43 100644
>> --- a/fs/nfs/nfs4xdr.c
>> +++ b/fs/nfs/nfs4xdr.c
>> @@ -7561,6 +7561,7 @@ struct rpc_procinfo	nfs4_procedures[] =3D {
>> 	PROC(LAYOUTSTATS,	enc_layoutstats,	=
dec_layoutstats),
>> 	PROC(CLONE,		enc_clone,		dec_clone),
>> 	PROC(COPY,		enc_copy,		dec_copy),
>> +	PROC(OFFLOAD_STATUS,	enc_offload_status,	=
dec_offload_status),
>> #endif /* CONFIG_NFS_V4_2 */
>> };
>>=20
>> diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
>> index 1b1ca04..d67c350 100644
>> --- a/include/linux/nfs4.h
>> +++ b/include/linux/nfs4.h
>> @@ -523,6 +523,7 @@ enum {
>> 	NFSPROC4_CLNT_LAYOUTSTATS,
>> 	NFSPROC4_CLNT_CLONE,
>> 	NFSPROC4_CLNT_COPY,
>> +	NFSPROC4_CLNT_OFFLOAD_STATUS,
>> };
>>=20
>> /* nfs41 types */
>> diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
>> index e418a10..36535ad 100644
>> --- a/include/linux/nfs_fs_sb.h
>> +++ b/include/linux/nfs_fs_sb.h
>> @@ -250,5 +250,6 @@ struct nfs_server {
>> #define NFS_CAP_LAYOUTSTATS	(1U << 22)
>> #define NFS_CAP_CLONE		(1U << 23)
>> #define NFS_CAP_COPY		(1U << 24)
>> +#define NFS_CAP_OFFLOAD_STATUS	(1U << 25)
>>=20
>> #endif
>> diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
>> index b28c834..eaaf540 100644
>> --- a/include/linux/nfs_xdr.h
>> +++ b/include/linux/nfs_xdr.h
>> @@ -1386,6 +1386,18 @@ struct nfs42_copy_res {
>> 	struct nfs_commitres		commit_res;
>> };
>>=20
>> +struct nfs42_offload_status_args {
>> +	struct nfs4_sequence_args	osa_seq_args;
>> +	struct nfs_fh			*osa_src_fh;
>> +	nfs4_stateid			osa_stateid;
>> +};
>> +
>> +struct nfs42_offload_status_res {
>> +	struct nfs4_sequence_res	osr_seq_res;
>> +	uint64_t			osr_count;
>> +	int				osr_status;
>> +};
>> +
>> struct nfs42_seek_args {
>> 	struct nfs4_sequence_args	seq_args;
>>=20
>>=20


  reply	other threads:[~2017-07-12 17:23 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 16:43 [PATCH v3 00/42] NFS/NFSD support for async and inter COPY Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 01/42] fs: Don't copy beyond the end of the file Olga Kornievskaia
2017-07-11 18:39   ` Anna Schumaker
2017-07-11 16:43 ` [RFC v3 02/42] VFS permit cross device vfs_copy_file_range Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 03/42] NFS CB_OFFLOAD xdr Olga Kornievskaia
2017-07-11 20:27   ` Anna Schumaker
2017-07-11 16:43 ` [RFC v3 04/42] NFS OFFLOAD_STATUS xdr Olga Kornievskaia
2017-07-11 21:01   ` Anna Schumaker
2017-07-12 17:23     ` Olga Kornievskaia [this message]
2017-07-12 17:25       ` Anna Schumaker
2017-07-11 16:43 ` [RFC v3 05/42] NFS OFFLOAD_STATUS op Olga Kornievskaia
2017-07-12 12:41   ` Anna Schumaker
2017-07-11 16:43 ` [RFC v3 06/42] NFS OFFLOAD_CANCEL xdr Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 07/42] NFS COPY xdr handle async reply Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 08/42] NFS add support for asynchronous COPY Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 09/42] NFS handle COPY reply CB_OFFLOAD call race Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 10/42] NFS export nfs4_async_handle_error Olga Kornievskaia
2017-07-12 13:56   ` Anna Schumaker
2017-07-12 17:18     ` Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 11/42] NFS test for intra vs inter COPY Olga Kornievskaia
2017-07-12 14:06   ` Anna Schumaker
2017-07-12 17:21     ` Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 12/42] NFS send OFFLOAD_CANCEL when COPY killed Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 13/42] NFS handle COPY ERR_OFFLOAD_NO_REQS Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 14/42] NFS if we got partial copy ignore errors Olga Kornievskaia
2017-07-12 14:52   ` Anna Schumaker
2017-07-12 17:19     ` Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 15/42] NFS recover from destination server reboot for copies Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 16/42] NFS NFSD defining nl4_servers structure needed by both Olga Kornievskaia
2017-09-06 20:35   ` J. Bruce Fields
2017-09-08 20:51     ` Olga Kornievskaia
2017-09-11 16:22       ` J. Bruce Fields
2017-07-11 16:43 ` [RFC v3 17/42] NFS add COPY_NOTIFY operation Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 18/42] NFS add ca_source_server<> to COPY Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 19/42] NFS also send OFFLOAD_CANCEL to source server Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 20/42] NFS inter ssc open Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 21/42] NFS skip recovery of copy open on dest server Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 22/42] NFS for "inter" copy treat ESTALE as ENOTSUPP Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 23/42] NFS add a simple sync nfs4_proc_commit after async COPY Olga Kornievskaia
2017-07-12 17:13   ` Anna Schumaker
2017-07-12 17:18     ` Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 24/42] NFSD add ca_source_server<> to COPY Olga Kornievskaia
2017-07-11 16:43 ` [RFC v3 25/42] NFSD add COPY_NOTIFY operation Olga Kornievskaia
2017-09-06 20:45   ` J. Bruce Fields
2017-09-13 14:39     ` Olga Kornievskaia
2017-09-06 21:34   ` J. Bruce Fields
2017-09-13 14:38     ` Olga Kornievskaia
2017-09-06 21:37   ` J. Bruce Fields
2017-09-13 14:38     ` Olga Kornievskaia
2017-09-13 14:42       ` J. Bruce Fields
2017-07-11 16:44 ` [RFC v3 26/42] NFSD generalize nfsd4_compound_state flag names Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 27/42] NFSD: allow inter server COPY to have a STALE source server fh Olga Kornievskaia
2017-09-08 19:38   ` J. Bruce Fields
2017-09-08 19:52     ` Olga Kornievskaia
2017-09-08 19:57       ` J. Bruce Fields
2017-09-08 20:09         ` Olga Kornievskaia
2017-09-14 18:44     ` Olga Kornievskaia
2017-09-15  1:47       ` J. Bruce Fields
2017-09-15 19:46         ` Olga Kornievskaia
2017-09-15 20:02           ` J. Bruce Fields
2017-09-15 20:06             ` J. Bruce Fields
2017-09-15 20:11               ` Olga Kornievskaia
2017-09-16 14:44               ` J. Bruce Fields
2017-07-11 16:44 ` [RFC v3 28/42] NFSD add nfs4 inter ssc to nfsd4_copy Olga Kornievskaia
2017-09-08 20:28   ` J. Bruce Fields
2017-07-11 16:44 ` [RFC v3 29/42] NFSD return nfs4_stid in nfs4_preprocess_stateid_op Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 30/42] NFSD Unique stateid_t for inter server to server COPY authentication Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 31/42] NFSD CB_OFFLOAD xdr Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 32/42] NFSD OFFLOAD_STATUS xdr Olga Kornievskaia
2017-07-12 19:39   ` Anna Schumaker
2017-07-11 16:44 ` [RFC v3 33/42] NFSD OFFLOAD_CANCEL xdr Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 34/42] NFSD xdr callback stateid in async COPY reply Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 35/42] NFSD first draft of async copy Olga Kornievskaia
2017-07-12 20:29   ` Anna Schumaker
2017-07-11 16:44 ` [RFC v3 36/42] NFSD handle OFFLOAD_CANCEL op Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 37/42] NFSD stop queued async copies on client shutdown Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 38/42] NFSD create new stateid for async copy Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 39/42] NFSD define EBADF in nfserrno Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 40/42] NFSD support OFFLOAD_STATUS Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 41/42] NFSD remove copy stateid when vfs_copy_file_range completes Olga Kornievskaia
2017-07-11 16:44 ` [RFC v3 42/42] NFSD delay the umount after COPY Olga Kornievskaia

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=8B2DF11C-B157-419E-A061-F5BF61232061@netapp.com \
    --to=kolga@netapp.com \
    --cc=Trond.Myklebust@primarydata.com \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=schumaker.anna@gmail.com \
    /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.