Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233811
b: refs/heads/master
c: 37750cd
h: refs/heads/master
i:
  233809: df6be24
  233807: 4c6ef42
v: v3
  • Loading branch information
Al Viro committed Mar 3, 2011
1 parent 240ebbe commit 3ba9e9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4787d45fa76b97e224a8299086bb5fb496275796
refs/heads/master: 37750cdda36721fa7fa816f5f58258d2c013b248
9 changes: 2 additions & 7 deletions trunk/fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
new_de = ufs_find_entry(new_dir, &new_dentry->d_name, &new_page);
if (!new_de)
goto out_dir;
inode_inc_link_count(old_inode);
ufs_set_link(new_dir, new_de, new_page, old_inode);
new_inode->i_ctime = CURRENT_TIME_SEC;
if (dir_de)
Expand All @@ -318,25 +317,21 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (new_dir->i_nlink >= UFS_LINK_MAX)
goto out_dir;
}
inode_inc_link_count(old_inode);
err = ufs_add_link(new_dentry, old_inode);
if (err) {
inode_dec_link_count(old_inode);
if (err)
goto out_dir;
}
if (dir_de)
inode_inc_link_count(new_dir);
}

/*
* Like most other Unix systems, set the ctime for inodes on a
* rename.
* inode_dec_link_count() will mark the inode dirty.
*/
old_inode->i_ctime = CURRENT_TIME_SEC;

ufs_delete_entry(old_dir, old_de, old_page);
inode_dec_link_count(old_inode);
mark_inode_dirty(old_inode);

if (dir_de) {
ufs_set_link(old_inode, dir_de, dir_page, new_dir);
Expand Down

0 comments on commit 3ba9e9e

Please sign in to comment.