diff options
author | 2025-04-16 10:06:13 -0600 | |
---|---|---|
committer | 2025-05-11 17:54:08 -0700 | |
commit | 8d1d4b538bb12a858fa95a073c4aff31e79088ee (patch) | |
tree | e599ca3287de4121ad8d88e28d911c7f114bdc19 /lib | |
parent | ocfs2: simplify return statement in ocfs2_filecheck_attr_store() (diff) | |
download | linux-rng-8d1d4b538bb12a858fa95a073c4aff31e79088ee.tar.xz linux-rng-8d1d4b538bb12a858fa95a073c4aff31e79088ee.zip |
scatterlist: inline sg_next()
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.
Link: https://lkml.kernel.org/r/20250416160615.3571958-1-csander@purestorage.com
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/scatterlist.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index b58d5ef1a34b..7582dfab7fe3 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -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 * |