diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-06-06 11:56:54 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:32:43 -0400 |
commit | e0471c8d8abbc2b07fc82f7b02896d1637909319 (patch) | |
tree | 66af7fa7aca968deb48379697c0cd1dabd053dbb /fs/affs | |
parent | 0164b1a32e6849121ea73ef3124a2994951a4713 (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.c | 7 |
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 | ||
41 | static void | 43 | static void |
@@ -54,22 +56,17 @@ affs_put_super(struct super_block *sb) | |||
54 | static void | 56 | static void |
55 | affs_write_super(struct super_block *sb) | 57 | affs_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 | ||
66 | static int | 65 | static int |
67 | affs_sync_fs(struct super_block *sb, int wait) | 66 | affs_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 | ||