diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2008-07-25 04:46:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:33 -0400 |
commit | 3084b72de73a6f8af0f16989ffb348068bd066d4 (patch) | |
tree | ef0993d1c2d8e14237cda0277eb68e4fb3653523 /fs/hfs/bitmap.c | |
parent | de0ca06a99c33df8333955642843331ab6b6e7ff (diff) |
hfs: convert bitmap_lock in a mutex
Apple Macintosh file system: The semaphore bitmap_lock is used as a mutex.
Convert it to the mutex API
Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfs/bitmap.c')
-rw-r--r-- | fs/hfs/bitmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/hfs/bitmap.c b/fs/hfs/bitmap.c index 24e75798ddf0..c6e97366e8ac 100644 --- a/fs/hfs/bitmap.c +++ b/fs/hfs/bitmap.c | |||
@@ -145,7 +145,7 @@ u32 hfs_vbm_search_free(struct super_block *sb, u32 goal, u32 *num_bits) | |||
145 | if (!*num_bits) | 145 | if (!*num_bits) |
146 | return 0; | 146 | return 0; |
147 | 147 | ||
148 | down(&HFS_SB(sb)->bitmap_lock); | 148 | mutex_lock(&HFS_SB(sb)->bitmap_lock); |
149 | bitmap = HFS_SB(sb)->bitmap; | 149 | bitmap = HFS_SB(sb)->bitmap; |
150 | 150 | ||
151 | pos = hfs_find_set_zero_bits(bitmap, HFS_SB(sb)->fs_ablocks, goal, num_bits); | 151 | pos = hfs_find_set_zero_bits(bitmap, HFS_SB(sb)->fs_ablocks, goal, num_bits); |
@@ -162,7 +162,7 @@ u32 hfs_vbm_search_free(struct super_block *sb, u32 goal, u32 *num_bits) | |||
162 | HFS_SB(sb)->free_ablocks -= *num_bits; | 162 | HFS_SB(sb)->free_ablocks -= *num_bits; |
163 | hfs_bitmap_dirty(sb); | 163 | hfs_bitmap_dirty(sb); |
164 | out: | 164 | out: |
165 | up(&HFS_SB(sb)->bitmap_lock); | 165 | mutex_unlock(&HFS_SB(sb)->bitmap_lock); |
166 | return pos; | 166 | return pos; |
167 | } | 167 | } |
168 | 168 | ||
@@ -205,7 +205,7 @@ int hfs_clear_vbm_bits(struct super_block *sb, u16 start, u16 count) | |||
205 | if ((start + count) > HFS_SB(sb)->fs_ablocks) | 205 | if ((start + count) > HFS_SB(sb)->fs_ablocks) |
206 | return -2; | 206 | return -2; |
207 | 207 | ||
208 | down(&HFS_SB(sb)->bitmap_lock); | 208 | mutex_lock(&HFS_SB(sb)->bitmap_lock); |
209 | /* bitmap is always on a 32-bit boundary */ | 209 | /* bitmap is always on a 32-bit boundary */ |
210 | curr = HFS_SB(sb)->bitmap + (start / 32); | 210 | curr = HFS_SB(sb)->bitmap + (start / 32); |
211 | len = count; | 211 | len = count; |
@@ -236,7 +236,7 @@ int hfs_clear_vbm_bits(struct super_block *sb, u16 start, u16 count) | |||
236 | } | 236 | } |
237 | out: | 237 | out: |
238 | HFS_SB(sb)->free_ablocks += len; | 238 | HFS_SB(sb)->free_ablocks += len; |
239 | up(&HFS_SB(sb)->bitmap_lock); | 239 | mutex_unlock(&HFS_SB(sb)->bitmap_lock); |
240 | hfs_bitmap_dirty(sb); | 240 | hfs_bitmap_dirty(sb); |
241 | 241 | ||
242 | return 0; | 242 | return 0; |