diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2008-07-25 04:46:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:33 -0400 |
commit | 39f8d472f280dee6503a364d1d911b9e20ce3ec9 (patch) | |
tree | 43c05018acca3e30234b914e4bf80439915a2807 /fs/hfs/extent.c | |
parent | 3084b72de73a6f8af0f16989ffb348068bd066d4 (diff) |
hfs: convert extents_lock in a mutex
Apple Macintosh file system: The semaphore extens_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/extent.c')
-rw-r--r-- | fs/hfs/extent.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index c176f67ba0a5..2c16316d2917 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c | |||
@@ -343,16 +343,16 @@ int hfs_get_block(struct inode *inode, sector_t block, | |||
343 | goto done; | 343 | goto done; |
344 | } | 344 | } |
345 | 345 | ||
346 | down(&HFS_I(inode)->extents_lock); | 346 | mutex_lock(&HFS_I(inode)->extents_lock); |
347 | res = hfs_ext_read_extent(inode, ablock); | 347 | res = hfs_ext_read_extent(inode, ablock); |
348 | if (!res) | 348 | if (!res) |
349 | dblock = hfs_ext_find_block(HFS_I(inode)->cached_extents, | 349 | dblock = hfs_ext_find_block(HFS_I(inode)->cached_extents, |
350 | ablock - HFS_I(inode)->cached_start); | 350 | ablock - HFS_I(inode)->cached_start); |
351 | else { | 351 | else { |
352 | up(&HFS_I(inode)->extents_lock); | 352 | mutex_unlock(&HFS_I(inode)->extents_lock); |
353 | return -EIO; | 353 | return -EIO; |
354 | } | 354 | } |
355 | up(&HFS_I(inode)->extents_lock); | 355 | mutex_unlock(&HFS_I(inode)->extents_lock); |
356 | 356 | ||
357 | done: | 357 | done: |
358 | map_bh(bh_result, sb, HFS_SB(sb)->fs_start + | 358 | map_bh(bh_result, sb, HFS_SB(sb)->fs_start + |
@@ -375,7 +375,7 @@ int hfs_extend_file(struct inode *inode) | |||
375 | u32 start, len, goal; | 375 | u32 start, len, goal; |
376 | int res; | 376 | int res; |
377 | 377 | ||
378 | down(&HFS_I(inode)->extents_lock); | 378 | mutex_lock(&HFS_I(inode)->extents_lock); |
379 | if (HFS_I(inode)->alloc_blocks == HFS_I(inode)->first_blocks) | 379 | if (HFS_I(inode)->alloc_blocks == HFS_I(inode)->first_blocks) |
380 | goal = hfs_ext_lastblock(HFS_I(inode)->first_extents); | 380 | goal = hfs_ext_lastblock(HFS_I(inode)->first_extents); |
381 | else { | 381 | else { |
@@ -425,7 +425,7 @@ int hfs_extend_file(struct inode *inode) | |||
425 | goto insert_extent; | 425 | goto insert_extent; |
426 | } | 426 | } |
427 | out: | 427 | out: |
428 | up(&HFS_I(inode)->extents_lock); | 428 | mutex_unlock(&HFS_I(inode)->extents_lock); |
429 | if (!res) { | 429 | if (!res) { |
430 | HFS_I(inode)->alloc_blocks += len; | 430 | HFS_I(inode)->alloc_blocks += len; |
431 | mark_inode_dirty(inode); | 431 | mark_inode_dirty(inode); |
@@ -487,7 +487,7 @@ void hfs_file_truncate(struct inode *inode) | |||
487 | if (blk_cnt == alloc_cnt) | 487 | if (blk_cnt == alloc_cnt) |
488 | goto out; | 488 | goto out; |
489 | 489 | ||
490 | down(&HFS_I(inode)->extents_lock); | 490 | mutex_lock(&HFS_I(inode)->extents_lock); |
491 | hfs_find_init(HFS_SB(sb)->ext_tree, &fd); | 491 | hfs_find_init(HFS_SB(sb)->ext_tree, &fd); |
492 | while (1) { | 492 | while (1) { |
493 | if (alloc_cnt == HFS_I(inode)->first_blocks) { | 493 | if (alloc_cnt == HFS_I(inode)->first_blocks) { |
@@ -514,7 +514,7 @@ void hfs_file_truncate(struct inode *inode) | |||
514 | hfs_brec_remove(&fd); | 514 | hfs_brec_remove(&fd); |
515 | } | 515 | } |
516 | hfs_find_exit(&fd); | 516 | hfs_find_exit(&fd); |
517 | up(&HFS_I(inode)->extents_lock); | 517 | mutex_unlock(&HFS_I(inode)->extents_lock); |
518 | 518 | ||
519 | HFS_I(inode)->alloc_blocks = blk_cnt; | 519 | HFS_I(inode)->alloc_blocks = blk_cnt; |
520 | out: | 520 | out: |