Skip to content

Commit ac4fa1d

Browse files
Ming Leiaxboe
authored andcommitted
block: document usage of bio iterator helpers
Now multi-page bvec is supported, some helpers may return page by page, meantime some may return segment by segment, this patch documents the usage. Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Omar Sandoval <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 6861428 commit ac4fa1d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Documentation/block/biovecs.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,28 @@ Other implications:
117117
size limitations and the limitations of the underlying devices. Thus
118118
there's no need to define ->merge_bvec_fn() callbacks for individual block
119119
drivers.
120+
121+
Usage of helpers:
122+
=================
123+
124+
* The following helpers whose names have the suffix of "_all" can only be used
125+
on non-BIO_CLONED bio. They are usually used by filesystem code. Drivers
126+
shouldn't use them because the bio may have been split before it reached the
127+
driver.
128+
129+
bio_for_each_segment_all()
130+
bio_first_bvec_all()
131+
bio_first_page_all()
132+
bio_last_bvec_all()
133+
134+
* The following helpers iterate over single-page segment. The passed 'struct
135+
bio_vec' will contain a single-page IO vector during the iteration
136+
137+
bio_for_each_segment()
138+
bio_for_each_segment_all()
139+
140+
* The following helpers iterate over multi-page bvec. The passed 'struct
141+
bio_vec' will contain a multi-page IO vector during the iteration
142+
143+
bio_for_each_bvec()
144+
rq_for_each_bvec()

0 commit comments

Comments
 (0)