From: Coly Li Date: Thu, 23 Jan 2020 17:01:36 +0000 (+0800) Subject: bcache: add code comments for state->pool in __btree_sort() X-Git-Tag: v5.15~4673^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a0bc2a8966040d54289b64842d55e2cf4343ad9;p=platform%2Fkernel%2Flinux-starfive.git 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: Coly Li Signed-off-by: Jens Axboe --- diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c index cffcdc9..4385303 100644 --- a/drivers/md/bcache/bset.c +++ b/drivers/md/bcache/bset.c @@ -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 * buffer, we can just swap buffers instead of doing a big * 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;