[pnfs] [PATCH] add back fh on export op layout_get

William A. (Andy) Adamson andros at citi.umich.edu
Mon Jun 4 17:13:49 EDT 2007


ok - pushed to master branch

-->Andy

On 6/4/07, Marc Eshel <eshel at almaden.ibm.com> wrote:
>
> Andy, can you push this one too.
> Thanks, Marc.
>
>
>
>
> Marc Eshel <eshel at almaden.ibm.com>
> Sent by: pnfs-bounces at linux-nfs.org
> 06/04/2007 10:28 AM
>
> To
> andros at citi.umich.edu
> cc
> pnfs at linux-nfs.org
> Subject
> [pnfs] [PATCH] add back fh on export op layout_get
>
>
>
>
>
>
> From: Marc Eshel <eshel at almaden.ibm.com>
>
>
> ---
>
> fs/nfsd/nfs4filelayoutxdr.c        |   15 +++------------
> fs/nfsd/nfs4state.c                |    1 +
> include/linux/nfsd/nfs4layoutxdr.h |    2 +-
> include/linux/nfsd/nfsd4_pnfs.h    |    1 +
> 4 files changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/fs/nfsd/nfs4filelayoutxdr.c b/fs/nfsd/nfs4filelayoutxdr.c
> index 1258dea..68ea45d 100644
> --- a/fs/nfsd/nfs4filelayoutxdr.c
> +++ b/fs/nfsd/nfs4filelayoutxdr.c
> @@ -87,7 +87,7 @@ static int
> filelayout_encode_layoutlist_item(u32 *p, u32 *end, struct
> nfsd4_pnfs_layoutlist *item)
> {
>                  int len;
> -                unsigned int fhlen = item->fhp->fh_size;
> +                unsigned int fhlen = item->dev_fh.fh_size;
>
>                  len = 16 + fhlen;
>                  if (p + XDR_QUADLEN(len) > end)
> @@ -96,7 +96,7 @@ filelayout_encode_layoutlist_item(u32 *p
>                  WRITE32(item->dev_id);
>                  WRITE32(item->dev_index);
>                  WRITE32(fhlen);
> -                WRITEMEM(&item->fhp->fh_base, fhlen);
> +                WRITEMEM(&item->dev_fh.fh_base, fhlen);
>                  return len;
> }
>
> @@ -150,21 +150,12 @@ void
> filelayout_free_layout(void *layout)
> {
>                  struct nfsd4_pnfs_filelayout *flp;
> -                struct nfsd4_pnfs_layoutlist *item;
> -                int i;
>
>                  flp = (struct nfsd4_pnfs_filelayout *)layout;
>
>                  if (!flp || !flp->lg_llist)
>                                  return;
> -                item = flp->lg_llist;
> -                for (i=0; i < flp->lg_llistlen; i++) {
> -#if 0 /* the fh is part of nfsd4_pnfs_layoutget struct */
> -                                if (item->fhp)
> -                                                kfree(item->fhp);
> -#endif
> -                                item++;
> -                }
> +
>                  kfree(flp->lg_llist);
> }
> EXPORT_SYMBOL(filelayout_free_layout);
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index ee4125b..c354a58 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4224,6 +4224,7 @@ int nfs4_pnfs_get_layout(struct super_bl
>                  }
>
>                  BUG_ON(!sb->s_export_op->layout_get);
> +                lgp->lg_fh = &current_fh->fh_handle;
>                  status =
> sb->s_export_op->layout_get(current_fh->fh_dentry->d_inode,
>                                                                  (void
> *)lgp);
>
> diff --git a/include/linux/nfsd/nfs4layoutxdr.h
> b/include/linux/nfsd/nfs4layoutxdr.h
> index 64f8216..9f69431 100644
> --- a/include/linux/nfsd/nfs4layoutxdr.h
> +++ b/include/linux/nfsd/nfs4layoutxdr.h
> @@ -67,7 +67,7 @@ struct nfsd4_pnfs_layoutlist {
>                  u32                             dev_layout_type;
>                  u32  dev_id;
>                  u32                             dev_index;
> -                struct knfsd_fh                 *fhp;
> +                struct knfsd_fh                 dev_fh;
> };
>
> struct nfsd4_pnfs_filelayout {
> diff --git a/include/linux/nfsd/nfsd4_pnfs.h
> b/include/linux/nfsd/nfsd4_pnfs.h
> index e133c9c..fe2f375 100644
> --- a/include/linux/nfsd/nfsd4_pnfs.h
> +++ b/include/linux/nfsd/nfsd4_pnfs.h
> @@ -85,6 +85,7 @@ struct nfsd4_pnfs_layoutget {
>                  u32  lg_mxcnt;          /* request */
>                  struct export_operations                *lg_ops;
>
> +                struct knfsd_fh                 *lg_fh;
>                  u32  lg_return_on_close; /* response */
>                  void  *lg_layout;     /* response callback encoded */
> };
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20070604/74c8edcc/attachment.htm 


More information about the pNFS mailing list