Commit 0d6077f8b48ed2dce8f2466a76c0d574a3b4dbe9
Committed by
Greg Kroah-Hartman
1 parent
e05a1fd946
Exists in
master
and in
16 other branches
lib/scatterlist: export sg_miter_skip()
sg_copy_buffer() can't meet demand for some drrivers(such usb mass storage), so we have to use the sg_miter_* APIs to access sg buffer, then need export sg_miter_skip() for these drivers. The API is needed for converting to sg_miter_* APIs in USB storage driver for accessing sg buffer. Acked-by: Andrew Morton <akpm@linux-foundation.org> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <ming.lei@canonical.com> Reviewed-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 2 changed files with 3 additions and 1 deletions Side-by-side Diff
include/linux/scatterlist.h
... | ... | @@ -345,6 +345,7 @@ |
345 | 345 | |
346 | 346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, |
347 | 347 | unsigned int nents, unsigned int flags); |
348 | +bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset); | |
348 | 349 | bool sg_miter_next(struct sg_mapping_iter *miter); |
349 | 350 | void sg_miter_stop(struct sg_mapping_iter *miter); |
350 | 351 |
lib/scatterlist.c
... | ... | @@ -495,7 +495,7 @@ |
495 | 495 | * true if @miter contains the valid mapping. false if end of sg |
496 | 496 | * list is reached. |
497 | 497 | */ |
498 | -static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset) | |
498 | +bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset) | |
499 | 499 | { |
500 | 500 | sg_miter_stop(miter); |
501 | 501 | |
... | ... | @@ -513,6 +513,7 @@ |
513 | 513 | |
514 | 514 | return true; |
515 | 515 | } |
516 | +EXPORT_SYMBOL(sg_miter_skip); | |
516 | 517 | |
517 | 518 | /** |
518 | 519 | * sg_miter_next - proceed mapping iterator to the next mapping |