diff options
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r-- | fs/udf/namei.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ab9a7629d23e..d14d25534aa8 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -878,8 +878,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry) | |||
878 | inode->i_nlink); | 878 | inode->i_nlink); |
879 | inode->i_nlink = 0; | 879 | inode->i_nlink = 0; |
880 | inode->i_size = 0; | 880 | inode->i_size = 0; |
881 | mark_inode_dirty(inode); | 881 | inode_dec_link_count(inode); |
882 | dir->i_nlink --; | ||
883 | inode->i_ctime = dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); | 882 | inode->i_ctime = dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); |
884 | mark_inode_dirty(dir); | 883 | mark_inode_dirty(dir); |
885 | 884 | ||
@@ -923,8 +922,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry) | |||
923 | goto end_unlink; | 922 | goto end_unlink; |
924 | dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); | 923 | dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); |
925 | mark_inode_dirty(dir); | 924 | mark_inode_dirty(dir); |
926 | inode->i_nlink--; | 925 | inode_dec_link_count(inode); |
927 | mark_inode_dirty(inode); | ||
928 | inode->i_ctime = dir->i_ctime; | 926 | inode->i_ctime = dir->i_ctime; |
929 | retval = 0; | 927 | retval = 0; |
930 | 928 | ||
@@ -1101,8 +1099,7 @@ out: | |||
1101 | return err; | 1099 | return err; |
1102 | 1100 | ||
1103 | out_no_entry: | 1101 | out_no_entry: |
1104 | inode->i_nlink--; | 1102 | inode_dec_link_count(inode); |
1105 | mark_inode_dirty(inode); | ||
1106 | iput(inode); | 1103 | iput(inode); |
1107 | goto out; | 1104 | goto out; |
1108 | } | 1105 | } |
@@ -1261,9 +1258,8 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, | |||
1261 | 1258 | ||
1262 | if (new_inode) | 1259 | if (new_inode) |
1263 | { | 1260 | { |
1264 | new_inode->i_nlink--; | ||
1265 | new_inode->i_ctime = current_fs_time(new_inode->i_sb); | 1261 | new_inode->i_ctime = current_fs_time(new_inode->i_sb); |
1266 | mark_inode_dirty(new_inode); | 1262 | inode_dec_link_count(new_inode); |
1267 | } | 1263 | } |
1268 | old_dir->i_ctime = old_dir->i_mtime = current_fs_time(old_dir->i_sb); | 1264 | old_dir->i_ctime = old_dir->i_mtime = current_fs_time(old_dir->i_sb); |
1269 | mark_inode_dirty(old_dir); | 1265 | mark_inode_dirty(old_dir); |
@@ -1279,12 +1275,10 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, | |||
1279 | } | 1275 | } |
1280 | else | 1276 | else |
1281 | mark_buffer_dirty_inode(dir_bh, old_inode); | 1277 | mark_buffer_dirty_inode(dir_bh, old_inode); |
1282 | old_dir->i_nlink --; | 1278 | inode_dec_link_count(old_dir); |
1283 | mark_inode_dirty(old_dir); | ||
1284 | if (new_inode) | 1279 | if (new_inode) |
1285 | { | 1280 | { |
1286 | new_inode->i_nlink --; | 1281 | inode_dec_link_count(new_inode); |
1287 | mark_inode_dirty(new_inode); | ||
1288 | } | 1282 | } |
1289 | else | 1283 | else |
1290 | { | 1284 | { |