diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-23 06:00:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:14 -0500 |
commit | 1e7933defd0fce79b2d8ecdbc7ca37fed0c188ed (patch) | |
tree | a5dffed9e912f80c452a809cd4405d2799e27067 /fs | |
parent | 8e3f90459b7052c31a9669417b837fb14aa6d313 (diff) |
[PATCH] sem2mutex: UDF
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/udf/balloc.c | 36 | ||||
-rw-r--r-- | fs/udf/ialloc.c | 8 | ||||
-rw-r--r-- | fs/udf/super.c | 2 |
3 files changed, 23 insertions, 23 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index 201049ac8a96..ea521f846d97 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c | |||
@@ -152,7 +152,7 @@ static void udf_bitmap_free_blocks(struct super_block * sb, | |||
152 | int bitmap_nr; | 152 | int bitmap_nr; |
153 | unsigned long overflow; | 153 | unsigned long overflow; |
154 | 154 | ||
155 | down(&sbi->s_alloc_sem); | 155 | mutex_lock(&sbi->s_alloc_mutex); |
156 | if (bloc.logicalBlockNum < 0 || | 156 | if (bloc.logicalBlockNum < 0 || |
157 | (bloc.logicalBlockNum + count) > UDF_SB_PARTLEN(sb, bloc.partitionReferenceNum)) | 157 | (bloc.logicalBlockNum + count) > UDF_SB_PARTLEN(sb, bloc.partitionReferenceNum)) |
158 | { | 158 | { |
@@ -211,7 +211,7 @@ error_return: | |||
211 | sb->s_dirt = 1; | 211 | sb->s_dirt = 1; |
212 | if (UDF_SB_LVIDBH(sb)) | 212 | if (UDF_SB_LVIDBH(sb)) |
213 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); | 213 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); |
214 | up(&sbi->s_alloc_sem); | 214 | mutex_unlock(&sbi->s_alloc_mutex); |
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | 217 | ||
@@ -226,7 +226,7 @@ static int udf_bitmap_prealloc_blocks(struct super_block * sb, | |||
226 | int nr_groups, bitmap_nr; | 226 | int nr_groups, bitmap_nr; |
227 | struct buffer_head *bh; | 227 | struct buffer_head *bh; |
228 | 228 | ||
229 | down(&sbi->s_alloc_sem); | 229 | mutex_lock(&sbi->s_alloc_mutex); |
230 | if (first_block < 0 || first_block >= UDF_SB_PARTLEN(sb, partition)) | 230 | if (first_block < 0 || first_block >= UDF_SB_PARTLEN(sb, partition)) |
231 | goto out; | 231 | goto out; |
232 | 232 | ||
@@ -275,7 +275,7 @@ out: | |||
275 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); | 275 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); |
276 | } | 276 | } |
277 | sb->s_dirt = 1; | 277 | sb->s_dirt = 1; |
278 | up(&sbi->s_alloc_sem); | 278 | mutex_unlock(&sbi->s_alloc_mutex); |
279 | return alloc_count; | 279 | return alloc_count; |
280 | } | 280 | } |
281 | 281 | ||
@@ -291,7 +291,7 @@ static int udf_bitmap_new_block(struct super_block * sb, | |||
291 | int newblock = 0; | 291 | int newblock = 0; |
292 | 292 | ||
293 | *err = -ENOSPC; | 293 | *err = -ENOSPC; |
294 | down(&sbi->s_alloc_sem); | 294 | mutex_lock(&sbi->s_alloc_mutex); |
295 | 295 | ||
296 | repeat: | 296 | repeat: |
297 | if (goal < 0 || goal >= UDF_SB_PARTLEN(sb, partition)) | 297 | if (goal < 0 || goal >= UDF_SB_PARTLEN(sb, partition)) |
@@ -364,7 +364,7 @@ repeat: | |||
364 | } | 364 | } |
365 | if (i >= (nr_groups*2)) | 365 | if (i >= (nr_groups*2)) |
366 | { | 366 | { |
367 | up(&sbi->s_alloc_sem); | 367 | mutex_unlock(&sbi->s_alloc_mutex); |
368 | return newblock; | 368 | return newblock; |
369 | } | 369 | } |
370 | if (bit < sb->s_blocksize << 3) | 370 | if (bit < sb->s_blocksize << 3) |
@@ -373,7 +373,7 @@ repeat: | |||
373 | bit = udf_find_next_one_bit(bh->b_data, sb->s_blocksize << 3, group_start << 3); | 373 | bit = udf_find_next_one_bit(bh->b_data, sb->s_blocksize << 3, group_start << 3); |
374 | if (bit >= sb->s_blocksize << 3) | 374 | if (bit >= sb->s_blocksize << 3) |
375 | { | 375 | { |
376 | up(&sbi->s_alloc_sem); | 376 | mutex_unlock(&sbi->s_alloc_mutex); |
377 | return 0; | 377 | return 0; |
378 | } | 378 | } |
379 | 379 | ||
@@ -387,7 +387,7 @@ got_block: | |||
387 | */ | 387 | */ |
388 | if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) | 388 | if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) |
389 | { | 389 | { |
390 | up(&sbi->s_alloc_sem); | 390 | mutex_unlock(&sbi->s_alloc_mutex); |
391 | *err = -EDQUOT; | 391 | *err = -EDQUOT; |
392 | return 0; | 392 | return 0; |
393 | } | 393 | } |
@@ -410,13 +410,13 @@ got_block: | |||
410 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); | 410 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); |
411 | } | 411 | } |
412 | sb->s_dirt = 1; | 412 | sb->s_dirt = 1; |
413 | up(&sbi->s_alloc_sem); | 413 | mutex_unlock(&sbi->s_alloc_mutex); |
414 | *err = 0; | 414 | *err = 0; |
415 | return newblock; | 415 | return newblock; |
416 | 416 | ||
417 | error_return: | 417 | error_return: |
418 | *err = -EIO; | 418 | *err = -EIO; |
419 | up(&sbi->s_alloc_sem); | 419 | mutex_unlock(&sbi->s_alloc_mutex); |
420 | return 0; | 420 | return 0; |
421 | } | 421 | } |
422 | 422 | ||
@@ -433,7 +433,7 @@ static void udf_table_free_blocks(struct super_block * sb, | |||
433 | int8_t etype; | 433 | int8_t etype; |
434 | int i; | 434 | int i; |
435 | 435 | ||
436 | down(&sbi->s_alloc_sem); | 436 | mutex_lock(&sbi->s_alloc_mutex); |
437 | if (bloc.logicalBlockNum < 0 || | 437 | if (bloc.logicalBlockNum < 0 || |
438 | (bloc.logicalBlockNum + count) > UDF_SB_PARTLEN(sb, bloc.partitionReferenceNum)) | 438 | (bloc.logicalBlockNum + count) > UDF_SB_PARTLEN(sb, bloc.partitionReferenceNum)) |
439 | { | 439 | { |
@@ -666,7 +666,7 @@ static void udf_table_free_blocks(struct super_block * sb, | |||
666 | 666 | ||
667 | error_return: | 667 | error_return: |
668 | sb->s_dirt = 1; | 668 | sb->s_dirt = 1; |
669 | up(&sbi->s_alloc_sem); | 669 | mutex_unlock(&sbi->s_alloc_mutex); |
670 | return; | 670 | return; |
671 | } | 671 | } |
672 | 672 | ||
@@ -692,7 +692,7 @@ static int udf_table_prealloc_blocks(struct super_block * sb, | |||
692 | else | 692 | else |
693 | return 0; | 693 | return 0; |
694 | 694 | ||
695 | down(&sbi->s_alloc_sem); | 695 | mutex_lock(&sbi->s_alloc_mutex); |
696 | extoffset = sizeof(struct unallocSpaceEntry); | 696 | extoffset = sizeof(struct unallocSpaceEntry); |
697 | bloc = UDF_I_LOCATION(table); | 697 | bloc = UDF_I_LOCATION(table); |
698 | 698 | ||
@@ -736,7 +736,7 @@ static int udf_table_prealloc_blocks(struct super_block * sb, | |||
736 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); | 736 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); |
737 | sb->s_dirt = 1; | 737 | sb->s_dirt = 1; |
738 | } | 738 | } |
739 | up(&sbi->s_alloc_sem); | 739 | mutex_unlock(&sbi->s_alloc_mutex); |
740 | return alloc_count; | 740 | return alloc_count; |
741 | } | 741 | } |
742 | 742 | ||
@@ -761,7 +761,7 @@ static int udf_table_new_block(struct super_block * sb, | |||
761 | else | 761 | else |
762 | return newblock; | 762 | return newblock; |
763 | 763 | ||
764 | down(&sbi->s_alloc_sem); | 764 | mutex_lock(&sbi->s_alloc_mutex); |
765 | if (goal < 0 || goal >= UDF_SB_PARTLEN(sb, partition)) | 765 | if (goal < 0 || goal >= UDF_SB_PARTLEN(sb, partition)) |
766 | goal = 0; | 766 | goal = 0; |
767 | 767 | ||
@@ -811,7 +811,7 @@ static int udf_table_new_block(struct super_block * sb, | |||
811 | if (spread == 0xFFFFFFFF) | 811 | if (spread == 0xFFFFFFFF) |
812 | { | 812 | { |
813 | udf_release_data(goal_bh); | 813 | udf_release_data(goal_bh); |
814 | up(&sbi->s_alloc_sem); | 814 | mutex_unlock(&sbi->s_alloc_mutex); |
815 | return 0; | 815 | return 0; |
816 | } | 816 | } |
817 | 817 | ||
@@ -827,7 +827,7 @@ static int udf_table_new_block(struct super_block * sb, | |||
827 | if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) | 827 | if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) |
828 | { | 828 | { |
829 | udf_release_data(goal_bh); | 829 | udf_release_data(goal_bh); |
830 | up(&sbi->s_alloc_sem); | 830 | mutex_unlock(&sbi->s_alloc_mutex); |
831 | *err = -EDQUOT; | 831 | *err = -EDQUOT; |
832 | return 0; | 832 | return 0; |
833 | } | 833 | } |
@@ -846,7 +846,7 @@ static int udf_table_new_block(struct super_block * sb, | |||
846 | } | 846 | } |
847 | 847 | ||
848 | sb->s_dirt = 1; | 848 | sb->s_dirt = 1; |
849 | up(&sbi->s_alloc_sem); | 849 | mutex_unlock(&sbi->s_alloc_mutex); |
850 | *err = 0; | 850 | *err = 0; |
851 | return newblock; | 851 | return newblock; |
852 | } | 852 | } |
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index c9b707b470ca..3873c672cb4c 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -42,7 +42,7 @@ void udf_free_inode(struct inode * inode) | |||
42 | 42 | ||
43 | clear_inode(inode); | 43 | clear_inode(inode); |
44 | 44 | ||
45 | down(&sbi->s_alloc_sem); | 45 | mutex_lock(&sbi->s_alloc_mutex); |
46 | if (sbi->s_lvidbh) { | 46 | if (sbi->s_lvidbh) { |
47 | if (S_ISDIR(inode->i_mode)) | 47 | if (S_ISDIR(inode->i_mode)) |
48 | UDF_SB_LVIDIU(sb)->numDirs = | 48 | UDF_SB_LVIDIU(sb)->numDirs = |
@@ -53,7 +53,7 @@ void udf_free_inode(struct inode * inode) | |||
53 | 53 | ||
54 | mark_buffer_dirty(sbi->s_lvidbh); | 54 | mark_buffer_dirty(sbi->s_lvidbh); |
55 | } | 55 | } |
56 | up(&sbi->s_alloc_sem); | 56 | mutex_unlock(&sbi->s_alloc_mutex); |
57 | 57 | ||
58 | udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1); | 58 | udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1); |
59 | } | 59 | } |
@@ -83,7 +83,7 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err) | |||
83 | return NULL; | 83 | return NULL; |
84 | } | 84 | } |
85 | 85 | ||
86 | down(&sbi->s_alloc_sem); | 86 | mutex_lock(&sbi->s_alloc_mutex); |
87 | UDF_I_UNIQUE(inode) = 0; | 87 | UDF_I_UNIQUE(inode) = 0; |
88 | UDF_I_LENEXTENTS(inode) = 0; | 88 | UDF_I_LENEXTENTS(inode) = 0; |
89 | UDF_I_NEXT_ALLOC_BLOCK(inode) = 0; | 89 | UDF_I_NEXT_ALLOC_BLOCK(inode) = 0; |
@@ -148,7 +148,7 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err) | |||
148 | UDF_I_CRTIME(inode) = current_fs_time(inode->i_sb); | 148 | UDF_I_CRTIME(inode) = current_fs_time(inode->i_sb); |
149 | insert_inode_hash(inode); | 149 | insert_inode_hash(inode); |
150 | mark_inode_dirty(inode); | 150 | mark_inode_dirty(inode); |
151 | up(&sbi->s_alloc_sem); | 151 | mutex_unlock(&sbi->s_alloc_mutex); |
152 | 152 | ||
153 | if (DQUOT_ALLOC_INODE(inode)) | 153 | if (DQUOT_ALLOC_INODE(inode)) |
154 | { | 154 | { |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 368d8f81fe54..9303c50c5d55 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -1515,7 +1515,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
1515 | sb->s_fs_info = sbi; | 1515 | sb->s_fs_info = sbi; |
1516 | memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info)); | 1516 | memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info)); |
1517 | 1517 | ||
1518 | init_MUTEX(&sbi->s_alloc_sem); | 1518 | mutex_init(&sbi->s_alloc_mutex); |
1519 | 1519 | ||
1520 | if (!udf_parse_options((char *)options, &uopt)) | 1520 | if (!udf_parse_options((char *)options, &uopt)) |
1521 | goto error_out; | 1521 | goto error_out; |