aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-06-06 11:56:54 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:32:43 -0400
commite0471c8d8abbc2b07fc82f7b02896d1637909319 (patch)
tree66af7fa7aca968deb48379697c0cd1dabd053dbb /fs/affs
parent0164b1a32e6849121ea73ef3124a2994951a4713 (diff)
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>
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/super.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index c837e43687a6..4ceec5636434 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -31,11 +31,13 @@ affs_commit_super(struct super_block *sb, int wait)
31 struct buffer_head *bh = sbi->s_root_bh; 31 struct buffer_head *bh = sbi->s_root_bh;
32 struct affs_root_tail *tail = AFFS_ROOT_TAIL(sb, bh); 32 struct affs_root_tail *tail = AFFS_ROOT_TAIL(sb, bh);
33 33
34 lock_super(sb);
34 secs_to_datestamp(get_seconds(), &tail->disk_change); 35 secs_to_datestamp(get_seconds(), &tail->disk_change);
35 affs_fix_checksum(sb, bh); 36 affs_fix_checksum(sb, bh);
36 mark_buffer_dirty(bh); 37 mark_buffer_dirty(bh);
37 if (wait) 38 if (wait)
38 sync_dirty_buffer(bh); 39 sync_dirty_buffer(bh);
40 unlock_super(sb);
39} 41}
40 42
41static void 43static void
@@ -54,22 +56,17 @@ affs_put_super(struct super_block *sb)
54static void 56static void
55affs_write_super(struct super_block *sb) 57affs_write_super(struct super_block *sb)
56{ 58{
57 lock_super(sb);
58 if (!(sb->s_flags & MS_RDONLY)) 59 if (!(sb->s_flags & MS_RDONLY))
59 affs_commit_super(sb, 1); 60 affs_commit_super(sb, 1);
60 sb->s_dirt = 0; 61 sb->s_dirt = 0;
61 unlock_super(sb);
62
63 pr_debug("AFFS: write_super() at %lu, clean=2\n", get_seconds()); 62 pr_debug("AFFS: write_super() at %lu, clean=2\n", get_seconds());
64} 63}
65 64
66static int 65static int
67affs_sync_fs(struct super_block *sb, int wait) 66affs_sync_fs(struct super_block *sb, int wait)
68{ 67{
69 lock_super(sb);
70 affs_commit_super(sb, wait); 68 affs_commit_super(sb, wait);
71 sb->s_dirt = 0; 69 sb->s_dirt = 0;
72 unlock_super(sb);
73 return 0; 70 return 0;
74} 71}
75 72