diff options
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 4abbe8604302..ed4d170c212d 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -104,8 +104,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode, | |||
104 | 104 | ||
105 | tid = txBegin(dip->i_sb, 0); | 105 | tid = txBegin(dip->i_sb, 0); |
106 | 106 | ||
107 | down(&JFS_IP(dip)->commit_sem); | 107 | mutex_lock(&JFS_IP(dip)->commit_mutex); |
108 | down(&JFS_IP(ip)->commit_sem); | 108 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
109 | 109 | ||
110 | rc = jfs_init_acl(tid, ip, dip); | 110 | rc = jfs_init_acl(tid, ip, dip); |
111 | if (rc) | 111 | if (rc) |
@@ -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 | up(&JFS_IP(dip)->commit_sem); | 168 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
169 | up(&JFS_IP(ip)->commit_sem); | 169 | mutex_unlock(&JFS_IP(ip)->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; |
@@ -238,8 +238,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) | |||
238 | 238 | ||
239 | tid = txBegin(dip->i_sb, 0); | 239 | tid = txBegin(dip->i_sb, 0); |
240 | 240 | ||
241 | down(&JFS_IP(dip)->commit_sem); | 241 | mutex_lock(&JFS_IP(dip)->commit_mutex); |
242 | down(&JFS_IP(ip)->commit_sem); | 242 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
243 | 243 | ||
244 | rc = jfs_init_acl(tid, ip, dip); | 244 | rc = jfs_init_acl(tid, ip, dip); |
245 | if (rc) | 245 | if (rc) |
@@ -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 | up(&JFS_IP(dip)->commit_sem); | 303 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
304 | up(&JFS_IP(ip)->commit_sem); | 304 | mutex_unlock(&JFS_IP(ip)->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; |
@@ -365,8 +365,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) | |||
365 | 365 | ||
366 | tid = txBegin(dip->i_sb, 0); | 366 | tid = txBegin(dip->i_sb, 0); |
367 | 367 | ||
368 | down(&JFS_IP(dip)->commit_sem); | 368 | mutex_lock(&JFS_IP(dip)->commit_mutex); |
369 | down(&JFS_IP(ip)->commit_sem); | 369 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
370 | 370 | ||
371 | iplist[0] = dip; | 371 | iplist[0] = dip; |
372 | iplist[1] = ip; | 372 | iplist[1] = ip; |
@@ -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 | up(&JFS_IP(dip)->commit_sem); | 387 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
388 | up(&JFS_IP(ip)->commit_sem); | 388 | mutex_unlock(&JFS_IP(ip)->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 | up(&JFS_IP(dip)->commit_sem); | 425 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
426 | up(&JFS_IP(ip)->commit_sem); | 426 | mutex_unlock(&JFS_IP(ip)->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 |
@@ -488,8 +488,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) | |||
488 | 488 | ||
489 | tid = txBegin(dip->i_sb, 0); | 489 | tid = txBegin(dip->i_sb, 0); |
490 | 490 | ||
491 | down(&JFS_IP(dip)->commit_sem); | 491 | mutex_lock(&JFS_IP(dip)->commit_mutex); |
492 | down(&JFS_IP(ip)->commit_sem); | 492 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
493 | 493 | ||
494 | iplist[0] = dip; | 494 | iplist[0] = dip; |
495 | iplist[1] = ip; | 495 | iplist[1] = ip; |
@@ -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 | up(&JFS_IP(dip)->commit_sem); | 506 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
507 | up(&JFS_IP(ip)->commit_sem); | 507 | mutex_unlock(&JFS_IP(ip)->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 | up(&JFS_IP(dip)->commit_sem); | 530 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
531 | up(&JFS_IP(ip)->commit_sem); | 531 | mutex_unlock(&JFS_IP(ip)->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,13 +556,13 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) | |||
556 | 556 | ||
557 | txEnd(tid); | 557 | txEnd(tid); |
558 | 558 | ||
559 | up(&JFS_IP(dip)->commit_sem); | 559 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
560 | up(&JFS_IP(ip)->commit_sem); | 560 | mutex_unlock(&JFS_IP(ip)->commit_mutex); |
561 | 561 | ||
562 | 562 | ||
563 | while (new_size && (rc == 0)) { | 563 | while (new_size && (rc == 0)) { |
564 | tid = txBegin(dip->i_sb, 0); | 564 | tid = txBegin(dip->i_sb, 0); |
565 | down(&JFS_IP(ip)->commit_sem); | 565 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
566 | new_size = xtTruncate_pmap(tid, ip, new_size); | 566 | new_size = xtTruncate_pmap(tid, ip, new_size); |
567 | if (new_size < 0) { | 567 | if (new_size < 0) { |
568 | txAbort(tid, 1); /* Marks FS Dirty */ | 568 | txAbort(tid, 1); /* Marks FS Dirty */ |
@@ -570,7 +570,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) | |||
570 | } else | 570 | } else |
571 | rc = txCommit(tid, 2, &iplist[0], COMMIT_SYNC); | 571 | rc = txCommit(tid, 2, &iplist[0], COMMIT_SYNC); |
572 | txEnd(tid); | 572 | txEnd(tid); |
573 | up(&JFS_IP(ip)->commit_sem); | 573 | mutex_unlock(&JFS_IP(ip)->commit_mutex); |
574 | } | 574 | } |
575 | 575 | ||
576 | if (ip->i_nlink == 0) | 576 | if (ip->i_nlink == 0) |
@@ -805,8 +805,8 @@ static int jfs_link(struct dentry *old_dentry, | |||
805 | 805 | ||
806 | tid = txBegin(ip->i_sb, 0); | 806 | tid = txBegin(ip->i_sb, 0); |
807 | 807 | ||
808 | down(&JFS_IP(dir)->commit_sem); | 808 | mutex_lock(&JFS_IP(dir)->commit_mutex); |
809 | down(&JFS_IP(ip)->commit_sem); | 809 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
810 | 810 | ||
811 | /* | 811 | /* |
812 | * scan parent directory for entry/freespace | 812 | * scan parent directory for entry/freespace |
@@ -847,8 +847,8 @@ static int jfs_link(struct dentry *old_dentry, | |||
847 | out: | 847 | out: |
848 | txEnd(tid); | 848 | txEnd(tid); |
849 | 849 | ||
850 | up(&JFS_IP(dir)->commit_sem); | 850 | mutex_unlock(&JFS_IP(dir)->commit_mutex); |
851 | up(&JFS_IP(ip)->commit_sem); | 851 | mutex_unlock(&JFS_IP(ip)->commit_mutex); |
852 | 852 | ||
853 | jfs_info("jfs_link: rc:%d", rc); | 853 | jfs_info("jfs_link: rc:%d", rc); |
854 | return rc; | 854 | return rc; |
@@ -916,8 +916,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, | |||
916 | 916 | ||
917 | tid = txBegin(dip->i_sb, 0); | 917 | tid = txBegin(dip->i_sb, 0); |
918 | 918 | ||
919 | down(&JFS_IP(dip)->commit_sem); | 919 | mutex_lock(&JFS_IP(dip)->commit_mutex); |
920 | down(&JFS_IP(ip)->commit_sem); | 920 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
921 | 921 | ||
922 | rc = jfs_init_security(tid, ip, dip); | 922 | rc = jfs_init_security(tid, ip, dip); |
923 | if (rc) | 923 | if (rc) |
@@ -1037,8 +1037,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, | |||
1037 | 1037 | ||
1038 | out3: | 1038 | out3: |
1039 | txEnd(tid); | 1039 | txEnd(tid); |
1040 | up(&JFS_IP(dip)->commit_sem); | 1040 | mutex_unlock(&JFS_IP(dip)->commit_mutex); |
1041 | up(&JFS_IP(ip)->commit_sem); | 1041 | mutex_unlock(&JFS_IP(ip)->commit_mutex); |
1042 | if (rc) { | 1042 | if (rc) { |
1043 | free_ea_wmap(ip); | 1043 | free_ea_wmap(ip); |
1044 | ip->i_nlink = 0; | 1044 | ip->i_nlink = 0; |
@@ -1141,13 +1141,13 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1141 | */ | 1141 | */ |
1142 | tid = txBegin(new_dir->i_sb, 0); | 1142 | tid = txBegin(new_dir->i_sb, 0); |
1143 | 1143 | ||
1144 | down(&JFS_IP(new_dir)->commit_sem); | 1144 | mutex_lock(&JFS_IP(new_dir)->commit_mutex); |
1145 | down(&JFS_IP(old_ip)->commit_sem); | 1145 | mutex_lock(&JFS_IP(old_ip)->commit_mutex); |
1146 | if (old_dir != new_dir) | 1146 | if (old_dir != new_dir) |
1147 | down(&JFS_IP(old_dir)->commit_sem); | 1147 | mutex_lock(&JFS_IP(old_dir)->commit_mutex); |
1148 | 1148 | ||
1149 | if (new_ip) { | 1149 | if (new_ip) { |
1150 | down(&JFS_IP(new_ip)->commit_sem); | 1150 | mutex_lock(&JFS_IP(new_ip)->commit_mutex); |
1151 | /* | 1151 | /* |
1152 | * Change existing directory entry to new inode number | 1152 | * Change existing directory entry to new inode number |
1153 | */ | 1153 | */ |
@@ -1160,10 +1160,10 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1160 | if (S_ISDIR(new_ip->i_mode)) { | 1160 | if (S_ISDIR(new_ip->i_mode)) { |
1161 | new_ip->i_nlink--; | 1161 | new_ip->i_nlink--; |
1162 | if (new_ip->i_nlink) { | 1162 | if (new_ip->i_nlink) { |
1163 | up(&JFS_IP(new_dir)->commit_sem); | 1163 | mutex_unlock(&JFS_IP(new_dir)->commit_mutex); |
1164 | up(&JFS_IP(old_ip)->commit_sem); | 1164 | mutex_unlock(&JFS_IP(old_ip)->commit_mutex); |
1165 | if (old_dir != new_dir) | 1165 | if (old_dir != new_dir) |
1166 | up(&JFS_IP(old_dir)->commit_sem); | 1166 | mutex_unlock(&JFS_IP(old_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, |
@@ -1282,16 +1282,16 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1282 | out4: | 1282 | out4: |
1283 | txEnd(tid); | 1283 | txEnd(tid); |
1284 | 1284 | ||
1285 | up(&JFS_IP(new_dir)->commit_sem); | 1285 | mutex_unlock(&JFS_IP(new_dir)->commit_mutex); |
1286 | up(&JFS_IP(old_ip)->commit_sem); | 1286 | mutex_unlock(&JFS_IP(old_ip)->commit_mutex); |
1287 | if (old_dir != new_dir) | 1287 | if (old_dir != new_dir) |
1288 | up(&JFS_IP(old_dir)->commit_sem); | 1288 | mutex_unlock(&JFS_IP(old_dir)->commit_mutex); |
1289 | if (new_ip) | 1289 | if (new_ip) |
1290 | up(&JFS_IP(new_ip)->commit_sem); | 1290 | mutex_unlock(&JFS_IP(new_ip)->commit_mutex); |
1291 | 1291 | ||
1292 | while (new_size && (rc == 0)) { | 1292 | while (new_size && (rc == 0)) { |
1293 | tid = txBegin(new_ip->i_sb, 0); | 1293 | tid = txBegin(new_ip->i_sb, 0); |
1294 | down(&JFS_IP(new_ip)->commit_sem); | 1294 | mutex_lock(&JFS_IP(new_ip)->commit_mutex); |
1295 | new_size = xtTruncate_pmap(tid, new_ip, new_size); | 1295 | new_size = xtTruncate_pmap(tid, new_ip, new_size); |
1296 | if (new_size < 0) { | 1296 | if (new_size < 0) { |
1297 | txAbort(tid, 1); | 1297 | txAbort(tid, 1); |
@@ -1299,7 +1299,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1299 | } else | 1299 | } else |
1300 | rc = txCommit(tid, 1, &new_ip, COMMIT_SYNC); | 1300 | rc = txCommit(tid, 1, &new_ip, COMMIT_SYNC); |
1301 | txEnd(tid); | 1301 | txEnd(tid); |
1302 | up(&JFS_IP(new_ip)->commit_sem); | 1302 | mutex_unlock(&JFS_IP(new_ip)->commit_mutex); |
1303 | } | 1303 | } |
1304 | if (new_ip && (new_ip->i_nlink == 0)) | 1304 | if (new_ip && (new_ip->i_nlink == 0)) |
1305 | set_cflag(COMMIT_Nolink, new_ip); | 1305 | set_cflag(COMMIT_Nolink, new_ip); |
@@ -1361,8 +1361,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry, | |||
1361 | 1361 | ||
1362 | tid = txBegin(dir->i_sb, 0); | 1362 | tid = txBegin(dir->i_sb, 0); |
1363 | 1363 | ||
1364 | down(&JFS_IP(dir)->commit_sem); | 1364 | mutex_lock(&JFS_IP(dir)->commit_mutex); |
1365 | down(&JFS_IP(ip)->commit_sem); | 1365 | mutex_lock(&JFS_IP(ip)->commit_mutex); |
1366 | 1366 | ||
1367 | rc = jfs_init_acl(tid, ip, dir); | 1367 | rc = jfs_init_acl(tid, ip, dir); |
1368 | if (rc) | 1368 | if (rc) |
@@ -1407,8 +1407,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry, | |||
1407 | 1407 | ||
1408 | out3: | 1408 | out3: |
1409 | txEnd(tid); | 1409 | txEnd(tid); |
1410 | up(&JFS_IP(ip)->commit_sem); | 1410 | mutex_unlock(&JFS_IP(ip)->commit_mutex); |
1411 | up(&JFS_IP(dir)->commit_sem); | 1411 | mutex_unlock(&JFS_IP(dir)->commit_mutex); |
1412 | if (rc) { | 1412 | if (rc) { |
1413 | free_ea_wmap(ip); | 1413 | free_ea_wmap(ip); |
1414 | ip->i_nlink = 0; | 1414 | ip->i_nlink = 0; |