+20
−37
Loading
The function allocates and then refills and empty sheaf. It's only called from __pcs_replace_empty_main(), which can also in some cases refill an empty sheaf. We can therefore consolidate this code. Remove alloc_full_sheaf() and refactor __pcs_replace_empty_main() so it will call alloc_empty_sheaf() when necessary, and then use the pre-existing refill_sheaf(). The result should be simpler to follow and less duplicated code. Also adjust the comment about returning sheaves to barn, the part about where the empty sheaf we'd be returning comes from is incorrect. No functional change intended. Reviewed-by:Qing Wang <wangqing7171@gmail.com> Reviewed-by:
Harry Yoo <harry.yoo@oracle.com> Reviewed-by:
Hao Li <hao.li@linux.dev> Link: https://patch.msgid.link/20260311-b4-slab-remove-alloc_full_sheaf-v1-1-c4c5bb587ae5@kernel.org Signed-off-by:
Vlastimil Babka (SUSE) <vbabka@kernel.org>