[pnfs] [PATCH 1/1] pnfs: fix pnfs_{read|write}pages part 1
Benny Halevy
bhalevy at panasas.com
Fri Mar 14 10:52:02 EDT 2008
Thanks!
Applied onto the pnfs branch.
Benny
Fred Isaman wrote:
> My goal is still to have the io_ops functions return just 0 or 1, but
> as a step in that direction...
>
> No layout driver returns a positive value for the
> ld_io_ops->{read|write}_pagelist functions. So lets decree they can't,
> and remove some unused code.
>
> Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
> ---
> fs/nfs/pnfs.c | 12 ------------
> include/linux/nfs4_pnfs.h | 13 +++++++++++--
> 2 files changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index 8059181..8053aae 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -1424,13 +1424,6 @@ pnfs_writepages(struct nfs_write_data *wdata, int how)
>
> if (status)
> put_lseg(lseg);
> - if (status > 0) {
> - dprintk("%s: LD write_pagelist returned status %d > 0\n", __FUNCTION__, status);
> - pnfs_update_last_write(nfsi, args->offset, status);
> - pnfs_need_layoutcommit(nfsi, wdata->args.context);
> - status = 0;
> - }
> -
> out:
> dprintk("%s: End Status %d\n", __FUNCTION__, status);
> return status;
> @@ -1505,11 +1498,6 @@ pnfs_readpages(struct nfs_read_data *rdata)
> rdata);
> if (status)
> put_lseg(lseg);
> - if (status > 0) {
> - dprintk("%s: LD read_pagelist returned status %d > 0\n", __FUNCTION__, status);
> - status = 0;
> - }
> -
> out:
> dprintk("%s: End Status %d\n", __FUNCTION__, status);
> return status;
> diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
> index 381a599..031c1b9 100644
> --- a/include/linux/nfs4_pnfs.h
> +++ b/include/linux/nfs4_pnfs.h
> @@ -116,8 +116,17 @@ struct layoutdriver_io_operations {
> /* Functions that use the pagecache.
> * If use_pagecache == 1, then these functions must be implemented.
> */
> - ssize_t (*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);
> - ssize_t (*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);
> + /* read and write pagelist should return just 0 (success) or a
> + * negative error code.
> + */
> + int (*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);
> + int (*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);
> int (*flush_one) (struct pnfs_layout_segment *, struct list_head *head, unsigned int npages, size_t count, int how);
> void (*free_request_data) (struct nfs_page *);
>
More information about the pNFS
mailing list