mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 01:02:08 +00:00
Xarray: distinguish large entries correctly in xas_split_alloc()
We don't support large entries which expand two more level xa_node in split. For case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order", we also need two level of xa_node to expand. Distinguish entry as large entry in case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order". As max order of folio in pagecache (MAX_PAGECACHE_ORDER) is <= (XA_CHUNK_SHIFT * 2 - 1), this change is more likely a cleanup... Link: https://lkml.kernel.org/r/20241213122523.12764-4-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e28197c065
commit
be578f8b60
@ -1027,7 +1027,7 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order,
|
||||
unsigned int mask = xas->xa_sibs;
|
||||
|
||||
/* XXX: no support for splitting really large entries yet */
|
||||
if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT < order))
|
||||
if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT <= order))
|
||||
goto nomem;
|
||||
if (xas->xa_shift + XA_CHUNK_SHIFT > order)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user