summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/debug.c
diff options
context:
space:
mode:
authorShenghui Wang <shhuiw@foxmail.com>2018-12-13 17:53:46 +0300
committerJens Axboe <axboe@kernel.dk>2018-12-13 18:15:54 +0300
commitd2f96f487f471b4c718324ecd1540c89d2be52ac (patch)
treee4614454eb5e8836a43553696c1cacae83ad24a2 /drivers/md/bcache/debug.c
parent0273ac349f08f4ff9ef88aaaf9c9f2aa6e87d2be (diff)
downloadlinux-d2f96f487f471b4c718324ecd1540c89d2be52ac.tar.xz
bcache: add comment for cache_set->fill_iter
We have the following define for btree iterator: struct btree_iter { size_t size, used; #ifdef CONFIG_BCACHE_DEBUG struct btree_keys *b; #endif struct btree_iter_set { struct bkey *k, *end; } data[MAX_BSETS]; }; We can see that the length of data[] field is static MAX_BSETS, which is defined as 4 currently. But a btree node on disk could have too many bsets for an iterator to fit on the stack - maybe far more that MAX_BSETS. Have to dynamically allocate space to host more btree_iter_sets. bch_cache_set_alloc() will make sure the pool cache_set->fill_iter can allocate an iterator equipped with enough room that can host (sb.bucket_size / sb.block_size) btree_iter_sets, which is more than static MAX_BSETS. bch_btree_node_read_done() will use that pool to allocate one iterator, to host many bsets in one btree node. Add more comment around cache_set->fill_iter to make code less confusing. Signed-off-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/debug.c')
0 files changed, 0 insertions, 0 deletions