diff options
author | Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> | 2011-05-08 14:42:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-09 12:04:23 -0400 |
commit | 7dd29d8d865efdb00c0542a5d2c87af8c52ea6c7 (patch) | |
tree | 71f404ed317e2d1b689af088ece1c32c3b1535c8 /fs/hpfs/buffer.c | |
parent | 637b424bf8747e50bab6648ab919632d6efd6c28 (diff) |
HPFS: Introduce a global mutex and lock it on every callback from VFS.
Introduce a global mutex and lock it on every callback from VFS.
Performance doesn't matter, reviewing the whole code for locking correctness
would be too complicated, so simply lock it all.
Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hpfs/buffer.c')
-rw-r--r-- | fs/hpfs/buffer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c index 793cb9d943d2..7cef5d5c3608 100644 --- a/fs/hpfs/buffer.c +++ b/fs/hpfs/buffer.c | |||
@@ -32,6 +32,8 @@ void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head | |||
32 | { | 32 | { |
33 | struct buffer_head *bh; | 33 | struct buffer_head *bh; |
34 | 34 | ||
35 | hpfs_lock_assert(s); | ||
36 | |||
35 | cond_resched(); | 37 | cond_resched(); |
36 | 38 | ||
37 | *bhp = bh = sb_bread(s, secno); | 39 | *bhp = bh = sb_bread(s, secno); |
@@ -50,6 +52,8 @@ void *hpfs_get_sector(struct super_block *s, unsigned secno, struct buffer_head | |||
50 | struct buffer_head *bh; | 52 | struct buffer_head *bh; |
51 | /*return hpfs_map_sector(s, secno, bhp, 0);*/ | 53 | /*return hpfs_map_sector(s, secno, bhp, 0);*/ |
52 | 54 | ||
55 | hpfs_lock_assert(s); | ||
56 | |||
53 | cond_resched(); | 57 | cond_resched(); |
54 | 58 | ||
55 | if ((*bhp = bh = sb_getblk(s, secno)) != NULL) { | 59 | if ((*bhp = bh = sb_getblk(s, secno)) != NULL) { |
@@ -70,6 +74,8 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe | |||
70 | struct buffer_head *bh; | 74 | struct buffer_head *bh; |
71 | char *data; | 75 | char *data; |
72 | 76 | ||
77 | hpfs_lock_assert(s); | ||
78 | |||
73 | cond_resched(); | 79 | cond_resched(); |
74 | 80 | ||
75 | if (secno & 3) { | 81 | if (secno & 3) { |
@@ -125,6 +131,8 @@ void *hpfs_get_4sectors(struct super_block *s, unsigned secno, | |||
125 | { | 131 | { |
126 | cond_resched(); | 132 | cond_resched(); |
127 | 133 | ||
134 | hpfs_lock_assert(s); | ||
135 | |||
128 | if (secno & 3) { | 136 | if (secno & 3) { |
129 | printk("HPFS: hpfs_get_4sectors: unaligned read\n"); | 137 | printk("HPFS: hpfs_get_4sectors: unaligned read\n"); |
130 | return NULL; | 138 | return NULL; |