Skip to contentSkip to conversation

lib/scatterlist: export sg_miter_skip()

PATCH In review Ming Lei 2 participants 3 messages Oct 29, 2013 – Nov 1, 2013 Library code

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/2 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.

Cc Andrew Morton <[email protected]>,
Cc FUJITA Tomonori <[email protected]>,
Cc Tejun Heo <[email protected]>,
Cc Jens Axboe <[email protected]>
---
 include/linux/scatterlist.h |    1 +
 lib/scatterlist.c           |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/scatterlist.h +1 -0
index adae88f..a964f72 100644
@@ -345,6 +345,7 @@ struct sg_mapping_iter {
 
 void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
 		    unsigned int nents, unsigned int flags);
+bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
lib/scatterlist.c +2 -1
index d16fa29..3a8e8e8 100644
@@ -495,7 +495,7 @@ static bool sg_miter_get_next_page(struct sg_mapping_iter *miter)
  *   true if @miter contains the valid mapping.  false if end of sg
  *   list is reached.
  */
-static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)
+bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)
 {
 	sg_miter_stop(miter);
 
@@ -513,6 +513,7 @@ static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)
 
 	return true;
 }
+EXPORT_SYMBOL(sg_miter_skip);
 
 /**
  * sg_miter_next - proceed mapping iterator to the next mapping
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 33 lines · On Wed, 30 Oct 2013 00:07:22 +0800 Ming Lei <[email protected]> wrote:

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.

...

include/linux/scatterlist.h +1 -0
@@ -345,6 +345,7 @@ struct sg_mapping_iter {
 
 void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
 		    unsigned int nents, unsigned int flags);
+bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
lib/scatterlist.c +1 -1
index d16fa29..3a8e8e8 100644
@@ -495,7 +495,7 @@ static bool sg_miter_get_next_page(struct sg_mapping_iter *miter)
  *   true if @miter contains the valid mapping.  false if end of sg
  *   list is reached.
  */
-static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)
+bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)
 {
 	sg_miter_stop(miter);
 

lib/scatterlist.c static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset) · line 519

Quoted 7 lines
lib/scatterlist.c +1 -0
@@ -513,6 +513,7 @@ static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)
 
 	return true;
 }
+EXPORT_SYMBOL(sg_miter_skip);
 
 /**
  * sg_miter_next - proceed mapping iterator to the next mapping

Looks OK to me. Please include this in whatever tree is used to merge "[PATCH 2/2] USB: storage: use sg_miter_* APIs to access scsi buffer".

author
#2 lore raw

Hi Andrew,

Thank you for the comment.

Quoted 3 lines · Andrew Morton

Looks OK to me. Please include this in whatever tree is used to merge "[PATCH 2/2] USB: storage: use sg_miter_* APIs to access scsi buffer".

Greg and Alan, would you mind reviewing & commenting on 2/2 and merge the two finally to usb-next tree if you are OK with it?

Thanks,
--
Ming Lei