]> git.hungrycats.org Git - linux/commit
[PATCH] USB Storage: Remove non s-g pathway from subdriver READ/WRITE
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 16 Jan 2004 09:11:16 +0000 (01:11 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 16 Jan 2004 09:11:16 +0000 (01:11 -0800)
commit760c3b3a1774be4899d1e315f68e3ce93c31dceb
tree79da089e8ad0b538a068ce82fe6d78bef2d04a10
parenta9b6e3571522c961e094e85b1dc568d09de712e8
[PATCH] USB Storage: Remove non s-g pathway from subdriver READ/WRITE

This patch does what you suggested.  The read/write routines from the
updated subdrivers are changed so they don't bother to differentiate
between transfers that do or do not use scatter-gather.  The low-level
usb_stor_access_xfer_buf routine will Do The Right Thing regardless, and
there probably won't ever be more than a few non s-g calls.  (What about
filesystem I/O requests to access metadata?)

It turns out that in addition to removing some comments and a few tests,
this change allowed me to remove the buffer and use_sg arguments passed to
the read/write routines as well.  So the simplification ended up being a
bit bigger than I expected.

While writing this patch, I noticed spots in several drivers that still
need to be changed -- they slipped past me before.  These drivers handle
things like READ-CAPACITY or REQUEST-SENSE by copying the data directly to
srb->request_buffer, which is obviously wrong if s-g is being used.  I'll
send in changes next week that convert them to use the
usb_stor_set_xfer_buf function.  Like you said, it's going to be handy in
more places than originally intended!
drivers/usb/storage/datafab.c
drivers/usb/storage/jumpshot.c
drivers/usb/storage/sddr09.c
drivers/usb/storage/sddr55.c
drivers/usb/storage/shuttle_usbat.c