All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 0/6] Add ioctl to clear unused space
Date: Fri, 20 Apr 2018 16:21:43 +0200	[thread overview]
Message-ID: <cover.1524233244.git.dsterba@suse.com> (raw)

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


             reply	other threads:[~2018-04-20 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 14:21 David Sterba [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1524233244.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.