Compile fix.
0001-SQUASHME-pnfs-submit-fix-CONFIG_NFS_V4_1-not-set-com.patch
The read_pagelist, write_pagelist, and commit layoutdriver io operations
parameters are all serviced by either nfs_write_data or nfs_read_data
fields. Just pass in the data structs.
0002-SQUASHME-pnfs-submit-consolidate-read_pagelist-param.patch
0003-SQUASHME-pnfs-submit-filelayout-use-new-read_pagelis.patch
0004-SQUASHME-pnfs-submit-consolidate-write_pagelist-para.patch
0005-SQUASHME-pnfs-submit-filelayout-use-new-write_pageli.patch
0006-SQUASHME-pnfs-submit-consolidate-commit-parameters.patch
0007-SQUASHME-pnfs-submit-filelayout_commit-use-new-API.patch
Testing
CONFIG_NFS_V4_1 set:
Connectathon passes
CONFIG_NFS_V4_1 not set:
Connectathon passes
-->Andy
On Jul. 20, 2010, 7:26 +0300, Benny Halevy <[email protected]> wrote:
> On Jul. 15, 2010, 19:13 +0300, [email protected] wrote:
>> From: Andy Adamson <[email protected]>
>>
>> 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 <[email protected]>
>> ---
>> 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 [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
On Jul. 15, 2010, 19:13 +0300, [email protected] wrote:
> From: Andy Adamson <[email protected]>
>
> 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 <[email protected]>
> ---
> 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.
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:
Ah - I see now. OK - numpages in write_pagelist.
-->Andy
On Tue, Jul 20, 2010 at 12:33 AM, Benny Halevy <[email protected]> wr=
ote:
> On Jul. 20, 2010, 7:26 +0300, Benny Halevy <[email protected]> wrot=
e:
>> On Jul. 15, 2010, 19:13 +0300, [email protected] wrote:
>>> From: Andy Adamson <[email protected]>
>>>
>>> Remove the numpages calculation which is not used by the file layou=
t driver.
>>> Layout drivers that need the number of pages can call nfs_page_arra=
y_len in
>>> their write_pagelist operation.
>>>
>>> NOTE: API change.
>>>
>>> Signed-off-by: Andy Adamson <[email protected]>
>>> ---
>>> =A0fs/nfs/pnfs.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 24 +++--------------=
-------
>>> =A0include/linux/nfs4_pnfs.h | =A0 =A05 +----
>>> =A02 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
>>> =A0pnfs_try_to_write_data(struct nfs_write_data *wdata,
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const struct rpc_call_op=
s *call_ops, int how)
>>> =A0{
>>> - =A0 =A0struct nfs_writeargs *args =3D &wdata->args;
>>> =A0 =A0 =A0struct inode *inode =3D wdata->inode;
>>> =A0 =A0 =A0enum pnfs_try_status trypnfs;
>>> =A0 =A0 =A0struct nfs_server *nfss =3D NFS_SERVER(inode);
>>> - =A0 =A0struct nfs_inode *nfsi =3D NFS_I(inode);
>>> =A0 =A0 =A0struct pnfs_layout_segment *lseg =3D wdata->req->wb_lseg=
;
>>> - =A0 =A0int numpages;
>>>
>>> =A0 =A0 =A0wdata->pdata.call_ops =3D call_ops;
>>> =A0 =A0 =A0wdata->pdata.how =3D how;
>>>
>>> - =A0 =A0dprintk("%s: Writing ino:%lu %u@%llu\n", __func__,
>>> - =A0 =A0 =A0 =A0 =A0 =A0inode->i_ino, args->count, args->offset);
>>> + =A0 =A0dprintk("%s: Writing ino:%lu %u@%llu (how %d)\n", __func__=
,
>>> + =A0 =A0 =A0 =A0 =A0 =A0inode->i_ino, wdata->args.count, wdata->ar=
gs.offset, how);
>>>
>>> =A0 =A0 =A0get_lseg(lseg);
>>>
>>> - =A0 =A0/* Determine number of pages
>>> - =A0 =A0 */
>>> - =A0 =A0numpages =3D 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 symmet=
ry
>> 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 d=
o
> it in the generic layer in both cases or neither.
>
> Benny
>
>>
>> Benny
>>
>>> -
>>> - =A0 =A0dprintk("%s: Calling layout driver (how %d) write with %d =
pages\n",
>>> - =A0 =A0 =A0 =A0 =A0 =A0__func__, how, numpages);
>>> -
>>> =A0 =A0 =A0wdata->pdata.lseg =3D lseg;
>>> - =A0 =A0trypnfs =3D nfss->pnfs_curr_ld->ld_io_ops->write_pagelist(
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nfsi->layout,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0args->pages,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0args->pgbase,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0numpages,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(loff_t)args->offset,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0args->count,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0how,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wdata);
>>> + =A0 =A0trypnfs =3D nfss->pnfs_curr_ld->ld_io_ops->write_pagelist(=
wdata, how);
>>>
>>> =A0 =A0 =A0if (trypnfs =3D=3D PNFS_NOT_ATTEMPTED) {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0wdata->pdata.lseg =3D 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 {
>>> =A0 =A0 =A0enum pnfs_try_status
>>> =A0 =A0 =A0(*read_pagelist) (struct nfs_read_data *nfs_data, unsign=
ed nr_pages);
>>> =A0 =A0 =A0enum pnfs_try_status
>>> - =A0 =A0(*write_pagelist) (struct pnfs_layout_type *layoutid,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct page **pages, =
unsigned int pgbase,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned nr_pages, lo=
ff_t offset, size_t count,
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int sync, struct nfs_=
write_data *nfs_data);
>>> + =A0 =A0(*write_pagelist) (struct nfs_write_data *nfs_data, int ho=
w);
>>>
>>> =A0 =A0 =A0/* Consistency ops */
>>> =A0 =A0 =A0/* 2 problems:
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs"=
in
>> the body of a message to [email protected]
>> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" =
in
> the body of a message to [email protected]
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>
From: Andy Adamson <[email protected]>
Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/nfs4filelayout.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index d7f0f62..dc3ee0c 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -553,8 +553,7 @@ static struct rpc_call_ops filelayout_commit_call_ops = {
* Invoke the pnfs_commit_complete callback.
*/
enum pnfs_try_status
-filelayout_commit(struct pnfs_layout_type *layoutid, int sync,
- struct nfs_write_data *data)
+filelayout_commit(struct nfs_write_data *data, int sync)
{
LIST_HEAD(head);
struct nfs_page *req;
--
1.6.6
From: Andy Adamson <[email protected]>
Signed-off-by: Andy Adamson <[email protected]>
---
include/linux/nfs4_pnfs.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 9eebbdd..fe18143 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -84,6 +84,12 @@ layoutcommit_needed(struct nfs_inode *nfsi)
#else /* CONFIG_NFS_V4_1 */
static inline bool
+has_layout(struct nfs_inode *nfsi)
+{
+ return false;
+}
+
+static inline bool
layoutcommit_needed(struct nfs_inode *nfsi)
{
return 0;
--
1.6.6
From: Andy Adamson <[email protected]>
NOTE: API change
Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/pnfs.c | 3 +--
include/linux/nfs4_pnfs.h | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 51bd66f..7327cb2 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1362,8 +1362,7 @@ pnfs_try_to_commit(struct nfs_write_data *data,
data->pdata.call_ops = call_ops;
data->pdata.how = sync;
data->pdata.lseg = NULL;
- trypnfs = nfss->pnfs_curr_ld->ld_io_ops->commit(NFS_I(inode)->layout,
- sync, data);
+ trypnfs = nfss->pnfs_curr_ld->ld_io_ops->commit(data, sync);
if (trypnfs == PNFS_NOT_ATTEMPTED)
_pnfs_clear_lseg_from_pages(&data->pages);
else
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 13f71ad..5782156 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -138,8 +138,7 @@ struct layoutdriver_io_operations {
* 2) currently the NFS code doesn't create a page array (as it does with read/write)
*/
enum pnfs_try_status
- (*commit) (struct pnfs_layout_type *layoutid,
- int sync, struct nfs_write_data *nfs_data);
+ (*commit) (struct nfs_write_data *nfs_data, int how);
/* Layout information. For each inode, alloc_layout is executed once to retrieve an
* inode specific layout structure. Each subsequent layoutget operation results in
--
1.6.6
From: Andy Adamson <[email protected]>
Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/nfs4filelayout.c | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 45b0dcc..d7f0f62 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -244,24 +244,14 @@ filelayout_read_pagelist(struct nfs_read_data *data, unsigned nr_pages)
/* Perform async writes. */
static enum pnfs_try_status
-filelayout_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 *data)
+filelayout_write_pagelist(struct nfs_write_data *data, int sync)
{
- struct inode *inode = PNFS_INODE(layoutid);
struct pnfs_layout_segment *lseg = data->pdata.lseg;
struct nfs4_pnfs_ds *ds;
+ loff_t offset = data->args.offset;
u32 idx;
struct nfs_fh *fh;
- dprintk("--> %s ino %lu nr_pages %d pgbase %u req %Zu@%llu sync %d\n",
- __func__, inode->i_ino, nr_pages, pgbase, count, offset, sync);
-
/* Retrieve the correct rpc_client for the byte range */
idx = nfs4_fl_calc_ds_index(lseg, offset);
ds = nfs4_fl_prepare_ds(lseg, idx);
@@ -269,8 +259,8 @@ filelayout_write_pagelist(struct pnfs_layout_type *layoutid,
printk(KERN_ERR "%s: prepare_ds failed, use MDS\n", __func__);
return PNFS_NOT_ATTEMPTED;
}
- dprintk("%s ino %lu %Zu@%llu DS:%x:%hu %s\n",
- __func__, inode->i_ino, count, offset,
+ dprintk("%s ino %lu sync %d req %Zu@%llu DS:%x:%hu %s\n", __func__,
+ data->inode->i_ino, sync, (size_t) data->args.count, offset,
htonl(ds->ds_ip_addr), ntohs(ds->ds_port), ds->r_addr);
data->fldata.ds_nfs_client = ds->ds_clp;
--
1.6.6
From: Andy Adamson <[email protected]>
Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/nfs4filelayout.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index d60fa1f..45b0dcc 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -199,22 +199,17 @@ struct rpc_call_ops filelayout_write_call_ops = {
* TODO: join with write_pagelist?
*/
static enum pnfs_try_status
-filelayout_read_pagelist(struct pnfs_layout_type *layoutid,
- struct page **pages,
- unsigned int pgbase,
- unsigned nr_pages,
- loff_t offset,
- size_t count,
- struct nfs_read_data *data)
+filelayout_read_pagelist(struct nfs_read_data *data, unsigned nr_pages)
{
- struct inode *inode = PNFS_INODE(layoutid);
struct pnfs_layout_segment *lseg = data->pdata.lseg;
struct nfs4_pnfs_ds *ds;
+ loff_t offset = data->args.offset;
u32 idx;
struct nfs_fh *fh;
dprintk("--> %s ino %lu nr_pages %d pgbase %u req %Zu@%llu\n",
- __func__, inode->i_ino, nr_pages, pgbase, count, offset);
+ __func__, data->inode->i_ino, nr_pages,
+ data->args.pgbase, (size_t)data->args.count, offset);
/* Retrieve the correct rpc_client for the byte range */
idx = nfs4_fl_calc_ds_index(lseg, offset);
--
1.6.6
From: Andy Adamson <[email protected]>
NOTE: API change.
Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/pnfs.c | 17 ++++-------------
include/linux/nfs4_pnfs.h | 5 +----
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 56c3af4..576946b 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1325,23 +1325,21 @@ enum pnfs_try_status
pnfs_try_to_read_data(struct nfs_read_data *rdata,
const struct rpc_call_ops *call_ops)
{
- struct nfs_readargs *args = &rdata->args;
struct inode *inode = rdata->inode;
- int numpages, pgcount, temp;
struct nfs_server *nfss = NFS_SERVER(inode);
- struct nfs_inode *nfsi = NFS_I(inode);
struct pnfs_layout_segment *lseg = rdata->req->wb_lseg;
+ int numpages, pgcount, temp;
enum pnfs_try_status trypnfs;
rdata->pdata.call_ops = call_ops;
dprintk("%s: Reading ino:%lu %u@%llu\n",
- __func__, inode->i_ino, args->count, args->offset);
+ __func__, inode->i_ino, rdata->args.count, rdata->args.offset);
get_lseg(lseg);
/* Determine number of pages. */
- pgcount = args->pgbase + args->count;
+ pgcount = rdata->args.pgbase + rdata->args.count;
temp = pgcount % PAGE_CACHE_SIZE;
numpages = pgcount / PAGE_CACHE_SIZE;
if (temp != 0)
@@ -1350,14 +1348,7 @@ pnfs_try_to_read_data(struct nfs_read_data *rdata,
dprintk("%s: Calling layout driver read with %d pages\n",
__func__, numpages);
rdata->pdata.lseg = lseg;
- trypnfs = nfss->pnfs_curr_ld->ld_io_ops->read_pagelist(
- nfsi->layout,
- args->pages,
- args->pgbase,
- numpages,
- (loff_t)args->offset,
- args->count,
- rdata);
+ trypnfs = nfss->pnfs_curr_ld->ld_io_ops->read_pagelist(rdata, numpages);
if (trypnfs == PNFS_NOT_ATTEMPTED) {
rdata->pdata.lseg = NULL;
put_lseg(lseg);
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index fe18143..b379225 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -128,10 +128,7 @@ struct layoutdriver_io_operations {
* MUST be called.
*/
enum pnfs_try_status
- (*read_pagelist) (struct pnfs_layout_type *layoutid,
- struct page **pages, unsigned int pgbase,
- unsigned nr_pages, loff_t offset, size_t count,
- struct nfs_read_data *nfs_data);
+ (*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,
--
1.6.6
From: Andy Adamson <[email protected]>
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 <[email protected]>
---
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);
-
- 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:
--
1.6.6