From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 2/8] exofs: file and file_inode operations Date: Tue, 31 Mar 2009 01:04:17 -0700 Message-ID: <20090331010417.43deb1e7.akpm@linux-foundation.org> References: <49C1331D.1080805@panasas.com> <1237399127-29206-1-git-send-email-bharrosh@panasas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Avishay Traeger , Jeff Garzik , Evgeniy Polyakov , linux-fsdevel , open-osd , linux-kernel , James Bottomley , FUJITA Tomonori To: Boaz Harrosh Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:56921 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756578AbZCaILt (ORCPT ); Tue, 31 Mar 2009 04:11:49 -0400 In-Reply-To: <1237399127-29206-1-git-send-email-bharrosh@panasas.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 18 Mar 2009 19:58:47 +0200 Boaz Harrosh wrote: > implementation of the file_operations and inode_operations for > regular data files. > > Most file_operations are generic vfs implementations except: > - exofs_truncate will truncate the OSD object as well > - Generic file_fsync is not good for none_bd devices so open code it > - The default for .flush in Linux is todo nothing so call exofs_fsync > on the file. > > > ... > > +static int exofs_file_fsync(struct file *filp, struct dentry *dentry, > + int datasync) > +{ > + int ret1, ret2; > + struct address_space *mapping = filp->f_mapping; > + > + ret1 = filemap_write_and_wait(mapping); > + ret2 = file_fsync(filp, dentry, datasync); > + > + return ret1 ? ret1 : ret2; > +} It might be better to abort if filemap_write_and_wait() failed. if the hardware is bad, these things can take a looooong time retrying and timing out. There's no point in doubling the delay. > > ... >