On Tue, 27 Jul 2004, Todd Fischer wrote:

> Hi,
> 
> We ran into a few problems trying to use file backed storage on 2.6.

What were your problems?

> Attached is the patch file to the 1.9 version of the Linux 2.6
> file_storage.c file, which makes the following changes:
> 
> - Fix the registration logic that was crashing the kernel.

What was wrong with the registration logic and how did it crash your 
kernel?  In your patch I see two changes:

        You moved the code that registers the LUN devices into
        fsg_bind().  This change looks correct; although there is
        a comment stating that the gadget doesn't get registered
        until after fsg_bind() returns, that comment is wrong.

        You added this line:
                gadget->dev.driver = &fsg_driver.driver;
        That is both wrong and unnecessary; it's the controller
        driver's responsibility to change gadget->dev, not the
        gadget driver's responsibility.  The gadget driver is not
        supposed to touch anything inside the struct usb_gadget.

In both cases, leaving the code the way it was shouldn't result in any 
problems.

> - Move the removable parameter to be used on non test version.
> - Remove the macro NORMALLY_INIT. This symbol is used to remove some
> functions in the no test version of the driver, but these functions are
> required for support removable luns (store_file, store_ro and
> open_backing_file).
> - The macro backing_file_is_open should be always defined to useful code
> (even in non test version) for support removable luns.
> 
> I am not sure what criteria is used to determine if a feature should only be
> enabled only when test is selected.  We have found that the removable LUNs
> logic works great.

I'm pleased that it works well.  Is there some reason you added these 
changes instead of using the test version?

The criterion was this: A feature is in the non-test version if I thought
it would be used often in memory-constrained systems, like handheld
computers.  I expected that g_file_storage might be used in such systems
to imitate portable USB storage devices, and hence it would only need to
support the features those devices have.  Most of them don't have
removable media (card readers being the major exception).

For systems that aren't constrained by memory, people can simply use the
test version of the driver.  If there are users who would like to have
both the removable-media feature and the small memory footprint, I will
go ahead and add the changes you've suggested.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to