Re: [PATCH v2 2/2] mm/zbud: don't export any zbud API

From: Nathan Chancellor
Date: Thu Jun 17 2021 - 20:45:12 EST


On Tue, Jun 08, 2021 at 07:45:15PM +0800, Miaohe Lin wrote:
> The zbud doesn't need to export any API and it is meant to be used via
> zpool API since the commit 12d79d64bfd3 ("mm/zpool: update zswap to use
> zpool"). So we can remove the unneeded zbud.h and move down zpool API
> to avoid any forward declaration.
>
> Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>

This patch causes several new warnings when CONFIG_ZPOOL is disabled:

mm/zbud.c:222:26: warning: unused function 'zbud_create_pool' [-Wunused-function]
mm/zbud.c:246:13: warning: unused function 'zbud_destroy_pool' [-Wunused-function]
mm/zbud.c:270:12: warning: unused function 'zbud_alloc' [-Wunused-function]
mm/zbud.c:345:13: warning: unused function 'zbud_free' [-Wunused-function]
mm/zbud.c:417:12: warning: unused function 'zbud_reclaim_page' [-Wunused-function]
mm/zbud.c:499:14: warning: unused function 'zbud_map' [-Wunused-function]
mm/zbud.c:509:13: warning: unused function 'zbud_unmap' [-Wunused-function]
mm/zbud.c:520:12: warning: unused function 'zbud_get_pool_size' [-Wunused-function]

It seems to me like all of these functions should be sunk into their
callers and eliminated entirely as part of this refactoring. I took a
whack at it but got lost with the kernel docs so someone who is familiar
with this should probably do it.

Cheers,
Nathan