linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anna Schumaker <Anna.Schumaker@netapp.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <linux-nfs@vger.kernel.org>, <Trond.Myklebust@primarydata.com>,
	<bfields@fieldses.org>
Subject: Re: [PATCH v2 2/3] NFSD: Implement the COPY call
Date: Mon, 4 Jan 2016 14:39:43 -0500	[thread overview]
Message-ID: <568ACA7F.7000707@Netapp.com> (raw)
In-Reply-To: <20151220155040.GB18236@infradead.org>

On 12/20/2015 10:50 AM, Christoph Hellwig wrote:
>> +nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>> +		  stateid_t *src_stateid, struct file **src,
>> +		  stateid_t *dst_stateid, struct file **dst)
> 
> I'm not really sold on a helper for two function calls and a simple
> conditional.  I'm also not totally against it, though.

I'm planning to keep the helper, since it's still a big chunk of code that would otherwise need to be duplicated.

> 
>> +	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, NFS4_VERIFIER_SIZE);
> 
> please stick to 80 characters per line.

Okay.

> 
>> +
>> +static __be32
>> +nfsd4_encode_copy(struct nfsd4_compoundres *resp, __be32 nfserr,
>> +		  struct nfsd4_copy *copy)
>> +{
>> +	__be32 *p, err;
>> +
>> +	if (!nfserr) {
>> +		err = nfsd42_encode_write_res(resp, &copy->cp_res);
>> +		if (err)
>> +			return err;
>> +
>> +		p = xdr_reserve_space(&resp->xdr, 4 + 4);
>> +		*p++ = cpu_to_be32(copy->cp_consecutive);
>> +		*p++ = cpu_to_be32(copy->cp_synchronous);
>> +	}
>> +	return nfserr;
> 
> seems lke the err variable is redundant and you could just use nfserr.

Sure.

> 
>> +ssize_t nfsd_copy_range(struct file *src, u64 src_pos,
>> +		        struct file *dst, u64 dst_pos,
>> +		        u64 count)
> 
> the prototype would easily fit on two lines.

Fixed.

> 
>> +{
>> +	//u64 limit = 0x800000; /* 4 MB */
>> +	//u64 limit = 0x1000000; /* 8 MB */
>> +	//u64 limit = 0x2000000; /* 16 MB */
>> +	//u64 limit = 0x4000000; /* 32 MB */
>> +	//u64 limit = 0x8000000; /* 64 MB */
>> +	//u64 limit = 0x10000000; /* 128 MB */
>> +	//u64 limit = 0x10000000; /* 256 MB */
>> +	//u64 limit = 0x20000000; /* 512 MB */
>> +	//u64 limit = 0x40000000; /* 1024 MB */
>> +	//u64 limit = 0x80000000; /* 2048 MB */
>> +
>> +	//if (count > limit)
>> +	//	count = limit;
> 
> This looks like odd left over debug code.  Note that vfs_copy_file_range
> has a size_t limit, so we might need some explicit handling here instead
> of silent truncation.

Yeah, I meant to remove that before submitting.  I think an unstable reply works better than a silent (and arbitrary) truncate.

Anna

> 


  reply	other threads:[~2016-01-04 19:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18 21:05 [PATCH v2 0/3] NFSv4.2: Add support for the COPY operation Anna Schumaker
2015-12-18 21:05 ` [PATCH v2 1/3] NFSD: Don't pass filehandle to nfs4_preprocess_stateid_op() Anna Schumaker
2015-12-20 15:45   ` Christoph Hellwig
2016-01-04 19:01     ` Anna Schumaker
2015-12-18 21:05 ` [PATCH v2 2/3] NFSD: Implement the COPY call Anna Schumaker
2015-12-20 15:50   ` Christoph Hellwig
2016-01-04 19:39     ` Anna Schumaker [this message]
2015-12-18 21:05 ` [PATCH v2 3/3] NFS: Add COPY nfs operation Anna Schumaker
2015-12-20 15:53   ` Christoph Hellwig
2016-01-04 20:05     ` Anna Schumaker
2015-12-18 21:05 ` [RFC v2 4/3] vfs_copy_range() test program Anna Schumaker

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=568ACA7F.7000707@Netapp.com \
    --to=anna.schumaker@netapp.com \
    --cc=Trond.Myklebust@primarydata.com \
    --cc=bfields@fieldses.org \
    --cc=hch@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).