Skip to content

Btrfs: batched discard support for btrfs

Li Dongyang linux-btrfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 4 repliesIn review
  2. v21 patch 1 replySuperseded
  3. v11 patch 8 repliesSuperseded

Changes in v4 from the cover letter

*make btrfs_map_block() return full mapping.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Btrfs: make update_reserved_bytes() publicfs/btrfs/Module.symvers fs/btrfs/ctree.h fs/btrfs/extent-tree.c+9 -90 replies
2/4Btrfs: make btrfs_map_block() return entire free extent for each device of RAID0/1/10/DUPfs/btrfs/volumes.c fs/btrfs/volumes.h+129 -220 replies
3/4Btrfs: adjust btrfs_discard_extent() return errors and trimmed bytesfs/btrfs/ctree.h fs/btrfs/disk-io.c fs/btrfs/extent-tree.c+31 -210 replies
4/4Btrfs: add btrfs_trim_fs() to handle FITRIMfs/btrfs/ctree.h fs/btrfs/extent-tree.c fs/btrfs/free-space-cache.c +2 more+190 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH V4 0/4] Btrfs: batched discard support for btrfs

Dear list,
This is V4 of batched discard support, now we will get full mapping of
the free space on each device for RAID0/1/10/DUP instead of just a single stripe length, and tested with xfsstests 251, Thanks.
Changelog V4:
*make btrfs_map_block() return full mapping.
Changelog V3:
*fix style problems.
*rebase to 2.6.38-rc7.
Changelog V2:
*Check if we have devices support trim before trying to trim the fs, also adjust
minlen according to the discard_granularity.
*Update reserved extent calculations in btrfs_trim_block_group().
*Call cond_resched() without checking need_resched()
*Use bitmap_clear_bits() and unlink_free_space() instead of btrfs_remove_free_space(),
so we won't search the same extent for twice.
*Try harder in btrfs_discard_extent(), now we won't report errors
if it's not a EOPNOTSUPP.
*make sure the block group is cached before trimming it,or we'll see an empty caching
tree if the block group is not cached.
*Minor return value fix in btrfs_discard_block_group().