]> 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)
commit74755ebc25d2cda7a7f4bb03446e8db4a670f878
tree23c4eaad851f7d8cce2ef36b79248abff98bac9d
parentf12f213c1b11bb0d6f888dbf5c210ffa4ec397fe
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