]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()
authorQu Wenruo <wqu@suse.com>
Thu, 27 May 2021 12:33:22 +0000 (20:33 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:07:58 +0000 (19:07 +0200)
commit2caa54427157a6131957c84594c6d1887a3137ef
tree397f0144b9300ba03304bd390a175a9e7bfaf88e
parent6d9df1cab7d66c50c04ec8e750f5ceaabc27d95f
btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()

The function defrag_one_cluster() is able to defrag one range well
enough, we only need to do preparation for it, including:

- Clamp and align the defrag range
- Exclude invalid cases
- Proper inode locking

The old infrastructures will not be removed in this patch, as it would
be too noisy to review.

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