Re: gadget file storage with variable maxpacket

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, 19 Nov 2007, ilya wrote:

> > We can fix the problem easily enough.  Just take out the code in
> > do_read() and do_write() that handles partial pages, and let the VFS or
> > block layer worry about reorganizing the data.
> 
> works like a charm; interesting enough, i've tried this before
> but ended up crashing my system so i figured that code
> was necessary. so why do you do all this page/block alignment
> in the first place if VFS can take care of it?

Well, in the first place it isn't really page/block alignment.  (That
is, it doesn't involve moving data so that the start address lies on a
page boundary.)  It's just reducing the size of a usb_request so that
any additional data will automatically be aligned with no special
effort.

So this was nothing more than a slight optimization.  It may not be
worthwhile in the end -- if VFS is going to copy the data into
block-cache pages anyway then the initial alignment won't matter.  In
fact, I don't know whether this partial-page stuff actually helps at
all.  So I don't mind getting rid of it.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.