linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] vfs: redesign sb state flags
@ 2010-02-27  0:25 Dmitry Monakhov
  2010-02-27  0:25 ` [PATCH 2/3] vfs: per-sb write count preparation stage Dmitry Monakhov
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Monakhov @ 2010-02-27  0:25 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: viro, Dmitry Monakhov

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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-03-02 15:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-27  0:25 [PATCH 1/3] vfs: redesign sb state flags Dmitry Monakhov
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

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).