linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: "detect-zeroes=unmap" support in Btrfs?
Date: Tue, 18 Jul 2017 23:41:52 +0500	[thread overview]
Message-ID: <20170718234152.2ff2f438@natsu> (raw)
In-Reply-To: <20170718165710.111ac97e@natsu>

On Tue, 18 Jul 2017 16:57:10 +0500
Roman Mamedov <rm@romanrm.net> wrote:

> if a block written consists of zeroes entirely, instead of writing zeroes to
> the backing storage, converts that into an "unmap" operation
> (FALLOC_FL_PUNCH_HOLE[1]).

BTW I found that it is very easy to "offline" process preexisting files for
this, using "fallocate -d".

       -d, --dig-holes
              Detect  and  dig  holes. Makes the file sparse in-place, without
              using extra disk space. The minimal size of the hole depends  on
              filesystem I/O block size (usually 4096 bytes). Also, when using
              this option, --keep-size is implied. If no range is specified by
              --offset and --length, then all file is analyzed for holes.

              You  can think of this as doing a "cp --sparse" and renaming the
              dest file as the original,  without  the  need  for  extra  disk
              space.

So my suggestion is to implement an "online" counterpart to such
forced-sparsifying, i.e. the same thing done on FS I/O in-band.
(the analogy is with offline vs in-band dedup).

-- 
With respect,
Roman

      reply	other threads:[~2017-07-18 18:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 11:57 "detect-zeroes=unmap" support in Btrfs? Roman Mamedov
2017-07-18 18:41 ` Roman Mamedov [this message]

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=20170718234152.2ff2f438@natsu \
    --to=rm@romanrm.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).