mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 17:10:13 +00:00
mm/shmem: remove unused entry_order after large swapin rework
After commit 93c0476e7057 ("mm/shmem, swap: rework swap entry and index
calculation for large swapin"), xas_get_order() will never return a
non-zero value for `entry_order` in shmem_split_large_entry(). As a
result, the local variable `entry_order` is effectively unused.
Clean up the code by removing `entry_order` and directly using
`cur_order`. This change is purely a refactor and has no functional
impact.
No functional change intended.
Link: https://lkml.kernel.org/r/20250908062614.89880-1-liu.yun@linux.dev
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
6ce3bc990c
commit
5919f12821
11
mm/shmem.c
11
mm/shmem.c
@ -2173,7 +2173,7 @@ static int shmem_split_large_entry(struct inode *inode, pgoff_t index,
|
||||
{
|
||||
struct address_space *mapping = inode->i_mapping;
|
||||
XA_STATE_ORDER(xas, &mapping->i_pages, index, 0);
|
||||
int split_order = 0, entry_order;
|
||||
int split_order = 0;
|
||||
int i;
|
||||
|
||||
/* Convert user data gfp flags to xarray node gfp flags */
|
||||
@ -2191,15 +2191,12 @@ static int shmem_split_large_entry(struct inode *inode, pgoff_t index,
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
entry_order = xas_get_order(&xas);
|
||||
|
||||
if (!entry_order)
|
||||
cur_order = xas_get_order(&xas);
|
||||
if (!cur_order)
|
||||
goto unlock;
|
||||
|
||||
/* Try to split large swap entry in pagecache */
|
||||
cur_order = entry_order;
|
||||
swap_index = round_down(index, 1 << entry_order);
|
||||
|
||||
swap_index = round_down(index, 1 << cur_order);
|
||||
split_order = xas_try_split_min_order(cur_order);
|
||||
|
||||
while (cur_order > 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user