diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 12 | ||||
-rw-r--r-- | fs/btrfs/super.c | 9 |
2 files changed, 12 insertions, 9 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 3668048e16f8..3183742d6f0d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -8476,6 +8476,16 @@ out_notrans: | |||
8476 | return ret; | 8476 | return ret; |
8477 | } | 8477 | } |
8478 | 8478 | ||
8479 | static int btrfs_rename2(struct inode *old_dir, struct dentry *old_dentry, | ||
8480 | struct inode *new_dir, struct dentry *new_dentry, | ||
8481 | unsigned int flags) | ||
8482 | { | ||
8483 | if (flags & ~RENAME_NOREPLACE) | ||
8484 | return -EINVAL; | ||
8485 | |||
8486 | return btrfs_rename(old_dir, old_dentry, new_dir, new_dentry); | ||
8487 | } | ||
8488 | |||
8479 | static void btrfs_run_delalloc_work(struct btrfs_work *work) | 8489 | static void btrfs_run_delalloc_work(struct btrfs_work *work) |
8480 | { | 8490 | { |
8481 | struct btrfs_delalloc_work *delalloc_work; | 8491 | struct btrfs_delalloc_work *delalloc_work; |
@@ -9019,7 +9029,7 @@ static const struct inode_operations btrfs_dir_inode_operations = { | |||
9019 | .link = btrfs_link, | 9029 | .link = btrfs_link, |
9020 | .mkdir = btrfs_mkdir, | 9030 | .mkdir = btrfs_mkdir, |
9021 | .rmdir = btrfs_rmdir, | 9031 | .rmdir = btrfs_rmdir, |
9022 | .rename = btrfs_rename, | 9032 | .rename2 = btrfs_rename2, |
9023 | .symlink = btrfs_symlink, | 9033 | .symlink = btrfs_symlink, |
9024 | .setattr = btrfs_setattr, | 9034 | .setattr = btrfs_setattr, |
9025 | .mknod = btrfs_mknod, | 9035 | .mknod = btrfs_mknod, |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8e16bca69c56..67b48b9a03e0 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -851,7 +851,6 @@ static struct dentry *get_default_root(struct super_block *sb, | |||
851 | struct btrfs_path *path; | 851 | struct btrfs_path *path; |
852 | struct btrfs_key location; | 852 | struct btrfs_key location; |
853 | struct inode *inode; | 853 | struct inode *inode; |
854 | struct dentry *dentry; | ||
855 | u64 dir_id; | 854 | u64 dir_id; |
856 | int new = 0; | 855 | int new = 0; |
857 | 856 | ||
@@ -922,13 +921,7 @@ setup_root: | |||
922 | return dget(sb->s_root); | 921 | return dget(sb->s_root); |
923 | } | 922 | } |
924 | 923 | ||
925 | dentry = d_obtain_alias(inode); | 924 | return d_obtain_root(inode); |
926 | if (!IS_ERR(dentry)) { | ||
927 | spin_lock(&dentry->d_lock); | ||
928 | dentry->d_flags &= ~DCACHE_DISCONNECTED; | ||
929 | spin_unlock(&dentry->d_lock); | ||
930 | } | ||
931 | return dentry; | ||
932 | } | 925 | } |
933 | 926 | ||
934 | static int btrfs_fill_super(struct super_block *sb, | 927 | static int btrfs_fill_super(struct super_block *sb, |