[pnfs] [PATCH 3/5] pnfs: remove pnfs_layout_type from free_lseg

Benny Halevy bhalevy at panasas.com
Mon Feb 4 12:49:32 EST 2008


Applied onto the pnfs branch.

Benny

On Feb. 01, 2008, 21:14 +0200, andros at umich.edu wrote:
> From: Andy Adamson <andros at umich.edu>
> 
> struct pnfs_layout_segment has a back pointer to it's pnfs_layout_type
> so remove the unnecessary parameter.
> 
> Signed-off-by: Andy Adamson<andros at umich.edu>
> ---
>  fs/nfs/nfs4filelayout.c   |    5 ++---
>  fs/nfs/pnfs.c             |    3 +--
>  include/linux/nfs4_pnfs.h |    2 +-
>  3 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
> index 54ffe3b..d2a9e0c 100644
> --- a/fs/nfs/nfs4filelayout.c
> +++ b/fs/nfs/nfs4filelayout.c
> @@ -664,10 +664,9 @@ filelayout_alloc_lseg(struct pnfs_layout_type *layoutid,
>  }
>  
>  static void
> -filelayout_free_lseg(struct pnfs_layout_type *layoutid,
> -		     struct pnfs_layout_segment *lseg)
> +filelayout_free_lseg(struct pnfs_layout_segment *lseg)
>  {
> -	struct nfs4_filelayout *flo = PNFS_LD_DATA(layoutid);
> +	struct nfs4_filelayout *flo = PNFS_LD_DATA(lseg->layout);
>  	struct nfs4_filelayout_segment *fls = LSEG_LD_DATA(&flo->pnfs_lseg);
>  
>  	memset(fls, 0, sizeof(*fls));
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index aaf850b..3f34f34 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -370,9 +370,8 @@ destroy_lseg(struct kref *kref)
>  {
>  	struct pnfs_layout_segment *lseg =
>  		container_of(kref, struct pnfs_layout_segment, kref);
> -	struct pnfs_layout_type *lo = lseg->layout;
>  
> -	PNFS_LD_IO_OPS(lo)->free_lseg(lo, lseg);
> +	PNFS_LD_IO_OPS(lseg->layout)->free_lseg(lseg);
>  }
>  
>  static inline void
> diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
> index cb348bc..8a720e5 100644
> --- a/include/linux/nfs4_pnfs.h
> +++ b/include/linux/nfs4_pnfs.h
> @@ -134,7 +134,7 @@ struct layoutdriver_io_operations {
>  	struct pnfs_layout_type * (*alloc_layout) (struct pnfs_mount_type *mountid, struct inode *inode);
>  	void (*free_layout) (struct pnfs_layout_type *layoutid);
>  	struct pnfs_layout_segment * (*alloc_lseg) (struct pnfs_layout_type *layoutid, struct nfs4_pnfs_layoutget_res *lgr);
> -	void (*free_lseg) (struct pnfs_layout_type *layoutid, struct pnfs_layout_segment *lseg);
> +	void (*free_lseg) (struct pnfs_layout_segment *lseg);
>  
>  	int (*setup_layoutcommit) (struct pnfs_layout_type *layoutid, struct pnfs_layoutcommit_arg *arg);
>  	void (*cleanup_layoutcommit) (struct pnfs_layout_type *layoutid, struct pnfs_layoutcommit_arg *arg, struct pnfs_layoutcommit_res *res);



More information about the pNFS mailing list