* [PATCH 0/7] pnfs-submit layoutdriver api parameter consolidation
@ 2010-07-15 16:13 andros
2010-07-15 16:13 ` [PATCH 1/7] SQUASHME pnfs-submit fix CONFIG_NFS_V4_1 not set compile error andros
0 siblings, 1 reply; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/7] SQUASHME pnfs-submit fix CONFIG_NFS_V4_1 not set compile error
2010-07-15 16:13 [PATCH 0/7] pnfs-submit layoutdriver api parameter consolidation andros
@ 2010-07-15 16:13 ` andros
2010-07-15 16:13 ` [PATCH 2/7] SQUASHME pnfs-submit consolidate read_pagelist parameters andros
0 siblings, 1 reply; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/7] SQUASHME pnfs-submit consolidate read_pagelist parameters
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 ` andros
2010-07-15 16:13 ` [PATCH 3/7] SQUASHME pnfs-submit filelayout use new read_pagelist API andros
0 siblings, 1 reply; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
NOTE: API change.
Signed-off-by: Andy Adamson <andros@netapp.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/7] SQUASHME pnfs-submit filelayout use new read_pagelist API
2010-07-15 16:13 ` [PATCH 2/7] SQUASHME pnfs-submit consolidate read_pagelist parameters andros
@ 2010-07-15 16:13 ` andros
2010-07-15 16:13 ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters andros
0 siblings, 1 reply; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters
2010-07-15 16:13 ` [PATCH 3/7] SQUASHME pnfs-submit filelayout use new read_pagelist API andros
@ 2010-07-15 16:13 ` andros
2010-07-15 16:13 ` [PATCH 5/7] SQUASHME pnfs-submit filelayout use new write_pagelist API andros
2010-07-20 4:26 ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters Benny Halevy
0 siblings, 2 replies; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
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);
-
- 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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/7] SQUASHME pnfs-submit filelayout use new write_pagelist API
2010-07-15 16:13 ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters andros
@ 2010-07-15 16:13 ` andros
2010-07-15 16:13 ` [PATCH 6/7] SQUASHME pnfs-submit consolidate commit parameters andros
2010-07-20 4:26 ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters Benny Halevy
1 sibling, 1 reply; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/7] SQUASHME pnfs-submit consolidate commit parameters
2010-07-15 16:13 ` [PATCH 5/7] SQUASHME pnfs-submit filelayout use new write_pagelist API andros
@ 2010-07-15 16:13 ` andros
2010-07-15 16:13 ` [PATCH 7/7] SQUASHME pnfs-submit filelayout_commit use new API andros
0 siblings, 1 reply; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
NOTE: API change
Signed-off-by: Andy Adamson <andros@netapp.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/7] SQUASHME pnfs-submit filelayout_commit use new API
2010-07-15 16:13 ` [PATCH 6/7] SQUASHME pnfs-submit consolidate commit parameters andros
@ 2010-07-15 16:13 ` andros
0 siblings, 0 replies; 11+ messages in thread
From: andros @ 2010-07-15 16:13 UTC (permalink / raw)
To: bhalevy; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters
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-20 4:26 ` Benny Halevy
2010-07-20 4:33 ` Benny Halevy
1 sibling, 1 reply; 11+ messages in thread
From: Benny Halevy @ 2010-07-20 4:26 UTC (permalink / raw)
To: andros; +Cc: linux-nfs
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.
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:
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters
2010-07-20 4:26 ` [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters Benny Halevy
@ 2010-07-20 4:33 ` Benny Halevy
2010-07-20 13:51 ` William A. (Andy) Adamson
0 siblings, 1 reply; 11+ messages in thread
From: Benny Halevy @ 2010-07-20 4:33 UTC (permalink / raw)
To: andros; +Cc: linux-nfs
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/7] SQUASHME pnfs-submit consolidate write_pagelist parameters
2010-07-20 4:33 ` Benny Halevy
@ 2010-07-20 13:51 ` William A. (Andy) Adamson
0 siblings, 0 replies; 11+ messages in thread
From: William A. (Andy) Adamson @ 2010-07-20 13:51 UTC (permalink / raw)
To: Benny Halevy; +Cc: linux-nfs
Ah - I see now. OK - numpages in write_pagelist.
-->Andy
On Tue, Jul 20, 2010 at 12:33 AM, Benny Halevy <bhalevy@panasas.com> wr=
ote:
> On Jul. 20, 2010, 7:26 +0300, Benny Halevy <bhalevy@panasas.com> wrot=
e:
>> 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 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 <andros@netapp.com>
>>> ---
>>> =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 majordomo@vger.kernel.org
>> 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 majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-07-20 13:52 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-07-20 13:51 ` William A. (Andy) Adamson
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).