[pnfs] [PATCH 2/8] pnfs: refactor get_layout
Benny Halevy
bhalevy at panasas.com
Wed Mar 12 09:27:25 EDT 2008
On Mar. 10, 2008, 20:39 +0200, andros at umich.edu wrote:
> From: Andy Adamson <andros at umich.edu>
>
> Prepare to split off pnfs_update_layout_done from pnfs_update_layout.
>
> Signed-off-by: Andy Adamson<andros at umich.edu>
> ---
> fs/nfs/pnfs.c | 23 +++++++++++++----------
> 1 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index 8059181..757e917 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -472,16 +472,13 @@ lo_seg_intersecting(struct nfs4_pnfs_layout_segment *l1,
> static int
> get_layout(struct inode *ino,
> struct nfs_open_context *ctx,
> - struct nfs4_pnfs_layoutget_arg *arg,
> - struct nfs4_pnfs_layoutget_res *res)
> + struct nfs4_pnfs_layoutget *lgp)
> {
> - int status;
> + struct nfs4_pnfs_layoutget_arg *arg = lgp->args;
> struct nfs_server *server = NFS_SERVER(ino);
> - struct nfs4_pnfs_layoutget gdata = {
> - .args = arg,
> - .res = res,
> - };
> - dprintk("%s:Begin\n", __FUNCTION__);
> + int status;
nit: I'd leave this line in place in the spirit of minimalism.
> +
> + dprintk("-->%s\n", __func__);
nit: missing space before %s
Benny
>
> arg->type = server->pnfs_curr_ld->id;
> arg->minlength = arg->lseg.length;
> @@ -490,7 +487,9 @@ get_layout(struct inode *ino,
> arg->ctx = ctx;
>
> /* Retrieve layout information from server */
> - status = NFS_PROTO(ino)->pnfs_layoutget(&gdata);
> + status = NFS_PROTO(ino)->pnfs_layoutget(lgp);
> +
> + dprintk("<-- %s status %d\n", __func__, status);
> return status;
> }
>
> @@ -823,6 +822,10 @@ pnfs_update_layout(struct inode *ino,
> {
> struct nfs4_pnfs_layoutget_res res;
> struct nfs4_pnfs_layoutget_arg arg;
> + struct nfs4_pnfs_layoutget gdata = {
> + .args = &arg,
> + .res = &res,
> + };
> struct nfs_inode *nfsi = NFS_I(ino);
> struct nfs_server *nfss = NFS_SERVER(ino);
> struct pnfs_layout_type *layout_new;
> @@ -868,7 +871,7 @@ pnfs_update_layout(struct inode *ino,
> res.layout.buf = NULL;
> memcpy(&layout_new->stateid.data, &arg.stateid.data, NFS4_STATEID_SIZE);
> spin_unlock(&nfsi->lo_lock);
> - result = get_layout(ino, ctx, &arg, &res);
> + result = get_layout(ino, ctx, &gdata);
> spin_lock(&nfsi->lo_lock);
> /* FIXME: check for reordering using the returned sequence id */
> memcpy(&res.stateid.data, &layout_new->stateid.data, NFS4_STATEID_SIZE);
More information about the pNFS
mailing list