Skip to content

Commit 6d2790d

Browse files
ZhangPengakpm00
authored andcommitted
mm/page_io: introduce bio_first_folio_all()
Introduce bio_first_folio_all() to return a folio, which makes it easier to use. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: ZhangPeng <[email protected]> Suggested-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: Nanyong Sun <[email protected]> Cc: Sidhartha Kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 9962ed6 commit 6d2790d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Documentation/block/biovecs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Usage of helpers:
134134
bio_for_each_bvec_all()
135135
bio_first_bvec_all()
136136
bio_first_page_all()
137+
bio_first_folio_all()
137138
bio_last_bvec_all()
138139

139140
* The following helpers iterate over single-page segment. The passed 'struct

include/linux/bio.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ static inline struct page *bio_first_page_all(struct bio *bio)
253253
return bio_first_bvec_all(bio)->bv_page;
254254
}
255255

256+
static inline struct folio *bio_first_folio_all(struct bio *bio)
257+
{
258+
return page_folio(bio_first_page_all(bio));
259+
}
260+
256261
static inline struct bio_vec *bio_last_bvec_all(struct bio *bio)
257262
{
258263
WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));

0 commit comments

Comments
 (0)