提交 ed0e5dca 编写于 作者: M Miaohe Lin 提交者: akpm

mm/z3fold: minor clean up for z3fold_free

Use put_z3fold_header() to pair with get_z3fold_header.  Also fix the
wrong comments.  Minor readability improvement.

Link: https://lkml.kernel.org/r/20220308134311.59086-4-linmiaohe@huawei.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: NVitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 78da57d4
...@@ -1187,9 +1187,9 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp, ...@@ -1187,9 +1187,9 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp,
* @handle: handle associated with the allocation returned by z3fold_alloc() * @handle: handle associated with the allocation returned by z3fold_alloc()
* *
* In the case that the z3fold page in which the allocation resides is under * In the case that the z3fold page in which the allocation resides is under
* reclaim, as indicated by the PG_reclaim flag being set, this function * reclaim, as indicated by the PAGE_CLAIMED flag being set, this function
* only sets the first|last_chunks to 0. The page is actually freed * only sets the first|middle|last_chunks to 0. The page is actually freed
* once both buddies are evicted (see z3fold_reclaim_page() below). * once all buddies are evicted (see z3fold_reclaim_page() below).
*/ */
static void z3fold_free(struct z3fold_pool *pool, unsigned long handle) static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)
{ {
...@@ -1247,7 +1247,7 @@ static void z3fold_free(struct z3fold_pool *pool, unsigned long handle) ...@@ -1247,7 +1247,7 @@ static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)
} }
if (page_claimed) { if (page_claimed) {
/* the page has not been claimed by us */ /* the page has not been claimed by us */
z3fold_page_unlock(zhdr); put_z3fold_header(zhdr);
return; return;
} }
if (test_and_set_bit(NEEDS_COMPACTING, &page->private)) { if (test_and_set_bit(NEEDS_COMPACTING, &page->private)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册