From: Chris Mason Subject: Re: [PATCH] add -o flush for fat Date: Tue, 8 Aug 2006 04:05:14 -0400 Message-ID: <20060808080514.GH26133@watt.suse.com> References: <20060804192721.GF1048@watt.suse.com> <20060804183149.954b0e59.akpm@osdl.org> <20060805122629.GG1048@watt.suse.com> <20060805121243.1e976639.akpm@osdl.org> <20060807202355.GF26133@watt.suse.com> <20060807165820.67e3417d.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, OGAWA Hirofumi Return-path: Received: from mx2.suse.de ([195.135.220.15]:55962 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S932527AbWHHIFh (ORCPT ); Tue, 8 Aug 2006 04:05:37 -0400 To: Andrew Morton Content-Disposition: inline In-Reply-To: <20060807165820.67e3417d.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Aug 07, 2006 at 04:58:20PM -0700, Andrew Morton wrote: > On Mon, 7 Aug 2006 16:23:55 -0400 > Chris Mason wrote: > > > Fat is commonly used on removable media. Mounting with -o flush tells the > > FS to write things to disk as quickly as possible. It is like -o sync, but > > much faster (and not as safe). > > > > OK, so it's now fat-specific. That makes it easier, and still useful. > > > @@ -112,6 +113,16 @@ int fat_generic_ioctl(struct inode *inod > > } > > } > > > > +static int fat_file_release(struct inode *inode, struct file *filp) > > +{ > > + if ((filp->f_mode & FMODE_WRITE) && > > + MSDOS_SB(inode->i_sb)->options.flush) { > > + fat_flush_inodes(inode->i_sb, inode, NULL); > > + blk_congestion_wait(WRITE, HZ/10); > > + } > > + return 0; > > +} > > What's the blk_congestion_wait() for? It's just some black magic to throttle. For sufficiently large files we really want to throttle during the write, but for most average cases it helps the stick keep up. You still need to watch the blinking lights either way. -chris