aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/inode.c')
-rw-r--r--fs/jfs/inode.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 9f942ca8e4e3..d7834a9117ce 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
@@ -89,16 +89,16 @@ int jfs_commit_inode(struct inode *inode, int wait)
89 } 89 }
90 90
91 tid = txBegin(inode->i_sb, COMMIT_INODE); 91 tid = txBegin(inode->i_sb, COMMIT_INODE);
92 down(&JFS_IP(inode)->commit_sem); 92 mutex_lock(&JFS_IP(inode)->commit_mutex);
93 93
94 /* 94 /*
95 * Retest inode state after taking commit_sem 95 * Retest inode state after taking commit_mutex
96 */ 96 */
97 if (inode->i_nlink && test_cflag(COMMIT_Dirty, inode)) 97 if (inode->i_nlink && test_cflag(COMMIT_Dirty, inode))
98 rc = txCommit(tid, 1, &inode, wait ? COMMIT_SYNC : 0); 98 rc = txCommit(tid, 1, &inode, wait ? COMMIT_SYNC : 0);
99 99
100 txEnd(tid); 100 txEnd(tid);
101 up(&JFS_IP(inode)->commit_sem); 101 mutex_unlock(&JFS_IP(inode)->commit_mutex);
102 return rc; 102 return rc;
103} 103}
104 104
@@ -335,18 +335,18 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length)
335 tid = txBegin(ip->i_sb, 0); 335 tid = txBegin(ip->i_sb, 0);
336 336
337 /* 337 /*
338 * The commit_sem cannot be taken before txBegin. 338 * The commit_mutex cannot be taken before txBegin.
339 * txBegin may block and there is a chance the inode 339 * txBegin may block and there is a chance the inode
340 * could be marked dirty and need to be committed 340 * could be marked dirty and need to be committed
341 * before txBegin unblocks 341 * before txBegin unblocks
342 */ 342 */
343 down(&JFS_IP(ip)->commit_sem); 343 mutex_lock(&JFS_IP(ip)->commit_mutex);
344 344
345 newsize = xtTruncate(tid, ip, length, 345 newsize = xtTruncate(tid, ip, length,
346 COMMIT_TRUNCATE | COMMIT_PWMAP); 346 COMMIT_TRUNCATE | COMMIT_PWMAP);
347 if (newsize < 0) { 347 if (newsize < 0) {
348 txEnd(tid); 348 txEnd(tid);
349 up(&JFS_IP(ip)->commit_sem); 349 mutex_unlock(&JFS_IP(ip)->commit_mutex);
350 break; 350 break;
351 } 351 }
352 352
@@ -355,7 +355,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length)
355 355
356 txCommit(tid, 1, &ip, 0); 356 txCommit(tid, 1, &ip, 0);
357 txEnd(tid); 357 txEnd(tid);
358 up(&JFS_IP(ip)->commit_sem); 358 mutex_unlock(&JFS_IP(ip)->commit_mutex);
359 } while (newsize > length); /* Truncate isn't always atomic */ 359 } while (newsize > length); /* Truncate isn't always atomic */
360} 360}
361 361