From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: viro@ZenIV.linux.org.uk, Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 1/3] vfs: redesign sb state flags
Date: Sat, 27 Feb 2010 03:25:47 +0300 [thread overview]
Message-ID: <1267230349-8192-1-git-send-email-dmonakhov@openvz.org> (raw)
Super block has special variable for fssync tracking. This is not
optimal. Let's rename it to general s_state variable.
Other bits will be used in later patches.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/sync.c | 6 +++---
include/linux/fs.h | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/sync.c b/fs/sync.c
index 418727a..6e540fc 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -97,13 +97,13 @@ static void sync_filesystems(int wait)
mutex_lock(&mutex); /* Could be down_interruptible */
spin_lock(&sb_lock);
list_for_each_entry(sb, &super_blocks, s_list)
- sb->s_need_sync = 1;
+ set_bit(ST_FS_SYNC, &sb->s_state);
restart:
list_for_each_entry(sb, &super_blocks, s_list) {
- if (!sb->s_need_sync)
+ if (!test_bit(ST_FS_SYNC, &sb->s_state))
continue;
- sb->s_need_sync = 0;
+ clear_bit(ST_FS_SYNC, &sb->s_state);
sb->s_count++;
spin_unlock(&sb_lock);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index cd32f1b..66369f6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1306,6 +1306,9 @@ extern int send_sigurg(struct fown_struct *fown);
#define MNT_DETACH 0x00000002 /* Just detach from the tree */
#define MNT_EXPIRE 0x00000004 /* Mark for expiry */
+enum {
+ ST_FS_SYNC, /* fssync is about to happen */
+};
extern struct list_head super_blocks;
extern spinlock_t sb_lock;
@@ -1325,11 +1328,11 @@ struct super_block {
const struct export_operations *s_export_op;
unsigned long s_flags;
unsigned long s_magic;
+ unsigned long s_state;
struct dentry *s_root;
struct rw_semaphore s_umount;
struct mutex s_lock;
int s_count;
- int s_need_sync;
atomic_t s_active;
#ifdef CONFIG_SECURITY
void *s_security;
--
1.6.6
next reply other threads:[~2010-02-27 0:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-27 0:25 Dmitry Monakhov [this message]
2010-02-27 0:25 ` [PATCH 2/3] vfs: per-sb write count preparation stage Dmitry Monakhov
2010-02-27 0:25 ` [PATCH 3/3] vfs: fix filesystem_sync vs write race on rw=>ro remount v2 Dmitry Monakhov
2010-03-02 13:29 ` Jan Kara
2010-03-02 14:04 ` Dmitry Monakhov
2010-03-02 14:06 ` Jan Kara
2010-03-02 14:24 ` Dmitry Monakhov
2010-03-02 14:35 ` Jan Kara
2010-03-02 15:38 ` Dmitry Monakhov
2010-03-02 15:21 ` Nick Piggin
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=1267230349-8192-1-git-send-email-dmonakhov@openvz.org \
--to=dmonakhov@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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).