summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-09-07 14:27:19 +0100
committerMark Brown <broonie@kernel.org>2026-09-07 14:27:21 +0100
commit2d7b4b35e4fc3b1a6b9293f2af83554d5b085655 (patch)
treecb8888160705c866aeae3e206e730c6b24dfd34c
parentf501c2892dee1da8ff99daac55b37292a51e7364 (diff)
parentba285edf3fd1a27f8ec739b5b396d45c98eabee0 (diff)
downloadlinux-next-2d7b4b35e4fc3b1a6b9293f2af83554d5b085655.tar.gz
linux-next-2d7b4b35e4fc3b1a6b9293f2af83554d5b085655.zip
Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git
-rw-r--r--Documentation/block/biovecs.rst1
-rw-r--r--include/linux/bio.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/block/biovecs.rst b/Documentation/block/biovecs.rst
index 49da2147b7d8..6717bfacd138 100644
--- a/Documentation/block/biovecs.rst
+++ b/Documentation/block/biovecs.rst
@@ -135,6 +135,7 @@ Usage of helpers:
bio_first_bvec_all()
bio_first_page_all()
bio_first_folio_all()
+ bio_last_bvec_all()
* The following helpers iterate over single-page segment. The passed 'struct
bio_vec' will contain a single-page IO vector during the iteration::
diff --git a/include/linux/bio.h b/include/linux/bio.h
index bb3235497e67..908555716896 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -256,6 +256,12 @@ static inline struct folio *bio_first_folio_all(struct bio *bio)
return page_folio(bio_first_page_all(bio));
}
+static inline struct bio_vec *bio_last_bvec_all(struct bio *bio)
+{
+ WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
+ return &bio->bi_io_vec[bio->bi_vcnt - 1];
+}
+
/**
* struct folio_iter - State for iterating all folios in a bio.
* @folio: The current folio we're iterating. NULL after the last folio.