From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCH] UBIFS: kill BKL Date: Mon, 20 Jul 2009 16:22:24 +0300 Message-ID: <1248096144.17749.1.camel@localhost> References: <1248000922-4065-1-git-send-email-dedekind1@gmail.com> <20090720125125.GA1714@infradead.org> Reply-To: dedekind1@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, Adrian Hunter , Artem Bityutskiy To: Christoph Hellwig Return-path: Received: from smtp.nokia.com ([192.100.122.233]:32996 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbZGTNXB (ORCPT ); Mon, 20 Jul 2009 09:23:01 -0400 In-Reply-To: <20090720125125.GA1714@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 2009-07-20 at 08:51 -0400, Christoph Hellwig wrote: > On something slightly related - anohter part of the super_ops > rework in 2.6.31 was that we now always push data out before calling > into ->sync_fs to synchronize the metadata. >=20 > This means the generic_sync_sb_inodes call in ubifs_sync_fs should go > away now. Yes, indeed '__sync_filesystem()' invokes 'sync_inodes_sb()' before '->sync_sb()'. Thanks for pointing this out. Below is the patch. >>From c14ed92bf8639c8533f8e923859b136d0671db1b Mon Sep 17 00:00:00 2001 =46rom: Artem Bityutskiy Date: Mon, 20 Jul 2009 17:56:19 +0300 Subject: [PATCH] UBIFS: remove unneeded call from ubifs_sync_fs Nowadays VFS always synchronizes all dirty inodes and pages before calling '->sync_fs()', so remove unneeded 'generic_sync_sb_inodes()' from 'ubifs_sync_fs()'. It used to be needed, but not any longer. Pointed-out-by: Christoph Hellwig Signed-off-by: Artem Bityutskiy --- fs/ubifs/super.c | 24 +++++++----------------- 1 files changed, 7 insertions(+), 17 deletions(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 13e7ed4..b541bd7 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -437,12 +437,6 @@ static int ubifs_sync_fs(struct super_block *sb, i= nt wait) { int i, err; struct ubifs_info *c =3D sb->s_fs_info; - struct writeback_control wbc =3D { - .sync_mode =3D WB_SYNC_ALL, - .range_start =3D 0, - .range_end =3D LLONG_MAX, - .nr_to_write =3D LONG_MAX, - }; =20 /* * Zero @wait is just an advisory thing to help the file system shove @@ -453,17 +447,6 @@ static int ubifs_sync_fs(struct super_block *sb, i= nt wait) return 0; =20 /* - * VFS calls '->sync_fs()' before synchronizing all dirty inodes and - * pages, so synchronize them first, then commit the journal. Strictl= y - * speaking, it is not necessary to commit the journal here, - * synchronizing write-buffers would be enough. But committing makes - * UBIFS free space predictions much more accurate, so we want to let - * the user be able to get more accurate results of 'statfs()' after - * they synchronize the file system. - */ - generic_sync_sb_inodes(sb, &wbc); - - /* * Synchronize write buffers, because 'ubifs_run_commit()' does not * do this if it waits for an already running commit. */ @@ -473,6 +456,13 @@ static int ubifs_sync_fs(struct super_block *sb, i= nt wait) return err; } =20 + /* + * Strictly speaking, it is not necessary to commit the journal here, + * synchronizing write-buffers would be enough. But committing makes + * UBIFS free space predictions much more accurate, so we want to let + * the user be able to get more accurate results of 'statfs()' after + * they synchronize the file system. + */ err =3D ubifs_run_commit(c); if (err) return err; --=20 1.6.0.6 --=20 Best Regards, Artem Bityutskiy (=D0=90=D1=80=D1=82=D1=91=D0=BC =D0=91=D0=B8=D1=82=D1=8E= =D1=86=D0=BA=D0=B8=D0=B9) -- 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