summaryrefslogtreecommitdiffstats
path: root/mm/zswap.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2024-01-29 20:36:38 -0500
committerAndrew Morton <akpm@linux-foundation.org>2024-02-22 10:24:42 -0800
commit5b297f70bb26b9041d5badd0d51d9227e25fc1eb (patch)
tree4ea0d366f8fb9aa31d42708a30afd71705c34072 /mm/zswap.c
parent42398be2adb12096500e61f9585f05d0a479bf57 (diff)
downloadlinux-5b297f70bb26b9041d5badd0d51d9227e25fc1eb.tar.gz
linux-5b297f70bb26b9041d5badd0d51d9227e25fc1eb.tar.bz2
linux-5b297f70bb26b9041d5badd0d51d9227e25fc1eb.zip
mm: zswap: inline and remove zswap_entry_find_get()
There is only one caller and the function is trivial. Inline it. Link: https://lkml.kernel.org/r/20240130014208.565554-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Nhat Pham <nphamcs@gmail.com> Acked-by: Yosry Ahmed <yosryahmed@google.com> Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/zswap.c')
-rw-r--r--mm/zswap.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/mm/zswap.c b/mm/zswap.c
index 5cb79cb497c0..3df8b6329cf5 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -558,19 +558,6 @@ static void zswap_entry_put(struct zswap_entry *entry)
}
}
-/* caller must hold the tree lock */
-static struct zswap_entry *zswap_entry_find_get(struct rb_root *root,
- pgoff_t offset)
-{
- struct zswap_entry *entry;
-
- entry = zswap_rb_search(root, offset);
- if (entry)
- zswap_entry_get(entry);
-
- return entry;
-}
-
/*********************************
* shrinker functions
**********************************/
@@ -1708,13 +1695,13 @@ bool zswap_load(struct folio *folio)
VM_WARN_ON_ONCE(!folio_test_locked(folio));
- /* find */
spin_lock(&tree->lock);
- entry = zswap_entry_find_get(&tree->rbroot, offset);
+ entry = zswap_rb_search(&tree->rbroot, offset);
if (!entry) {
spin_unlock(&tree->lock);
return false;
}
+ zswap_entry_get(entry);
spin_unlock(&tree->lock);
if (entry->length)