This patch calls zalloc for explicit zero fill and removes all memset 0.

Signed-off-by: Fabian Frederick <[email protected]>
---
 fs/afs/super.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/fs/afs/super.c b/fs/afs/super.c
index c486155..aff91ee 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -460,7 +460,6 @@ static void afs_i_init_once(void *_vnode)
 {
        struct afs_vnode *vnode = _vnode;
 
-       memset(vnode, 0, sizeof(*vnode));
        inode_init_once(&vnode->vfs_inode);
        init_waitqueue_head(&vnode->update_waitq);
        mutex_init(&vnode->permits_lock);
@@ -481,17 +480,12 @@ static struct inode *afs_alloc_inode(struct super_block 
*sb)
 {
        struct afs_vnode *vnode;
 
-       vnode = kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL);
+       vnode = kmem_cache_zalloc(afs_inode_cachep, GFP_KERNEL);
        if (!vnode)
                return NULL;
 
        atomic_inc(&afs_count_active_inodes);
 
-       memset(&vnode->fid, 0, sizeof(vnode->fid));
-       memset(&vnode->status, 0, sizeof(vnode->status));
-
-       vnode->volume           = NULL;
-       vnode->update_cnt       = 0;
        vnode->flags            = 1 << AFS_VNODE_UNSET;
        vnode->cb_promised      = false;
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to