]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: remove unncessary code in bch_btree_keys_init()
authorColy Li <colyli@suse.de>
Fri, 28 Jun 2019 11:59:34 +0000 (19:59 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jun 2019 13:39:15 +0000 (07:39 -0600)
commit1038a5d18df036fad69e7a3a0d55783133dda68d
tree23c4eaad851f7d8cce2ef36b79248abff98bac9d
parent3c37f0625cfe928081c17f69cae1895b4065d467
bcache: remove unncessary code in bch_btree_keys_init()

Function bch_btree_keys_init() initializes b->set[].size and
b->set[].data to zero. As the code comments indicates, these code indeed
is unncessary, because both struct btree_keys and struct bset_tree are
nested embedded into struct btree, when struct btree is filled with 0
bits by kzalloc() in mca_bucket_alloc(), b->set[].size and
b->set[].data are initialized to 0 (a.k.a NULL) already.

This patch removes the redundant code, and add comments in
bch_btree_keys_init() and mca_bucket_alloc() to explain why it's safe.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/bset.c
drivers/md/bcache/btree.c