diff options
Diffstat (limited to 'fs/ufs/ialloc.c')
-rw-r--r-- | fs/ufs/ialloc.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 98f7211599ff..a9cc75ffa925 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c | |||
@@ -69,11 +69,11 @@ void ufs_free_inode (struct inode * inode) | |||
69 | 69 | ||
70 | ino = inode->i_ino; | 70 | ino = inode->i_ino; |
71 | 71 | ||
72 | mutex_lock(&UFS_SB(sb)->s_lock); | 72 | lock_ufs(sb); |
73 | 73 | ||
74 | if (!((ino > 1) && (ino < (uspi->s_ncg * uspi->s_ipg )))) { | 74 | if (!((ino > 1) && (ino < (uspi->s_ncg * uspi->s_ipg )))) { |
75 | ufs_warning(sb, "ufs_free_inode", "reserved inode or nonexistent inode %u\n", ino); | 75 | ufs_warning(sb, "ufs_free_inode", "reserved inode or nonexistent inode %u\n", ino); |
76 | mutex_unlock(&UFS_SB(sb)->s_lock); | 76 | unlock_ufs(sb); |
77 | return; | 77 | return; |
78 | } | 78 | } |
79 | 79 | ||
@@ -81,7 +81,7 @@ void ufs_free_inode (struct inode * inode) | |||
81 | bit = ufs_inotocgoff (ino); | 81 | bit = ufs_inotocgoff (ino); |
82 | ucpi = ufs_load_cylinder (sb, cg); | 82 | ucpi = ufs_load_cylinder (sb, cg); |
83 | if (!ucpi) { | 83 | if (!ucpi) { |
84 | mutex_unlock(&UFS_SB(sb)->s_lock); | 84 | unlock_ufs(sb); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | ucg = ubh_get_ucg(UCPI_UBH(ucpi)); | 87 | ucg = ubh_get_ucg(UCPI_UBH(ucpi)); |
@@ -115,7 +115,7 @@ void ufs_free_inode (struct inode * inode) | |||
115 | ubh_sync_block(UCPI_UBH(ucpi)); | 115 | ubh_sync_block(UCPI_UBH(ucpi)); |
116 | 116 | ||
117 | ufs_mark_sb_dirty(sb); | 117 | ufs_mark_sb_dirty(sb); |
118 | mutex_unlock(&UFS_SB(sb)->s_lock); | 118 | unlock_ufs(sb); |
119 | UFSD("EXIT\n"); | 119 | UFSD("EXIT\n"); |
120 | } | 120 | } |
121 | 121 | ||
@@ -193,7 +193,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) | |||
193 | sbi = UFS_SB(sb); | 193 | sbi = UFS_SB(sb); |
194 | uspi = sbi->s_uspi; | 194 | uspi = sbi->s_uspi; |
195 | 195 | ||
196 | mutex_lock(&sbi->s_lock); | 196 | lock_ufs(sb); |
197 | 197 | ||
198 | /* | 198 | /* |
199 | * Try to place the inode in its parent directory | 199 | * Try to place the inode in its parent directory |
@@ -328,21 +328,20 @@ cg_found: | |||
328 | sync_dirty_buffer(bh); | 328 | sync_dirty_buffer(bh); |
329 | brelse(bh); | 329 | brelse(bh); |
330 | } | 330 | } |
331 | 331 | unlock_ufs(sb); | |
332 | mutex_unlock(&sbi->s_lock); | ||
333 | 332 | ||
334 | UFSD("allocating inode %lu\n", inode->i_ino); | 333 | UFSD("allocating inode %lu\n", inode->i_ino); |
335 | UFSD("EXIT\n"); | 334 | UFSD("EXIT\n"); |
336 | return inode; | 335 | return inode; |
337 | 336 | ||
338 | fail_remove_inode: | 337 | fail_remove_inode: |
339 | mutex_unlock(&sbi->s_lock); | 338 | unlock_ufs(sb); |
340 | clear_nlink(inode); | 339 | clear_nlink(inode); |
341 | iput(inode); | 340 | iput(inode); |
342 | UFSD("EXIT (FAILED): err %d\n", err); | 341 | UFSD("EXIT (FAILED): err %d\n", err); |
343 | return ERR_PTR(err); | 342 | return ERR_PTR(err); |
344 | failed: | 343 | failed: |
345 | mutex_unlock(&sbi->s_lock); | 344 | unlock_ufs(sb); |
346 | make_bad_inode(inode); | 345 | make_bad_inode(inode); |
347 | iput (inode); | 346 | iput (inode); |
348 | UFSD("EXIT (FAILED): err %d\n", err); | 347 | UFSD("EXIT (FAILED): err %d\n", err); |