Re: [PATCH 00/10] sg buffer copy helper functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 11 Mar 2008, FUJITA Tomonori wrote:

> On Mon, 10 Mar 2008 16:10:36 +0200
> Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote:

> > Have you had a look at drivers/usb/storage/protocol.c usb_stor_access_xfer_buf() ?
> > It looks like it could also use these, but there they have a twist where they want
> > to do it in parts. Do you think that the code there could also use the helpers 
> > presented here somehow? (I know that one of the USB guys was asking about it)
> 
> I've not. If the USB people are eager to use the new APIs, I'll try
> though I prefer to keep them simple.

It would be great if the code could be removed from usb-storage and put
in a central library.  The problem is, as Boaz mentioned, that some of
the subdrivers need to transfer their data in pieces.

It may be that the device is able to send or receive only a few blocks 
at a time, or it may be that the blocks aren't stored in continguous 
locations on the device.  Either way, the drivers need to do multiple 
transfers, each starting from where the previous one left off.

It shouldn't be too hard to adjust your code to make this work.  
Instead of passing sgl and nents directly to sg_copy_buffer(), pass a
pointer to a structure containing fields for sgl, nents, n, sg_off, and
sg_copy.  Then the caller could retain the ending values for use in a
later call.

Does this sound reasonable?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux