Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: zero out delayed node upon allocation

It's slightly cleaner to zero-out the delayed node upon allocation
than to do it by hand in btrfs_init_delayed_node() for a few members

Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Alexandru Moise and committed by
David Sterba
352dd9c8 575a75d6

+1 -6
+1 -6
fs/btrfs/delayed-inode.c
··· 54 54 delayed_node->root = root; 55 55 delayed_node->inode_id = inode_id; 56 56 atomic_set(&delayed_node->refs, 0); 57 - delayed_node->count = 0; 58 - delayed_node->flags = 0; 59 57 delayed_node->ins_root = RB_ROOT; 60 58 delayed_node->del_root = RB_ROOT; 61 59 mutex_init(&delayed_node->mutex); 62 - delayed_node->index_cnt = 0; 63 60 INIT_LIST_HEAD(&delayed_node->n_list); 64 61 INIT_LIST_HEAD(&delayed_node->p_list); 65 - delayed_node->bytes_reserved = 0; 66 - memset(&delayed_node->inode_item, 0, sizeof(delayed_node->inode_item)); 67 62 } 68 63 69 64 static inline int btrfs_is_continuous_delayed_item( ··· 127 132 if (node) 128 133 return node; 129 134 130 - node = kmem_cache_alloc(delayed_node_cache, GFP_NOFS); 135 + node = kmem_cache_zalloc(delayed_node_cache, GFP_NOFS); 131 136 if (!node) 132 137 return ERR_PTR(-ENOMEM); 133 138 btrfs_init_delayed_node(node, root, ino);