Re: [PATCH 1/1] afs: afs_alloc_inode: use kmem_cache_zalloc
From: Joe Perches
Date: Thu Feb 20 2014 - 16:30:39 EST
On Thu, 2014-02-20 at 21:16 +0800, Fabian Frederick wrote:
> afs_vnode is currently cleared with 2 memsets after allocation and
> 1 in constructor (afs_i_init_once).
Trivial comments:
> -This patch calls zalloc for explicit zero fill.
OK, but see below.
> -Fix some typos.
Well...
> diff --git a/fs/afs/super.c b/fs/afs/super.c
[]
> @@ -76,7 +76,7 @@ static const match_table_t afs_options_list = {
[]
> - * initialise the filesystem
> + * Initialize the filesystem
> @@ -448,19 +448,19 @@ error:
[]
> - * initialise an inode cache slab element prior to any use
> + * Initialize an inode cache slab element prior to any use
English spellings don't need to be changed to American.
> @@ -481,15 +481,12 @@ static struct inode *afs_alloc_inode(struct super_block *sb)
[]
> - vnode = kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL);
> + vnode = kmem_cache_zalloc(afs_inode_cachep, GFP_KERNEL);
[]
> - memset(&vnode->fid, 0, sizeof(vnode->fid));
> - memset(&vnode->status, 0, sizeof(vnode->status));
> -
> vnode->volume = NULL;
> vnode->update_cnt = 0;
These could be removed too.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/