Skip to content

Commit 669d5f1

Browse files
Artem BityutskiyAl Viro
authored andcommitted
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>
1 parent 1b94746 commit 669d5f1

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

‎fs/affs/super.c‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,13 @@ affs_put_super(struct super_block *sb)
6161
static void
6262
affs_write_super(struct super_block *sb)
6363
{
64-
int clean = 2;
65-
6664
lock_super(sb);
67-
if (!(sb->s_flags & MS_RDONLY)) {
68-
// if (sbi->s_bitmap[i].bm_bh) {
69-
// if (buffer_dirty(sbi->s_bitmap[i].bm_bh)) {
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;
65+
if (!(sb->s_flags & MS_RDONLY))
66+
affs_commit_super(sb, 2);
67+
sb->s_dirt = 0;
7568
unlock_super(sb);
7669

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());
7871
}
7972

8073
static int
@@ -553,9 +546,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
553546
return 0;
554547
}
555548
if (*flags & MS_RDONLY) {
556-
sb->s_dirt = 1;
557-
while (sb->s_dirt)
558-
affs_write_super(sb);
549+
affs_write_super(sb);
559550
affs_free_bitmap(sb);
560551
} else
561552
res = affs_init_bitmap(sb, flags);

0 commit comments

Comments
 (0)