aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 17:43:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 17:43:30 -0400
commitb20e481ab595e9667c33e2393bdfe9a31870d11f (patch)
tree0ffd17e1f9704b49ba6e90ddef49c94e6b191d89
parentb5032a50aea76b6230db74b1d171a7f56b204bb7 (diff)
parent48ce8b056c88920c8ac187781048f5dae33c81b9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6: JFS: commit_mutex cleanups
-rw-r--r--fs/jfs/jfs_txnmgr.c2
-rw-r--r--fs/jfs/namei.c33
2 files changed, 17 insertions, 18 deletions
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 10c46231ce15..efbb586bed4b 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2944,7 +2944,7 @@ int jfs_sync(void *arg)
2944 * Inode is being freed 2944 * Inode is being freed
2945 */ 2945 */
2946 list_del_init(&jfs_ip->anon_inode_list); 2946 list_del_init(&jfs_ip->anon_inode_list);
2947 } else if (! !mutex_trylock(&jfs_ip->commit_mutex)) { 2947 } else if (mutex_trylock(&jfs_ip->commit_mutex)) {
2948 /* 2948 /*
2949 * inode will be removed from anonymous list 2949 * inode will be removed from anonymous list
2950 * when it is committed 2950 * when it is committed
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 09ea03f62277..295268ad231b 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -165,8 +165,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
165 165
166 out3: 166 out3:
167 txEnd(tid); 167 txEnd(tid);
168 mutex_unlock(&JFS_IP(dip)->commit_mutex);
169 mutex_unlock(&JFS_IP(ip)->commit_mutex); 168 mutex_unlock(&JFS_IP(ip)->commit_mutex);
169 mutex_unlock(&JFS_IP(dip)->commit_mutex);
170 if (rc) { 170 if (rc) {
171 free_ea_wmap(ip); 171 free_ea_wmap(ip);
172 ip->i_nlink = 0; 172 ip->i_nlink = 0;
@@ -300,8 +300,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
300 300
301 out3: 301 out3:
302 txEnd(tid); 302 txEnd(tid);
303 mutex_unlock(&JFS_IP(dip)->commit_mutex);
304 mutex_unlock(&JFS_IP(ip)->commit_mutex); 303 mutex_unlock(&JFS_IP(ip)->commit_mutex);
304 mutex_unlock(&JFS_IP(dip)->commit_mutex);
305 if (rc) { 305 if (rc) {
306 free_ea_wmap(ip); 306 free_ea_wmap(ip);
307 ip->i_nlink = 0; 307 ip->i_nlink = 0;
@@ -384,8 +384,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
384 if (rc == -EIO) 384 if (rc == -EIO)
385 txAbort(tid, 1); 385 txAbort(tid, 1);
386 txEnd(tid); 386 txEnd(tid);
387 mutex_unlock(&JFS_IP(dip)->commit_mutex);
388 mutex_unlock(&JFS_IP(ip)->commit_mutex); 387 mutex_unlock(&JFS_IP(ip)->commit_mutex);
388 mutex_unlock(&JFS_IP(dip)->commit_mutex);
389 389
390 goto out2; 390 goto out2;
391 } 391 }
@@ -422,8 +422,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
422 422
423 txEnd(tid); 423 txEnd(tid);
424 424
425 mutex_unlock(&JFS_IP(dip)->commit_mutex);
426 mutex_unlock(&JFS_IP(ip)->commit_mutex); 425 mutex_unlock(&JFS_IP(ip)->commit_mutex);
426 mutex_unlock(&JFS_IP(dip)->commit_mutex);
427 427
428 /* 428 /*
429 * Truncating the directory index table is not guaranteed. It 429 * Truncating the directory index table is not guaranteed. It
@@ -503,8 +503,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
503 if (rc == -EIO) 503 if (rc == -EIO)
504 txAbort(tid, 1); /* Marks FS Dirty */ 504 txAbort(tid, 1); /* Marks FS Dirty */
505 txEnd(tid); 505 txEnd(tid);
506 mutex_unlock(&JFS_IP(dip)->commit_mutex);
507 mutex_unlock(&JFS_IP(ip)->commit_mutex); 506 mutex_unlock(&JFS_IP(ip)->commit_mutex);
507 mutex_unlock(&JFS_IP(dip)->commit_mutex);
508 IWRITE_UNLOCK(ip); 508 IWRITE_UNLOCK(ip);
509 goto out1; 509 goto out1;
510 } 510 }
@@ -527,8 +527,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
527 if ((new_size = commitZeroLink(tid, ip)) < 0) { 527 if ((new_size = commitZeroLink(tid, ip)) < 0) {
528 txAbort(tid, 1); /* Marks FS Dirty */ 528 txAbort(tid, 1); /* Marks FS Dirty */
529 txEnd(tid); 529 txEnd(tid);
530 mutex_unlock(&JFS_IP(dip)->commit_mutex);
531 mutex_unlock(&JFS_IP(ip)->commit_mutex); 530 mutex_unlock(&JFS_IP(ip)->commit_mutex);
531 mutex_unlock(&JFS_IP(dip)->commit_mutex);
532 IWRITE_UNLOCK(ip); 532 IWRITE_UNLOCK(ip);
533 rc = new_size; 533 rc = new_size;
534 goto out1; 534 goto out1;
@@ -556,9 +556,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
556 556
557 txEnd(tid); 557 txEnd(tid);
558 558
559 mutex_unlock(&JFS_IP(dip)->commit_mutex);
560 mutex_unlock(&JFS_IP(ip)->commit_mutex); 559 mutex_unlock(&JFS_IP(ip)->commit_mutex);
561 560 mutex_unlock(&JFS_IP(dip)->commit_mutex);
562 561
563 while (new_size && (rc == 0)) { 562 while (new_size && (rc == 0)) {
564 tid = txBegin(dip->i_sb, 0); 563 tid = txBegin(dip->i_sb, 0);
@@ -847,8 +846,8 @@ static int jfs_link(struct dentry *old_dentry,
847 out: 846 out:
848 txEnd(tid); 847 txEnd(tid);
849 848
850 mutex_unlock(&JFS_IP(dir)->commit_mutex);
851 mutex_unlock(&JFS_IP(ip)->commit_mutex); 849 mutex_unlock(&JFS_IP(ip)->commit_mutex);
850 mutex_unlock(&JFS_IP(dir)->commit_mutex);
852 851
853 jfs_info("jfs_link: rc:%d", rc); 852 jfs_info("jfs_link: rc:%d", rc);
854 return rc; 853 return rc;
@@ -1037,8 +1036,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
1037 1036
1038 out3: 1037 out3:
1039 txEnd(tid); 1038 txEnd(tid);
1040 mutex_unlock(&JFS_IP(dip)->commit_mutex);
1041 mutex_unlock(&JFS_IP(ip)->commit_mutex); 1039 mutex_unlock(&JFS_IP(ip)->commit_mutex);
1040 mutex_unlock(&JFS_IP(dip)->commit_mutex);
1042 if (rc) { 1041 if (rc) {
1043 free_ea_wmap(ip); 1042 free_ea_wmap(ip);
1044 ip->i_nlink = 0; 1043 ip->i_nlink = 0;
@@ -1160,10 +1159,11 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1160 if (S_ISDIR(new_ip->i_mode)) { 1159 if (S_ISDIR(new_ip->i_mode)) {
1161 new_ip->i_nlink--; 1160 new_ip->i_nlink--;
1162 if (new_ip->i_nlink) { 1161 if (new_ip->i_nlink) {
1163 mutex_unlock(&JFS_IP(new_dir)->commit_mutex); 1162 mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
1164 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1165 if (old_dir != new_dir) 1163 if (old_dir != new_dir)
1166 mutex_unlock(&JFS_IP(old_dir)->commit_mutex); 1164 mutex_unlock(&JFS_IP(old_dir)->commit_mutex);
1165 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1166 mutex_unlock(&JFS_IP(new_dir)->commit_mutex);
1167 if (!S_ISDIR(old_ip->i_mode) && new_ip) 1167 if (!S_ISDIR(old_ip->i_mode) && new_ip)
1168 IWRITE_UNLOCK(new_ip); 1168 IWRITE_UNLOCK(new_ip);
1169 jfs_error(new_ip->i_sb, 1169 jfs_error(new_ip->i_sb,
@@ -1281,13 +1281,12 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1281 1281
1282 out4: 1282 out4:
1283 txEnd(tid); 1283 txEnd(tid);
1284
1285 mutex_unlock(&JFS_IP(new_dir)->commit_mutex);
1286 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1287 if (old_dir != new_dir)
1288 mutex_unlock(&JFS_IP(old_dir)->commit_mutex);
1289 if (new_ip) 1284 if (new_ip)
1290 mutex_unlock(&JFS_IP(new_ip)->commit_mutex); 1285 mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
1286 if (old_dir != new_dir)
1287 mutex_unlock(&JFS_IP(old_dir)->commit_mutex);
1288 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1289 mutex_unlock(&JFS_IP(new_dir)->commit_mutex);
1291 1290
1292 while (new_size && (rc == 0)) { 1291 while (new_size && (rc == 0)) {
1293 tid = txBegin(new_ip->i_sb, 0); 1292 tid = txBegin(new_ip->i_sb, 0);