Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756350Ab0GNNzw (ORCPT ); Wed, 14 Jul 2010 09:55:52 -0400 Received: from smtp.nokia.com ([192.100.105.134]:56298 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394Ab0GNNzv (ORCPT ); Wed, 14 Jul 2010 09:55:51 -0400 Message-ID: <4C3DC1D5.4060406@nokia.com> Date: Wed, 14 Jul 2010 16:55:33 +0300 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: ext Andy Shevchenko CC: =?UTF-8?B?TWljaGHFgiBOYXphcmV3aWN6?= , "linux-kernel@vger.kernel.org" , "Shevchenko Andriy (EXT-Teleca/Helsinki)" , "Karpov Denis.2 (EXT-Teleca/Helsinki)" , "Hunter Adrian (Nokia-MS/Helsinki)" , Alan Stern , David Brownell , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" Subject: Re: [PATCHv2] usb: gadget: storage: optional SCSI WRITE FUA bit References: <1279098331-7872-1-git-send-email-ext-andriy.shevchenko@nokia.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 14 Jul 2010 13:55:07.0522 (UTC) FILETIME=[2AFA9620:01CB235C] X-Nokia-AV: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2114 Lines: 47 On 07/14/2010 04:44 PM, ext Andy Shevchenko wrote: > 2010/7/14 MichaƂ Nazarewicz: >> On Wed, 14 Jul 2010 11:05:31 +0200, Andy Shevchenko >> wrote: >>> >>> MS Windows mounts removable storage in "Removal optimized mode" by >>> default. All the writes to the media are synchronous which is achieved >>> by setting FUA (Force Unit Access) bit in SCSI WRITE(10,12) commands. >>> This prevents I/O requests aggregation in block layer dramatically >>> decreasing performance. >> >>> diff --git a/drivers/usb/gadget/file_storage.c >>> b/drivers/usb/gadget/file_storage.c >>> index b49d86e..45f58d9 100644 >>> --- a/drivers/usb/gadget/file_storage.c >>> +++ b/drivers/usb/gadget/file_storage.c >>> @@ -93,6 +93,8 @@ >>> * removable Default false, boolean for removable media >>> * luns=N Default N = number of filenames, number of >>> * LUNs to support >>> + * fua=b[,b...] Default false, booleans for ignore FUA >>> flag >>> + * in SCSI WRITE(6,10,12) commands >> >> I wonder if it makes sense to make it per-LUN. I would imagine that it's >> great >> to ignore FUA if the device has its own power supply in which case after >> disconnect >> the data won't be lost. This is a per-device property not really per-LUN. >> As such >> I'd make this option global for the gadget. > Make sense only for removable media with one partition. > Otherwise. why we have sync option per partition f.e., not per device? > by partition do you mean medium? They are different terms. A storage medium may have 1 or more logical partitions. It is left upto the Host/user to decide how he wants to partition the medium. file_storage driver does not deal with partitions. only mediums. regards, -roger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/