Skip to contentSkip to conversation

mm-swap-rename-and-move-some-swap-cluster-definition-and-helpers.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 21, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm, swap: rename and move some swap cluster definition and helpers
has been removed from the -mm tree. Its filename was
mm-swap-rename-and-move-some-swap-cluster-definition-and-helpers.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: rename and move some swap cluster definition and helpers
Date: Wed, 17 Sep 2025 00:00:51 +0800

No feature change, move cluster related definitions and helpers to mm/swap.h, also tidy up and add a "swap_" prefix for cluster lock/unlock helpers, so they can be used outside of swap files. And while at it, add kerneldoc.

---

 include/linux/swap.h |   34 --------------
 mm/swap.h            |   70 +++++++++++++++++++++++++++++
 mm/swapfile.c        |   97 ++++++++++++-----------------------------
 3 files changed, 99 insertions(+), 102 deletions(-)
include/linux/swap.h renamed from include/linux/swap.h~mm-swap-rename-and-move-some-swap-cluster-definition-and-helpers +0 -34
@@ -236,40 +236,6 @@ enum {
 #define SWAP_CONT_MAX	0x7f	/* Max count */
 
 /*
- * We use this to track usage of a cluster. A cluster is a block of swap disk
- * space with SWAPFILE_CLUSTER pages long and naturally aligns in disk. All
- * free clusters are organized into a list. We fetch an entry from the list to
- * get a free cluster.
- *
- * The flags field determines if a cluster is free. This is
- * protected by cluster lock.
- */
-struct swap_cluster_info {
-	spinlock_t lock;	/*
-				 * Protect swap_cluster_info fields
-				 * other than list, and swap_info_struct->swap_map
-				 * elements corresponding to the swap cluster.
-				 */
-	u16 count;
-	u8 flags;
-	u8 order;
-	struct list_head list;
-};
-
-/* All on-list cluster must have a non-zero flag. */
-enum swap_cluster_flags {
-	CLUSTER_FLAG_NONE = 0, /* For temporary off-list cluster */
-	CLUSTER_FLAG_FREE,
-	CLUSTER_FLAG_NONFULL,
-	CLUSTER_FLAG_FRAG,
-	/* Clusters with flags above are allocatable */
-	CLUSTER_FLAG_USABLE = CLUSTER_FLAG_FRAG,
-	CLUSTER_FLAG_FULL,
-	CLUSTER_FLAG_DISCARD,
-	CLUSTER_FLAG_MAX,
-};
-
-/*
  * The first page in the swap file is the swap header, which is always marked
  * bad to prevent it from being allocated as an entry. This also prevents the
  * cluster to which it belongs being marked free. Therefore 0 is safe to use as
mm/swapfile.c renamed from mm/swapfile.c~mm-swap-rename-and-move-some-swap-cluster-definition-and-helpers +29 -68

264 lines not on this page · raw message

mm/swap.h renamed from mm/swap.h~mm-swap-rename-and-move-some-swap-cluster-definition-and-helpers +70 -0

80 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are