Skip to content

Commit e0471c8

Browse files
dedekindAl Viro
authored andcommitted
affs: re-structure superblock locking a bit
AFFS wants to serialize the superblock (the root block in AFFS terms) updates and uses 'lock_super()/unlock_super()' for these purposes. This patch pushes the locking down to the 'affs_commit_super()' from the callers. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 0164b1a commit e0471c8

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎fs/affs/super.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ affs_commit_super(struct super_block *sb, int wait)
3131
struct buffer_head *bh = sbi->s_root_bh;
3232
struct affs_root_tail *tail = AFFS_ROOT_TAIL(sb, bh);
3333

34+
lock_super(sb);
3435
secs_to_datestamp(get_seconds(), &tail->disk_change);
3536
affs_fix_checksum(sb, bh);
3637
mark_buffer_dirty(bh);
3738
if (wait)
3839
sync_dirty_buffer(bh);
40+
unlock_super(sb);
3941
}
4042

4143
static void
@@ -54,22 +56,17 @@ affs_put_super(struct super_block *sb)
5456
static void
5557
affs_write_super(struct super_block *sb)
5658
{
57-
lock_super(sb);
5859
if (!(sb->s_flags & MS_RDONLY))
5960
affs_commit_super(sb, 1);
6061
sb->s_dirt = 0;
61-
unlock_super(sb);
62-
6362
pr_debug("AFFS: write_super() at %lu, clean=2\n", get_seconds());
6463
}
6564

6665
static int
6766
affs_sync_fs(struct super_block *sb, int wait)
6867
{
69-
lock_super(sb);
7068
affs_commit_super(sb, wait);
7169
sb->s_dirt = 0;
72-
unlock_super(sb);
7370
return 0;
7471
}
7572

0 commit comments

Comments
 (0)