aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/ialloc.c
diff options
context:
space:
mode:
authorMarco Stornelli <marco.stornelli@gmail.com>2012-10-06 06:42:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-09 23:33:39 -0400
commitb6963327e0521e682c2fffd018574251d3c22b41 (patch)
treea82bcaaad73ca73dd608eec6d9eb470dceee8caa /fs/ufs/ialloc.c
parentc07cb01c45d6f5f80da63e0b17dca889dba48cc1 (diff)
ufs: drop lock/unlock super
Removed lock/unlock super. Added a new private s_lock mutex. Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/ialloc.c')
-rw-r--r--fs/ufs/ialloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index e84cbe21b986..d0426d74817b 100644
--- a/fs/ufs/ialloc.c
+++ b/fs/ufs/ialloc.c
@@ -71,11 +71,11 @@ void ufs_free_inode (struct inode * inode)
71 71
72 ino = inode->i_ino; 72 ino = inode->i_ino;
73 73
74 lock_super (sb); 74 mutex_lock(&UFS_SB(sb)->s_lock);
75 75
76 if (!((ino > 1) && (ino < (uspi->s_ncg * uspi->s_ipg )))) { 76 if (!((ino > 1) && (ino < (uspi->s_ncg * uspi->s_ipg )))) {
77 ufs_warning(sb, "ufs_free_inode", "reserved inode or nonexistent inode %u\n", ino); 77 ufs_warning(sb, "ufs_free_inode", "reserved inode or nonexistent inode %u\n", ino);
78 unlock_super (sb); 78 mutex_unlock(&UFS_SB(sb)->s_lock);
79 return; 79 return;
80 } 80 }
81 81
@@ -83,7 +83,7 @@ void ufs_free_inode (struct inode * inode)
83 bit = ufs_inotocgoff (ino); 83 bit = ufs_inotocgoff (ino);
84 ucpi = ufs_load_cylinder (sb, cg); 84 ucpi = ufs_load_cylinder (sb, cg);
85 if (!ucpi) { 85 if (!ucpi) {
86 unlock_super (sb); 86 mutex_unlock(&UFS_SB(sb)->s_lock);
87 return; 87 return;
88 } 88 }
89 ucg = ubh_get_ucg(UCPI_UBH(ucpi)); 89 ucg = ubh_get_ucg(UCPI_UBH(ucpi));
@@ -117,7 +117,7 @@ void ufs_free_inode (struct inode * inode)
117 ubh_sync_block(UCPI_UBH(ucpi)); 117 ubh_sync_block(UCPI_UBH(ucpi));
118 118
119 ufs_mark_sb_dirty(sb); 119 ufs_mark_sb_dirty(sb);
120 unlock_super (sb); 120 mutex_unlock(&UFS_SB(sb)->s_lock);
121 UFSD("EXIT\n"); 121 UFSD("EXIT\n");
122} 122}
123 123
@@ -197,7 +197,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
197 uspi = sbi->s_uspi; 197 uspi = sbi->s_uspi;
198 usb1 = ubh_get_usb_first(uspi); 198 usb1 = ubh_get_usb_first(uspi);
199 199
200 lock_super (sb); 200 mutex_lock(&sbi->s_lock);
201 201
202 /* 202 /*
203 * Try to place the inode in its parent directory 203 * Try to place the inode in its parent directory
@@ -333,20 +333,20 @@ cg_found:
333 brelse(bh); 333 brelse(bh);
334 } 334 }
335 335
336 unlock_super (sb); 336 mutex_unlock(&sbi->s_lock);
337 337
338 UFSD("allocating inode %lu\n", inode->i_ino); 338 UFSD("allocating inode %lu\n", inode->i_ino);
339 UFSD("EXIT\n"); 339 UFSD("EXIT\n");
340 return inode; 340 return inode;
341 341
342fail_remove_inode: 342fail_remove_inode:
343 unlock_super(sb); 343 mutex_unlock(&sbi->s_lock);
344 clear_nlink(inode); 344 clear_nlink(inode);
345 iput(inode); 345 iput(inode);
346 UFSD("EXIT (FAILED): err %d\n", err); 346 UFSD("EXIT (FAILED): err %d\n", err);
347 return ERR_PTR(err); 347 return ERR_PTR(err);
348failed: 348failed:
349 unlock_super (sb); 349 mutex_unlock(&sbi->s_lock);
350 make_bad_inode(inode); 350 make_bad_inode(inode);
351 iput (inode); 351 iput (inode);
352 UFSD("EXIT (FAILED): err %d\n", err); 352 UFSD("EXIT (FAILED): err %d\n", err);