Commit 7a0bc2a8 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

bcache: add code comments for state->pool in __btree_sort()

To explain the pages allocated from mempool state->pool can be
swapped in __btree_sort(), because state->pool is a page pool,
which allocates pages by alloc_pages() indeed.
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0e0c1231
...@@ -1257,6 +1257,11 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter, ...@@ -1257,6 +1257,11 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
* Our temporary buffer is the same size as the btree node's * Our temporary buffer is the same size as the btree node's
* buffer, we can just swap buffers instead of doing a big * buffer, we can just swap buffers instead of doing a big
* memcpy() * memcpy()
*
* Don't worry event 'out' is allocated from mempool, it can
* still be swapped here. Because state->pool is a page mempool
* creaated by by mempool_init_page_pool(), which allocates
* pages by alloc_pages() indeed.
*/ */
out->magic = b->set->data->magic; out->magic = b->set->data->magic;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment