From: Artem Bityutskiy <dedekind1@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org,
Adrian Hunter <adrian.hunter@nokia.com>,
Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Subject: Re: [PATCH] UBIFS: kill BKL
Date: Mon, 20 Jul 2009 16:22:24 +0300 [thread overview]
Message-ID: <1248096144.17749.1.camel@localhost> (raw)
In-Reply-To: <20090720125125.GA1714@infradead.org>
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.
>
> 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
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
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 <hch@infradead.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
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, int wait)
{
int i, err;
struct ubifs_info *c = sb->s_fs_info;
- struct writeback_control wbc = {
- .sync_mode = WB_SYNC_ALL,
- .range_start = 0,
- .range_end = LLONG_MAX,
- .nr_to_write = LONG_MAX,
- };
/*
* 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, int wait)
return 0;
/*
- * VFS calls '->sync_fs()' before synchronizing all dirty inodes and
- * pages, so synchronize them first, then commit the journal. 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.
- */
- 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, int wait)
return err;
}
+ /*
+ * 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 = ubifs_run_commit(c);
if (err)
return err;
--
1.6.0.6
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
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
prev parent reply other threads:[~2009-07-20 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-19 10:55 [PATCH] UBIFS: kill BKL Artem Bityutskiy
2009-07-20 6:16 ` Adrian Hunter
2009-07-20 6:27 ` Artem Bityutskiy
2009-07-20 6:29 ` Artem Bityutskiy
2009-07-20 6:35 ` Adrian Hunter
2009-07-20 10:26 ` Artem Bityutskiy
2009-07-20 12:51 ` Christoph Hellwig
2009-07-20 13:22 ` Artem Bityutskiy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1248096144.17749.1.camel@localhost \
--to=dedekind1@gmail.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=adrian.hunter@nokia.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).