All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Add ioctl to clear unused space
@ 2018-04-20 14:21 David Sterba
  2018-04-20 14:21 ` [PATCH 1/6] btrfs: extend trim callchain to pass the operation type David Sterba
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: David Sterba @ 2018-04-20 14:21 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

This patchset adds new ioctl similar to TRIM, that provides several
other ways how to clear the unused space.  The changelogs are
incomplete, for preview not for inclusion yet.

It compiles and has been tested lightly, the clearing modes depend on hw
capabilities (secure discard, sector unmapping instead of zeros), so
I've tested only zeroing and discard.

I personally think the zeroing has a usecase and the other modes were
easy to add. Further extensions can be considered, eg. WRITE_SAME,
overwriting with a randomly generated pattern, or some filesystem canary
patterns that can be used to report unused block read as metadata.

As this is modelled after the generic FITRIM ioctl, so this could be a
new generic ioctl too. However, last time somebody wanted such ioctl,
there was a pushback. I'll consider making a generic version and send it
for comments to fsdevel eventually.

git://github.com/kdave/btrfs-devel dev/zero-free


David Sterba (6):
  btrfs: extend trim callchain to pass the operation type
  btrfs: add wrapper to switch clearing operation
  btrfs: add zeroing clear operation
  btrfs: add new ioctl BTRFS_IOC_CLEAR_FREE
  btrfs: add discard secure to clear unused space
  btrfs: add more zeroout modes for clearing unused space

 fs/btrfs/ctree.h            |   5 +-
 fs/btrfs/extent-tree.c      | 130 ++++++++++++++++++++++++++++++++++++++------
 fs/btrfs/free-space-cache.c |  22 +++++---
 fs/btrfs/free-space-cache.h |   3 +-
 fs/btrfs/ioctl.c            |  42 ++++++++++++++
 include/uapi/linux/btrfs.h  |  26 +++++++++
 6 files changed, 199 insertions(+), 29 deletions(-)

-- 
2.16.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-07 12:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-20 14:21 [PATCH 0/6] Add ioctl to clear unused space David Sterba
2018-04-20 14:21 ` [PATCH 1/6] btrfs: extend trim callchain to pass the operation type David Sterba
2018-04-20 14:21 ` [PATCH 2/6] btrfs: add wrapper to switch clearing operation David Sterba
2018-04-20 14:21 ` [PATCH 3/6] btrfs: add zeroing clear operation David Sterba
2018-04-20 14:21 ` [PATCH 4/6] btrfs: add new ioctl BTRFS_IOC_CLEAR_FREE David Sterba
2018-04-20 14:21 ` [PATCH 5/6] btrfs: add discard secure to clear unused space David Sterba
2018-04-20 14:21 ` [PATCH 6/6] btrfs: add more zeroout modes for clearing " David Sterba
2018-04-20 14:49 ` [PATCH 0/6] Add ioctl to clear " Austin S. Hemmelgarn
2018-06-07 12:17 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.