btrfs: btrfs_defrag_root() doesn't defrag extent root tree
authorAnand Jain <anand.jain@oracle.com>
Wed, 21 Dec 2016 07:42:08 +0000 (15:42 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 14:50:50 +0000 (15:50 +0100)
Since btrfs_defrag_leaves() does not support extent_root, remove its
corresponding call. The user can use the file based defrag to defrag
extents as of now.

No change in behaviour as extent_root is explicitly skipped in
btrfs_defrag_leaves and this has never worked as expected.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ ehnance changelong ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index 03de93f9a6aae8f283431ae972b13c80ad9f98c2..fe8b585ea13b25d0e4df802ed483959401ae2156 100644 (file)
@@ -2613,9 +2613,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
                        goto out;
                }
                ret = btrfs_defrag_root(root);
-               if (ret)
-                       goto out;
-               ret = btrfs_defrag_root(root->fs_info->extent_root);
                break;
        case S_IFREG:
                if (!(file->f_mode & FMODE_WRITE)) {