aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/bitmap.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-28 15:14:43 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-28 15:14:43 -0400
commit414f746d232d41ed6ae8632c4495ae795373c44b (patch)
tree167f9bc8f139c6e82e6732b38c7a938b8a9d31cd /fs/affs/bitmap.c
parent5a7a201c51c324876d00a54e7208af6af12d1ca4 (diff)
parentc9272c4f9fbe2087beb3392f526dc5b19efaa56b (diff)
Merge branch 'linus' into cpus4096
Diffstat (limited to 'fs/affs/bitmap.c')
-rw-r--r--fs/affs/bitmap.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c
index c4a5ad09ddf2..dc5ef14bdc1c 100644
--- a/fs/affs/bitmap.c
+++ b/fs/affs/bitmap.c
@@ -45,14 +45,14 @@ affs_count_free_blocks(struct super_block *sb)
45 if (sb->s_flags & MS_RDONLY) 45 if (sb->s_flags & MS_RDONLY)
46 return 0; 46 return 0;
47 47
48 down(&AFFS_SB(sb)->s_bmlock); 48 mutex_lock(&AFFS_SB(sb)->s_bmlock);
49 49
50 bm = AFFS_SB(sb)->s_bitmap; 50 bm = AFFS_SB(sb)->s_bitmap;
51 free = 0; 51 free = 0;
52 for (i = AFFS_SB(sb)->s_bmap_count; i > 0; bm++, i--) 52 for (i = AFFS_SB(sb)->s_bmap_count; i > 0; bm++, i--)
53 free += bm->bm_free; 53 free += bm->bm_free;
54 54
55 up(&AFFS_SB(sb)->s_bmlock); 55 mutex_unlock(&AFFS_SB(sb)->s_bmlock);
56 56
57 return free; 57 return free;
58} 58}
@@ -76,7 +76,7 @@ affs_free_block(struct super_block *sb, u32 block)
76 bit = blk % sbi->s_bmap_bits; 76 bit = blk % sbi->s_bmap_bits;
77 bm = &sbi->s_bitmap[bmap]; 77 bm = &sbi->s_bitmap[bmap];
78 78
79 down(&sbi->s_bmlock); 79 mutex_lock(&sbi->s_bmlock);
80 80
81 bh = sbi->s_bmap_bh; 81 bh = sbi->s_bmap_bh;
82 if (sbi->s_last_bmap != bmap) { 82 if (sbi->s_last_bmap != bmap) {
@@ -105,19 +105,19 @@ affs_free_block(struct super_block *sb, u32 block)
105 sb->s_dirt = 1; 105 sb->s_dirt = 1;
106 bm->bm_free++; 106 bm->bm_free++;
107 107
108 up(&sbi->s_bmlock); 108 mutex_unlock(&sbi->s_bmlock);
109 return; 109 return;
110 110
111err_free: 111err_free:
112 affs_warning(sb,"affs_free_block","Trying to free block %u which is already free", block); 112 affs_warning(sb,"affs_free_block","Trying to free block %u which is already free", block);
113 up(&sbi->s_bmlock); 113 mutex_unlock(&sbi->s_bmlock);
114 return; 114 return;
115 115
116err_bh_read: 116err_bh_read:
117 affs_error(sb,"affs_free_block","Cannot read bitmap block %u", bm->bm_key); 117 affs_error(sb,"affs_free_block","Cannot read bitmap block %u", bm->bm_key);
118 sbi->s_bmap_bh = NULL; 118 sbi->s_bmap_bh = NULL;
119 sbi->s_last_bmap = ~0; 119 sbi->s_last_bmap = ~0;
120 up(&sbi->s_bmlock); 120 mutex_unlock(&sbi->s_bmlock);
121 return; 121 return;
122 122
123err_range: 123err_range:
@@ -168,7 +168,7 @@ affs_alloc_block(struct inode *inode, u32 goal)
168 bmap = blk / sbi->s_bmap_bits; 168 bmap = blk / sbi->s_bmap_bits;
169 bm = &sbi->s_bitmap[bmap]; 169 bm = &sbi->s_bitmap[bmap];
170 170
171 down(&sbi->s_bmlock); 171 mutex_lock(&sbi->s_bmlock);
172 172
173 if (bm->bm_free) 173 if (bm->bm_free)
174 goto find_bmap_bit; 174 goto find_bmap_bit;
@@ -249,7 +249,7 @@ find_bit:
249 mark_buffer_dirty(bh); 249 mark_buffer_dirty(bh);
250 sb->s_dirt = 1; 250 sb->s_dirt = 1;
251 251
252 up(&sbi->s_bmlock); 252 mutex_unlock(&sbi->s_bmlock);
253 253
254 pr_debug("%d\n", blk); 254 pr_debug("%d\n", blk);
255 return blk; 255 return blk;
@@ -259,7 +259,7 @@ err_bh_read:
259 sbi->s_bmap_bh = NULL; 259 sbi->s_bmap_bh = NULL;
260 sbi->s_last_bmap = ~0; 260 sbi->s_last_bmap = ~0;
261err_full: 261err_full:
262 up(&sbi->s_bmlock); 262 mutex_unlock(&sbi->s_bmlock);
263 pr_debug("failed\n"); 263 pr_debug("failed\n");
264 return 0; 264 return 0;
265} 265}