From: Benny Halevy Subject: Re: [PATCH 04/10] pnfs-submit: add backpointer to pnfs_layout_type Date: Tue, 15 Jun 2010 13:00:21 -0400 Message-ID: <4C17B1A5.8070006@panasas.com> References: <1276566375-24566-1-git-send-email-iisaman@netapp.com> <1276566375-24566-2-git-send-email-iisaman@netapp.com> <1276566375-24566-3-git-send-email-iisaman@netapp.com> <1276566375-24566-4-git-send-email-iisaman@netapp.com> <1276566375-24566-5-git-send-email-iisaman@netapp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Fred Isaman , linux-nfs@vger.kernel.org To: Andy Adamson Return-path: Received: from mail-vw0-f46.google.com ([209.85.212.46]:43122 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754172Ab0FORAV (ORCPT ); Tue, 15 Jun 2010 13:00:21 -0400 Received: by vws13 with SMTP id 13so1482792vws.19 for ; Tue, 15 Jun 2010 10:00:20 -0700 (PDT) In-Reply-To: <1276566375-24566-5-git-send-email-iisaman@netapp.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Jun. 14, 2010, 21:46 -0400, Fred Isaman wrote: > From: Andy Adamson > > Note: This should be avoided by passing struct inode instead of struct > pnfs_layout_type in all layoutdriver_io_operaitons.(which i suggest we do) > > In preparation to changing the nfs_inode->layout to be a pointer to > struct pnfs_layout_type and allocate it in the alloc_layout layoutdriver io > operation. > We've already been there and decided to embed the layout in the struct nfs_inode What has changed? > -->Andy Adamson Should that be Andy's sign-off? :-) Benny > > Signed-off-by: Fred Isaman > --- > fs/nfs/inode.c | 1 + > include/linux/nfs4_pnfs.h | 4 ++-- > include/linux/nfs_fs.h | 1 + > 3 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c > index cdec539..be25ffc 100644 > --- a/fs/nfs/inode.c > +++ b/fs/nfs/inode.c > @@ -1423,6 +1423,7 @@ static void pnfs_init_once(struct nfs_inode *nfsi) > INIT_LIST_HEAD(&nfsi->layout.segs); > nfsi->layout.refcount = 0; > nfsi->layout.ld_data = NULL; > + nfsi->layout.lo_inode = &nfsi->vfs_inode; > #endif /* CONFIG_NFS_V4_1 */ > } > > diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h > index a88cd69..9dac941 100644 > --- a/include/linux/nfs4_pnfs.h > +++ b/include/linux/nfs4_pnfs.h > @@ -35,13 +35,13 @@ struct pnfs_layoutdriver_type { > static inline struct nfs_inode * > PNFS_NFS_INODE(struct pnfs_layout_type *lo) > { > - return container_of(lo, struct nfs_inode, layout); > + return NFS_I(lo->lo_inode); > } > > static inline struct inode * > PNFS_INODE(struct pnfs_layout_type *lo) > { > - return &PNFS_NFS_INODE(lo)->vfs_inode; > + return lo->lo_inode; > } > > static inline struct nfs_server * > diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h > index 41026cb..95d8d53 100644 > --- a/include/linux/nfs_fs.h > +++ b/include/linux/nfs_fs.h > @@ -116,6 +116,7 @@ struct pnfs_layout_type { > */ > loff_t pnfs_write_begin_pos; > loff_t pnfs_write_end_pos; > + struct inode *lo_inode; > }; > > /*