Skip to content

Btrfs: defrag: the remaining unmerged part

Qu Wenruo linux-btrfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7btrfs: remove unused parameter for btrfs_add_inode_defrag()fs/btrfs/ctree.h fs/btrfs/file.c fs/btrfs/inode.c+4 -90 replies
2/7btrfs: refactor __btrfs_run_defrag_inode()fs/btrfs/file.c+45 -400 replies
3/7btrfs: uapi: introduce BTRFS_DEFRAG_RANGE_MASK for later sanity checkinclude/uapi/linux/btrfs.h+4 -20 replies
4/7btrfs: defrag: introduce btrfs_defrag_ctrl structure for later usagefs/btrfs/ctree.h fs/btrfs/ioctl.c+60 -00 replies
5/7btrfs: defrag: use btrfs_defrag_ctrl to replace btrfs_ioctl_defrag_range_args for btrfs_defrag_file()fs/btrfs/ctree.h fs/btrfs/file.c fs/btrfs/ioctl.c+75 -1070 replies
6/7btrfs: defrag: make btrfs_defrag_file() to report accurate number of defragged sectorsfs/btrfs/ioctl.c+2 -80 replies
7/7btrfs: add trace events for defragfs/btrfs/ioctl.c include/trace/events/btrfs.h+131 -00 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchFilipe Manana
1/7
2/7
3/7R-b
4/7R-b
5/7
6/7R-b
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] Btrfs: defrag: the remaining unmerged part

David has already rebased all bug fixes into his fix/autodefrag-io branch.
(Although the last patch still lacks one line to make it work).

This patchset is the remaining related cleanups.

If the 2nd patch doesn't apply, it means the patch "trfs:
reduce extent threshold for autodefrag" is not correct, and doesn't apply extent_thresh properly.

The first patch removes one unused parameter.
The second patch makes __btrfs_run_defrag_inode() to meet our current standard.

Patch 3~6 re-introduce the btrfs_defrag_ctrl to cleanup the argument lists, and make btrfs_defrag_file() reports accurate sectors_defragged.

The last patch introduces the needed trace events.
With the trace events, it's much easier to verify the defrag behavior, and provide a user-friendly way to debug defrag bugs.

Originally I used those trace events to verfy the reduced extent_thresh for autodefrag, but I found out a better way to verify the behavior without using trace events.

So I'll send a new test case to check the changed autodefrag behavior.

Qu Wenruo (7):
btrfs: remove unused parameter for btrfs_add_inode_defrag()
btrfs: refactor __btrfs_run_defrag_inode()
btrfs: uapi: introduce BTRFS_DEFRAG_RANGE_MASK for later sanity check
btrfs: defrag: introduce btrfs_defrag_ctrl structure for later usage
btrfs: defrag: use btrfs_defrag_ctrl to replace
btrfs_ioctl_defrag_range_args for btrfs_defrag_file()
btrfs: defrag: make btrfs_defrag_file() to report accurate number of
defragged sectors
btrfs: add trace events for defrag

 fs/btrfs/ctree.h             |  25 +++-
 fs/btrfs/file.c              |  92 +++++++--------
 fs/btrfs/inode.c             |   2 +-
 fs/btrfs/ioctl.c             | 213 ++++++++++++++++++-----------------
 include/trace/events/btrfs.h | 127 +++++++++++++++++++++
 include/uapi/linux/btrfs.h   |   6 +-
 6 files changed, 310 insertions(+), 155 deletions(-)
Signature · 1 line
2.35.1