Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbWCBRBm (ORCPT ); Thu, 2 Mar 2006 12:01:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752011AbWCBRBm (ORCPT ); Thu, 2 Mar 2006 12:01:42 -0500 Received: from mail.suse.de ([195.135.220.2]:1171 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1751605AbWCBRBl (ORCPT ); Thu, 2 Mar 2006 12:01:41 -0500 From: Chris Mason To: OGAWA Hirofumi Subject: Re: o_sync in vfat driver Date: Thu, 2 Mar 2006 12:01:31 -0500 User-Agent: KMail/1.9.1 Cc: Andrew Morton , col-pepper@piments.com, linux-kernel@vger.kernel.org References: <200603020845.10083.mason@suse.com> <87u0ahszxa.fsf@duaron.myhome.or.jp> In-Reply-To: <87u0ahszxa.fsf@duaron.myhome.or.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603021201.32653.mason@suse.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1244 Lines: 35 On Thursday 02 March 2006 09:07, OGAWA Hirofumi wrote: > Chris Mason writes: > > filemap_fdatawrite() won't redirty the page. It will wait on the pending > > writeback. > > Umm... I'm looking the following code. > > +void > +writeback_bdev(struct super_block *sb) > +{ > + struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; > + filemap_flush(mapping); > + blk_run_address_space(mapping); > +} > +EXPORT_SYMBOL_GPL(writeback_bdev); > > filemap_flush() is using WB_SYNC_NONE. > Ok, I thought you were asking about the code that called filemap_fdatawrite, which does wait. filemap_flush is used on the underlying block device. In the case of a page that is already under IO, the io is not cancelled but allowed to continue. This is the desired result. When you're doing a number of operations in sequence, each operation will start io on the block device. If they used filemap_fdatawrite instead of filemap_flush, they would end up being synchronous. -chris - 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/