lkml.org 
[lkml]   [2014]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] afs: afs_alloc_inode: use kmem_cache_zalloc
From
Date
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.




\
 
 \ /
  Last update: 2014-02-20 23:01    [W:0.319 / U:2.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site