Ioctl to clear unused space in various ways
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 1 replyIn review
- v15 patches 8 repliesSuperseded
Changes in v2 from the cover letter
- return -EOPNOTSUPP for zoned mode, with a note
- add new operation to reset the chunk map status wrt trim
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | btrfs: extend trim callchains to pass the operation typefs/ fs/ fs/ +5 more | +68 | 0 replies | |
| 2/6 | btrfs: add new ioctl CLEAR_FREEfs/ fs/ fs/ +1 more | +163 | 0 replies | |
| 3/6 | btrfs: add zeroout mode to CLEAR_FREE ioctlfs/ include/ | +12 | 0 replies | |
| 4/6 | btrfs: add secure erase mode to CLEAR_FREE ioctlfs/ include/ | +10 | 0 replies | |
| 5/6 | btrfs: add more zeroout modes to CLEAR_FREE ioctlfs/ include/ | +14 | 0 replies | |
| 6/6 | btrfs: add mode to clear chunk map status to CLEAR_FREE ioctlfs/ fs/ fs/ +1 more | +26 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/6] Ioctl to clear unused space in various ways
Add ioctl that is similar to FITRIM and in addition to trim can do also zeroing (either plain overwrite, or unmap the blocks if the device supports it) and secure erase.
This can be used to zero the unused space in e.g. VM images (when run from inside the guest, if fstrim is not supported) or free space on thin-provisioned devices.
The secure erase is provided by blkdiscard command but I'm not aware of equivalent that can be run on a filesystem, so this is for parity.
v2:
- return -EOPNOTSUPP for zoned mode, with a note
- add new operation to reset the chunk map status wrt trim
David Sterba (6):
btrfs: extend trim callchains to pass the operation type
btrfs: add new ioctl CLEAR_FREE
btrfs: add zeroout mode to CLEAR_FREE ioctl
btrfs: add secure erase mode to CLEAR_FREE ioctl
btrfs: add more zeroout modes to CLEAR_FREE ioctl
btrfs: add mode to clear chunk map status to CLEAR_FREE ioctl
fs/btrfs/discard.c | 4 +- fs/btrfs/extent-tree.c | 159 +++++++++++++++++++++++++++++++----- fs/btrfs/extent-tree.h | 5 +- fs/btrfs/free-space-cache.c | 29 ++++--- fs/btrfs/free-space-cache.h | 8 +- fs/btrfs/inode.c | 2 +- fs/btrfs/ioctl.c | 62 ++++++++++++++ fs/btrfs/volumes.c | 8 +- fs/btrfs/volumes.h | 1 + include/uapi/linux/btrfs.h | 53 ++++++++++++ 10 files changed, 291 insertions(+), 40 deletions(-)
Signature · 1 line
2.47.1