提交 669d5f1f 编写于 作者: A Artem Bityutskiy 提交者: Al Viro

AFFS: clean up dirty flag usage

In 'affs_write_super()': remove ancient and wrong commented code,
remove unneeded 'clean' variable, so the function becomes a bit
cleaner and simpler.

In 'affs_remount(): remove unnecessary SB dirty flag changes.
Tested-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 1b947463
...@@ -61,20 +61,13 @@ affs_put_super(struct super_block *sb) ...@@ -61,20 +61,13 @@ affs_put_super(struct super_block *sb)
static void static void
affs_write_super(struct super_block *sb) affs_write_super(struct super_block *sb)
{ {
int clean = 2;
lock_super(sb); lock_super(sb);
if (!(sb->s_flags & MS_RDONLY)) { if (!(sb->s_flags & MS_RDONLY))
// if (sbi->s_bitmap[i].bm_bh) { affs_commit_super(sb, 2);
// if (buffer_dirty(sbi->s_bitmap[i].bm_bh)) { sb->s_dirt = 0;
// clean = 0;
affs_commit_super(sb, clean);
sb->s_dirt = !clean; /* redo until bitmap synced */
} else
sb->s_dirt = 0;
unlock_super(sb); unlock_super(sb);
pr_debug("AFFS: write_super() at %lu, clean=%d\n", get_seconds(), clean); pr_debug("AFFS: write_super() at %lu, clean=2\n", get_seconds());
} }
static int static int
...@@ -553,9 +546,7 @@ affs_remount(struct super_block *sb, int *flags, char *data) ...@@ -553,9 +546,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
if (*flags & MS_RDONLY) { if (*flags & MS_RDONLY) {
sb->s_dirt = 1; affs_write_super(sb);
while (sb->s_dirt)
affs_write_super(sb);
affs_free_bitmap(sb); affs_free_bitmap(sb);
} else } else
res = affs_init_bitmap(sb, flags); res = affs_init_bitmap(sb, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册