lkml.org 
[lkml]   [2011]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateSun, 6 Mar 2011 16:29:44 +0900
SubjectRe: [PATCH 1/4] scatterlist: new helper functions
FromFUJITA Tomonori <>
On Fri,  4 Mar 2011 06:16:50 +0200
Maxim Levitsky <maximlevitsky@gmail.com> wrote:

> While developing memstick driver for legacy memsticks
> I found the need in few helpers that I think should be
> in common scatterlist library
>
> The functions that were added:
>
> * sg_nents/sg_total_len - iterate over scatterlist to figure
> out total length of memory it covers / number of entries.

You should invent a data structure per I/O request, something like
msb_request structure. Then you can store nents and total_len in
that.

That's what block subsystems and drivers do. I took a look at your
driver but I can't see why your driver can't do the same.


\
 
 \ /
  Last update: 2011-03-06 12:13    [from the cache]
©2003-2010