Skip to contentSkip to conversation

scatterlist-inline-sg_next.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message May 12, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: scatterlist: inline sg_next()
has been removed from the -mm tree. Its filename was
scatterlist-inline-sg_next.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Caleb Sander Mateos <[email protected]>
Subject: scatterlist: inline sg_next()
Date: Wed, 16 Apr 2025 10:06:13 -0600

sg_next() is a short function called frequently in I/O paths. Define it in the header file so it can be inlined into its callers.

---

 include/linux/scatterlist.h |   23 ++++++++++++++++++++++-
 lib/scatterlist.c           |   23 -----------------------
 2 files changed, 22 insertions(+), 24 deletions(-)
include/linux/scatterlist.h renamed from include/linux/scatterlist.h~scatterlist-inline-sg_next +22 -1
@@ -95,6 +95,28 @@ static inline bool sg_is_last(struct sca
 }
 
 /**
+ * sg_next - return the next scatterlist entry in a list
+ * @sg:		The current sg entry
+ *
+ * Description:
+ *   Usually the next entry will be @sg@ + 1, but if this sg element is part
+ *   of a chained scatterlist, it could jump to the start of a new
+ *   scatterlist array.
+ *
+ **/
+static inline struct scatterlist *sg_next(struct scatterlist *sg)
+{
+	if (sg_is_last(sg))
+		return NULL;
+
+	sg++;
+	if (unlikely(sg_is_chain(sg)))
+		sg = sg_chain_ptr(sg);
+
+	return sg;
+}
+
+/**
  * sg_assign_page - Assign a given page to an SG entry
  * @sg:		    SG entry
  * @page:	    The page
@@ -418,7 +440,6 @@ static inline void sg_init_marker(struct
 
 int sg_nents(struct scatterlist *sg);
 int sg_nents_for_len(struct scatterlist *sg, u64 len);
-struct scatterlist *sg_next(struct scatterlist *);
 struct scatterlist *sg_last(struct scatterlist *s, unsigned int);
 void sg_init_table(struct scatterlist *, unsigned int);
 void sg_init_one(struct scatterlist *, const void *, unsigned int);
lib/scatterlist.c renamed from lib/scatterlist.c~scatterlist-inline-sg_next +0 -23
@@ -14,29 +14,6 @@
 #include <linux/folio_queue.h>
 
 /**
- * sg_next - return the next scatterlist entry in a list
- * @sg:		The current sg entry
- *
- * Description:
- *   Usually the next entry will be @sg@ + 1, but if this sg element is part
- *   of a chained scatterlist, it could jump to the start of a new
- *   scatterlist array.
- *
- **/
-struct scatterlist *sg_next(struct scatterlist *sg)
-{
-	if (sg_is_last(sg))
-		return NULL;
-
-	sg++;
-	if (unlikely(sg_is_chain(sg)))
-		sg = sg_chain_ptr(sg);
-
-	return sg;
-}
-EXPORT_SYMBOL(sg_next);
-
-/**
  * sg_nents - return total count of entries in scatterlist
  * @sg:		The scatterlist
  *

_

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