diff options
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 295268ad231b..088b85976ac0 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -393,9 +393,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) | |||
393 | /* update parent directory's link count corresponding | 393 | /* update parent directory's link count corresponding |
394 | * to ".." entry of the target directory deleted | 394 | * to ".." entry of the target directory deleted |
395 | */ | 395 | */ |
396 | dip->i_nlink--; | ||
397 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 396 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; |
398 | mark_inode_dirty(dip); | 397 | inode_dec_link_count(dip); |
399 | 398 | ||
400 | /* | 399 | /* |
401 | * OS/2 could have created EA and/or ACL | 400 | * OS/2 could have created EA and/or ACL |
@@ -515,8 +514,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) | |||
515 | mark_inode_dirty(dip); | 514 | mark_inode_dirty(dip); |
516 | 515 | ||
517 | /* update target's inode */ | 516 | /* update target's inode */ |
518 | ip->i_nlink--; | 517 | inode_dec_link_count(ip); |
519 | mark_inode_dirty(ip); | ||
520 | 518 | ||
521 | /* | 519 | /* |
522 | * commit zero link count object | 520 | * commit zero link count object |
@@ -835,7 +833,7 @@ static int jfs_link(struct dentry *old_dentry, | |||
835 | rc = txCommit(tid, 2, &iplist[0], 0); | 833 | rc = txCommit(tid, 2, &iplist[0], 0); |
836 | 834 | ||
837 | if (rc) { | 835 | if (rc) { |
838 | ip->i_nlink--; | 836 | ip->i_nlink--; /* never instantiated */ |
839 | iput(ip); | 837 | iput(ip); |
840 | } else | 838 | } else |
841 | d_instantiate(dentry, ip); | 839 | d_instantiate(dentry, ip); |
@@ -1155,9 +1153,9 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1155 | old_ip->i_ino, JFS_RENAME); | 1153 | old_ip->i_ino, JFS_RENAME); |
1156 | if (rc) | 1154 | if (rc) |
1157 | goto out4; | 1155 | goto out4; |
1158 | new_ip->i_nlink--; | 1156 | drop_nlink(new_ip); |
1159 | if (S_ISDIR(new_ip->i_mode)) { | 1157 | if (S_ISDIR(new_ip->i_mode)) { |
1160 | new_ip->i_nlink--; | 1158 | drop_nlink(new_ip); |
1161 | if (new_ip->i_nlink) { | 1159 | if (new_ip->i_nlink) { |
1162 | mutex_unlock(&JFS_IP(new_ip)->commit_mutex); | 1160 | mutex_unlock(&JFS_IP(new_ip)->commit_mutex); |
1163 | if (old_dir != new_dir) | 1161 | if (old_dir != new_dir) |
@@ -1223,7 +1221,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1223 | goto out4; | 1221 | goto out4; |
1224 | } | 1222 | } |
1225 | if (S_ISDIR(old_ip->i_mode)) { | 1223 | if (S_ISDIR(old_ip->i_mode)) { |
1226 | old_dir->i_nlink--; | 1224 | drop_nlink(old_dir); |
1227 | if (old_dir != new_dir) { | 1225 | if (old_dir != new_dir) { |
1228 | /* | 1226 | /* |
1229 | * Change inode number of parent for moved directory | 1227 | * Change inode number of parent for moved directory |