aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-07-05 08:14:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:48:50 -0400
commit669d5f1f608f7de29bb467bb239517a414e43777 (patch)
tree41b723d28606fc02b436265eadadfc4cba8252df
parent1b9474635e21eef0f3e69fd1c7b1b9598ffdddd3 (diff)
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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/affs/super.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 2c804a87c142..fde3b9ae700f 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -61,20 +61,13 @@ affs_put_super(struct super_block *sb)
61static void 61static void
62affs_write_super(struct super_block *sb) 62affs_write_super(struct super_block *sb)
63{ 63{
64 int clean = 2;
65
66 lock_super(sb); 64 lock_super(sb);
67 if (!(sb->s_flags & MS_RDONLY)) { 65 if (!(sb->s_flags & MS_RDONLY))
68 // if (sbi->s_bitmap[i].bm_bh) { 66 affs_commit_super(sb, 2);
69 // if (buffer_dirty(sbi->s_bitmap[i].bm_bh)) { 67 sb->s_dirt = 0;
70 // clean = 0;
71 affs_commit_super(sb, clean);
72 sb->s_dirt = !clean; /* redo until bitmap synced */
73 } else
74 sb->s_dirt = 0;
75 unlock_super(sb); 68 unlock_super(sb);
76 69
77 pr_debug("AFFS: write_super() at %lu, clean=%d\n", get_seconds(), clean); 70 pr_debug("AFFS: write_super() at %lu, clean=2\n", get_seconds());
78} 71}
79 72
80static int 73static int
@@ -553,9 +546,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
553 return 0; 546 return 0;
554 } 547 }
555 if (*flags & MS_RDONLY) { 548 if (*flags & MS_RDONLY) {
556 sb->s_dirt = 1; 549 affs_write_super(sb);
557 while (sb->s_dirt)
558 affs_write_super(sb);
559 affs_free_bitmap(sb); 550 affs_free_bitmap(sb);
560 } else 551 } else
561 res = affs_init_bitmap(sb, flags); 552 res = affs_init_bitmap(sb, flags);