summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-12-13 09:06:01 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit76fea00a0522185658b733d441d6ec049344456b (patch)
treeb571afee07d48632290c76e5eda506360e105f5f /fs
parent70b043f0c7d7c78d8a0a01e65067c7c8fe338485 (diff)
downloadop-kernel-dev-76fea00a0522185658b733d441d6ec049344456b.zip
op-kernel-dev-76fea00a0522185658b733d441d6ec049344456b.tar.gz
Btrfs: Add backrefs for symbolic link inodes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index cefe740..06d92be 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -404,16 +404,14 @@ static int btrfs_unlink_trans(struct btrfs_trans_handle *trans,
ret = btrfs_delete_one_dir_name(trans, root, path, di);
dentry->d_inode->i_ctime = dir->i_ctime;
- if (!S_ISLNK(dentry->d_inode->i_mode)) {
- ret = btrfs_del_inode_ref(trans, root, name, name_len,
- dentry->d_inode->i_ino,
- dentry->d_parent->d_inode->i_ino);
- if (ret) {
- printk("failed to delete reference to %.*s, "
- "inode %lu parent %lu\n", name_len, name,
- dentry->d_inode->i_ino,
- dentry->d_parent->d_inode->i_ino);
- }
+ ret = btrfs_del_inode_ref(trans, root, name, name_len,
+ dentry->d_inode->i_ino,
+ dentry->d_parent->d_inode->i_ino);
+ if (ret) {
+ printk("failed to delete reference to %.*s, "
+ "inode %lu parent %lu\n", name_len, name,
+ dentry->d_inode->i_ino,
+ dentry->d_parent->d_inode->i_ino);
}
err:
btrfs_free_path(path);
@@ -1293,13 +1291,11 @@ static int btrfs_add_link(struct btrfs_trans_handle *trans,
dentry->d_parent->d_inode->i_ino,
&key, btrfs_inode_type(inode));
if (ret == 0) {
- if (!S_ISLNK(inode->i_mode)) {
- ret = btrfs_insert_inode_ref(trans, root,
- dentry->d_name.name,
- dentry->d_name.len,
- inode->i_ino,
- dentry->d_parent->d_inode->i_ino);
- }
+ ret = btrfs_insert_inode_ref(trans, root,
+ dentry->d_name.name,
+ dentry->d_name.len,
+ inode->i_ino,
+ dentry->d_parent->d_inode->i_ino);
parent_inode = dentry->d_parent->d_inode;
parent_inode->i_size += dentry->d_name.len * 2;
parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME;
OpenPOWER on IntegriCloud