]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
btrfs: defrag: enable defrag for subpage case
authorQu Wenruo <wqu@suse.com>
Fri, 6 Aug 2021 08:12:42 +0000 (16:12 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:07:58 +0000 (19:07 +0200)
With the new infrastructure which has taken subpage into consideration,
now we should be safe to allow defrag to work for subpage case.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index 502eba1081187ff2f5756a47ee034a21650960e4..9eb0c1eb568e573e71904bc362434cf9880f9438 100644 (file)
@@ -3080,12 +3080,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
                goto out;
        }
 
-       /* Subpage defrag will be supported in later commits */
-       if (root->fs_info->sectorsize < PAGE_SIZE) {
-               ret = -ENOTTY;
-               goto out;
-       }
-
        switch (inode->i_mode & S_IFMT) {
        case S_IFDIR:
                if (!capable(CAP_SYS_ADMIN)) {