From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH 3/12] exofs: add ->sync_fs Date: Tue, 09 Jun 2009 16:03:13 +0300 Message-ID: <4A2E5D91.8040107@panasas.com> References: <20090608080252.GA20735@lst.de> <20090608080358.GD20735@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from ip67-152-220-66.z220-152-67.customer.algx.net ([67.152.220.66]:6018 "EHLO daytona.int.panasas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754561AbZFINDM (ORCPT ); Tue, 9 Jun 2009 09:03:12 -0400 In-Reply-To: <20090608080358.GD20735@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 06/08/2009 11:03 AM, Christoph Hellwig wrote: > Add a ->sync_fs method for data integrity syncs, and reimplement > ->write_super ontop of it. > > > Signed-off-by: Christoph Hellwig Thanks > > Index: vfs-2.6/fs/exofs/super.c > =================================================================== > --- vfs-2.6.orig/fs/exofs/super.c 2009-06-05 15:59:08.521843147 +0200 > +++ vfs-2.6/fs/exofs/super.c 2009-06-05 16:02:20.687950326 +0200 > @@ -200,18 +200,18 @@ static const struct export_operations ex > /* > * Write the superblock to the OSD > */ > -static void exofs_write_super(struct super_block *sb) > +static int exofs_sync_fs(struct super_block *sb, int wait) > { > struct exofs_sb_info *sbi; > struct exofs_fscb *fscb; > struct osd_request *or; > struct osd_obj_id obj; > - int ret; > + int ret = -ENOMEM; > > fscb = kzalloc(sizeof(struct exofs_fscb), GFP_KERNEL); > if (!fscb) { > EXOFS_ERR("exofs_write_super: memory allocation failed.\n"); > - return; > + return -ENOMEM; > } > > lock_super(sb); > @@ -249,6 +249,15 @@ out: > unlock_kernel(); > unlock_super(sb); > kfree(fscb); > + return ret; > +} > + > +static void exofs_write_super(struct super_block *sb) > +{ > + if (!(sb->s_flags & MS_RDONLY)) > + exofs_sync_fs(sb, 1); > + else > + sb->s_dirt = 0; I never tested read-only mounts. Unlike ext3 (Journals) Read-only mount should also work with: BUG_ON(sb->s_dirt) As the actual journal is on the OSD targets, and is abstracted away form the file system. > } > > /* > @@ -493,6 +502,7 @@ static const struct super_operations exo > .delete_inode = exofs_delete_inode, > .put_super = exofs_put_super, > .write_super = exofs_write_super, > + .sync_fs = exofs_sync_fs, > .statfs = exofs_statfs, > }; > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html