mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
lib/scatterlist: use page iterator in the mapping iterator
For better code reuse use the newly added page iterator to iterate through the pages. The offset, length within the page is still calculated by the mapping iterator as well as the actual mapping. Idea from Tejun Heo. Signed-off-by: Imre Deak <imre.deak@intel.com> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Tejun Heo <tj@kernel.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: James Hogan <james.hogan@imgtec.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a321e91b6d
commit
4225fc8555
3 changed files with 28 additions and 30 deletions
|
|
@ -293,11 +293,11 @@ struct sg_mapping_iter {
|
|||
void *addr; /* pointer to the mapped area */
|
||||
size_t length; /* length of the mapped area */
|
||||
size_t consumed; /* number of consumed bytes */
|
||||
struct sg_page_iter piter; /* page iterator */
|
||||
|
||||
/* these are internal states, keep away */
|
||||
struct scatterlist *__sg; /* current entry */
|
||||
unsigned int __nents; /* nr of remaining entries */
|
||||
unsigned int __offset; /* offset within sg */
|
||||
unsigned int __offset; /* offset within page */
|
||||
unsigned int __remaining; /* remaining bytes on page */
|
||||
unsigned int __flags;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue