linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: andros@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters
Date: Tue, 20 Jul 2010 07:33:58 +0300	[thread overview]
Message-ID: <4C452736.7010201@panasas.com> (raw)
In-Reply-To: <4C45257D.7000507@panasas.com>

On Jul. 20, 2010, 7:26 +0300, Benny Halevy <bhalevy@panasas.com> wrote:
> On Jul. 15, 2010, 19:13 +0300, andros@netapp.com wrote:
>> From: Andy Adamson <andros@netapp.com>
>>
>> Remove the numpages calculation which is not used by the file layout driver.
>> Layout drivers that need the number of pages can call nfs_page_array_len in
>> their write_pagelist operation.
>>
>> NOTE: API change.
>>
>> Signed-off-by: Andy Adamson <andros@netapp.com>
>> ---
>>  fs/nfs/pnfs.c             |   24 +++---------------------
>>  include/linux/nfs4_pnfs.h |    5 +----
>>  2 files changed, 4 insertions(+), 25 deletions(-)
>>
>> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
>> index 576946b..51bd66f 100644
>> --- a/fs/nfs/pnfs.c
>> +++ b/fs/nfs/pnfs.c
>> @@ -1271,39 +1271,21 @@ enum pnfs_try_status
>>  pnfs_try_to_write_data(struct nfs_write_data *wdata,
>>  			const struct rpc_call_ops *call_ops, int how)
>>  {
>> -	struct nfs_writeargs *args = &wdata->args;
>>  	struct inode *inode = wdata->inode;
>>  	enum pnfs_try_status trypnfs;
>>  	struct nfs_server *nfss = NFS_SERVER(inode);
>> -	struct nfs_inode *nfsi = NFS_I(inode);
>>  	struct pnfs_layout_segment *lseg = wdata->req->wb_lseg;
>> -	int numpages;
>>  
>>  	wdata->pdata.call_ops = call_ops;
>>  	wdata->pdata.how = how;
>>  
>> -	dprintk("%s: Writing ino:%lu %u@%llu\n", __func__,
>> -		inode->i_ino, args->count, args->offset);
>> +	dprintk("%s: Writing ino:%lu %u@%llu (how %d)\n", __func__,
>> +		inode->i_ino, wdata->args.count, wdata->args.offset, how);
>>  
>>  	get_lseg(lseg);
>>  
>> -	/* Determine number of pages
>> -	 */
>> -	numpages = nfs_page_array_len(args->pgbase, args->count);
> 
> Andy, removing this from the interface is a bit problematic
> since nfs_page_array_len is private to the nfs module and I want to leave
> the logic there rather than copying it to the layout driver.
> Also, we still pass in its equivalent to read_pagelist so for symmetry
> reasons it would be cleaner to pass to to the write path as well.

and we should use nfs_page_array_len for the read path as well.
In any case the calculation is straight forward so we should either do
it in the generic layer in both cases or neither.

Benny

> 
> Benny
> 
>> -
>> -	dprintk("%s: Calling layout driver (how %d) write with %d pages\n",
>> -		__func__, how, numpages);
>> -
>>  	wdata->pdata.lseg = lseg;
>> -	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->write_pagelist(
>> -							nfsi->layout,
>> -							args->pages,
>> -							args->pgbase,
>> -							numpages,
>> -							(loff_t)args->offset,
>> -							args->count,
>> -							how,
>> -							wdata);
>> +	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->write_pagelist(wdata, how);
>>  
>>  	if (trypnfs == PNFS_NOT_ATTEMPTED) {
>>  		wdata->pdata.lseg = NULL;
>> diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
>> index b379225..13f71ad 100644
>> --- a/include/linux/nfs4_pnfs.h
>> +++ b/include/linux/nfs4_pnfs.h
>> @@ -130,10 +130,7 @@ struct layoutdriver_io_operations {
>>  	enum pnfs_try_status
>>  	(*read_pagelist) (struct nfs_read_data *nfs_data, unsigned nr_pages);
>>  	enum pnfs_try_status
>> -	(*write_pagelist) (struct pnfs_layout_type *layoutid,
>> -			   struct page **pages, unsigned int pgbase,
>> -			   unsigned nr_pages, loff_t offset, size_t count,
>> -			   int sync, struct nfs_write_data *nfs_data);
>> +	(*write_pagelist) (struct nfs_write_data *nfs_data, int how);
>>  
>>  	/* Consistency ops */
>>  	/* 2 problems:
> --
> 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

  reply	other threads:[~2010-07-20  4:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15 16:13 [PATCH 0/7] pnfs-submit layoutdriver api parameter consolidation andros
2010-07-15 16:13 ` [PATCH 1/7] SQUASHME pnfs-submit fix CONFIG_NFS_V4_1 not set compile error andros
2010-07-15 16:13   ` [PATCH 2/7] SQUASHME pnfs-submit consolidate read_pagelist parameters andros
2010-07-15 16:13     ` [PATCH 3/7] SQUASHME pnfs-submit filelayout use new read_pagelist API andros
2010-07-15 16:13       ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters andros
2010-07-15 16:13         ` [PATCH 5/7] SQUASHME pnfs-submit filelayout use new write_pagelist API andros
2010-07-15 16:13           ` [PATCH 6/7] SQUASHME pnfs-submit consolidate commit parameters andros
2010-07-15 16:13             ` [PATCH 7/7] SQUASHME pnfs-submit filelayout_commit use new API andros
2010-07-20  4:26         ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters Benny Halevy
2010-07-20  4:33           ` Benny Halevy [this message]
2010-07-20 13:51             ` William A. (Andy) Adamson

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=4C452736.7010201@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=andros@netapp.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 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).