From: Boaz Harrosh <bharrosh@panasas.com>
To: andros@netapp.com
Cc: bhalevy@panasas.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/5] SQUASHME pnfs-submit remove pnfs_alloc_init_inode
Date: Wed, 07 Jul 2010 12:27:02 +0300 [thread overview]
Message-ID: <4C344866.1070600@panasas.com> (raw)
In-Reply-To: <1278451022-2889-3-git-send-email-andros@netapp.com>
On 07/07/2010 12:16 AM, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
>
> Place all layout initialization in nfs4_init_once
>
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
> fs/nfs/inode.c | 19 ++++++-------------
> 1 files changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index 231cfa3..fa310b1 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -1361,18 +1361,6 @@ void nfs4_clear_inode(struct inode *inode)
> }
> #endif
>
> -static void pnfs_alloc_init_inode(struct nfs_inode *nfsi)
> -{
> -#ifdef CONFIG_NFS_V4_1
> - nfsi->layout.pnfs_layout_state = 0;
> - memset(&nfsi->layout.stateid, 0, NFS4_STATEID_SIZE);
> - nfsi->layout.roc_iomode = 0;
> - nfsi->layout.lo_cred = NULL;
> - nfsi->layout.pnfs_write_begin_pos = 0;
> - nfsi->layout.pnfs_write_end_pos = 0;
> -#endif /* CONFIG_NFS_V4_1 */
> -}
> -
> struct inode *nfs_alloc_inode(struct super_block *sb)
> {
> struct nfs_inode *nfsi;
> @@ -1388,7 +1376,6 @@ struct inode *nfs_alloc_inode(struct super_block *sb)
> #ifdef CONFIG_NFS_V4
> nfsi->nfs4_acl = NULL;
> #endif /* CONFIG_NFS_V4 */
> - pnfs_alloc_init_inode(nfsi);
> return &nfsi->vfs_inode;
> }
>
> @@ -1430,6 +1417,12 @@ static inline void nfs4_init_once(struct nfs_inode *nfsi)
> INIT_LIST_HEAD(&nfsi->layout.segs);
> nfsi->layout.refcount = 0;
> nfsi->layout.ld_data = NULL;
> + nfsi->layout.pnfs_layout_state = 0;
> + memset(&nfsi->layout.stateid, 0, NFS4_STATEID_SIZE);
> + nfsi->layout.roc_iomode = 0;
> + nfsi->layout.lo_cred = NULL;
> + nfsi->layout.pnfs_write_begin_pos = 0;
> + nfsi->layout.pnfs_write_end_pos = 0;
If we are already here. What are the rules with zeros? It is costume elsewhere in
Kernel that at construction points all zeros are just not done, if a kzalloc or memset
is guaranteed. Isn't nfs_inode zero_allocated? If not it should. Adding zero initialization
to every new member, and an extra remove line to any member remove is just maintenance
nightmare.
(This patch could be much more beautiful if it was "only removed lines")
Boaz
> #endif /* CONFIG_NFS_V4_1 */
> #endif
> }
next prev parent reply other threads:[~2010-07-07 9:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-06 21:16 [PATCH 0/5] cleanup inode.c and bug fixes andros
2010-07-06 21:16 ` [PATCH 1/5] SQUASHME pnfs-submit: remove pnfs_init_once andros
2010-07-06 21:16 ` [PATCH 2/5] SQUASHME pnfs-submit remove pnfs_alloc_init_inode andros
2010-07-06 21:17 ` [PATCH 3/5] SQUASHME pnfs-submit: remove pnfs_destroy_inode andros
2010-07-06 21:17 ` [PATCH 4/5] SQUASHME pnfs-submit: set layoutcommit status after async error handler andros
2010-07-06 21:17 ` [PATCH 5/5] SQUASHME pnfs-submit: set layoutget " andros
2010-07-07 9:27 ` Boaz Harrosh [this message]
2010-07-07 17:03 ` [PATCH 2/5] SQUASHME pnfs-submit remove pnfs_alloc_init_inode William A. (Andy) Adamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C344866.1070600@panasas.com \
--to=bharrosh@panasas.com \
--cc=andros@netapp.com \
--cc=bhalevy@panasas.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox