aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-25 10:09:33 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-25 10:09:33 -0400
commit79c44584ea346024e929ac0f2a3577aac33b7b3f (patch)
treeded9cbb6ca98a74e6002bb380a55b611a25f0149 /fs/btrfs/inode.c
parent4b2220da64727a1e31765ed4e17cd98f39749094 (diff)
Btrfs: Fix mtime and ctime updates on parent dirs
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 9d2a0a3f674d..eba06e7cf414 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -250,6 +250,7 @@ err:
250 btrfs_free_path(path); 250 btrfs_free_path(path);
251 if (!ret) { 251 if (!ret) {
252 dir->i_size -= name_len * 2; 252 dir->i_size -= name_len * 2;
253 dir->i_mtime = dir->i_ctime = CURRENT_TIME;
253 btrfs_update_inode(trans, root, dir); 254 btrfs_update_inode(trans, root, dir);
254 drop_nlink(dentry->d_inode); 255 drop_nlink(dentry->d_inode);
255 ret = btrfs_update_inode(trans, root, dentry->d_inode); 256 ret = btrfs_update_inode(trans, root, dentry->d_inode);
@@ -1037,6 +1038,7 @@ static int btrfs_add_link(struct btrfs_trans_handle *trans,
1037 int ret; 1038 int ret;
1038 struct btrfs_key key; 1039 struct btrfs_key key;
1039 struct btrfs_root *root = BTRFS_I(dentry->d_parent->d_inode)->root; 1040 struct btrfs_root *root = BTRFS_I(dentry->d_parent->d_inode)->root;
1041 struct inode *parent_inode;
1040 key.objectid = inode->i_ino; 1042 key.objectid = inode->i_ino;
1041 key.flags = 0; 1043 key.flags = 0;
1042 btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); 1044 btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
@@ -1047,7 +1049,9 @@ static int btrfs_add_link(struct btrfs_trans_handle *trans,
1047 dentry->d_parent->d_inode->i_ino, 1049 dentry->d_parent->d_inode->i_ino,
1048 &key, btrfs_inode_type(inode)); 1050 &key, btrfs_inode_type(inode));
1049 if (ret == 0) { 1051 if (ret == 0) {
1050 dentry->d_parent->d_inode->i_size += dentry->d_name.len * 2; 1052 parent_inode = dentry->d_parent->d_inode;
1053 parent_inode->i_size += dentry->d_name.len * 2;
1054 parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME;
1051 ret = btrfs_update_inode(trans, root, 1055 ret = btrfs_update_inode(trans, root,
1052 dentry->d_parent->d_inode); 1056 dentry->d_parent->d_inode);
1053 } 1057 }