mm-swap-introduce-a-helper-for-retrieving-cluster-from-offset.patch removed from -mm tree
The quilt patch titled
Subject: mm, swap: introduce a helper for retrieving cluster from offset
has been removed from the -mm tree. Its filename was
mm-swap-introduce-a-helper-for-retrieving-cluster-from-offset.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Kairui Song <[email protected]>
Subject: mm, swap: introduce a helper for retrieving cluster from offset
Date: Tue, 14 Jan 2025 01:57:30 +0800
It's a common operation to retrieve the cluster info from offset, introduce a helper for this.
Signed-off-by Kairui Song <[email protected]>
Suggested-by Chris Li <[email protected]>
Cc Baoquan He <[email protected]>
Cc Barry Song <[email protected]>
Cc "Huang, Ying" <[email protected]>
Cc Hugh Dickens <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kalesh Singh <[email protected]>
Cc Nhat Pham <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Yosry Ahmed <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/swapfile.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
mm/swapfile.c renamed from mm/swapfile.c~mm-swap-introduce-a-helper-for-retrieving-cluster-from-offset +10 -4
@@ -424,6 +424,12 @@ static inline unsigned int cluster_indexreturn ci - si->cluster_info; } +static inline struct swap_cluster_info *offset_to_cluster (struct swap_info_struct *si, +unsigned long offset) +{ +return &si->cluster_info[offset /SWAPFILE_CLUSTER ]; +} +static inline unsigned int cluster_offset (struct swap_info_struct *si,struct swap_cluster_info *ci) {
@@ -435,7 +441,7 @@ static inline struct swap_cluster_info * {struct swap_cluster_info *ci; - ci = &si->cluster_info[offset /SWAPFILE_CLUSTER ]; + ci =offset_to_cluster (si, offset);spin_lock (&ci->lock);return ci;
@@ -1480,10 +1486,10 @@ static void swap_entry_range_free(structunsigned char *map_end = map + nr_pages;struct swap_cluster_info *ci; -/* It should never free entries across different clusters */ -VM_BUG_ON ((offset /SWAPFILE_CLUSTER ) != ((offset + nr_pages -1 ) /SWAPFILE_CLUSTER )); - ci =lock_cluster (si, offset); + +/* It should never free entries across different clusters */ +VM_BUG_ON (ci !=offset_to_cluster (si, offset + nr_pages -1 ));VM_BUG_ON (cluster_is_empty (ci));VM_BUG_ON (ci->count < nr_pages);
_
Patches currently in -mm which might be from [email protected] are