• Coly Li's avatar
    bcache: remove unncessary code in bch_btree_keys_init() · bd9026c8
    Coly Li authored
    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: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    bd9026c8
bset.c 33.1 KB