linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Raiskup <praiskup@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: bug-tar@gnu.org, Mark H Weaver <mhw@netris.org>,
	linux btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [Bug-tar] [PATCH] Re: Detection of sparse files is broken on btrfs
Date: Tue, 09 Jan 2018 09:25:40 +0100	[thread overview]
Message-ID: <2685951.fM9P32U3bG@nb.usersys.redhat.com> (raw)
In-Reply-To: <ae4ec76e-7681-6338-cec5-c0be658df62d@cs.ucla.edu>

On Tuesday, January 9, 2018 8:59:06 AM CET Paul Eggert wrote:
> Pavel Raiskup wrote:
> > So what about special casing that filesystem, where we can lseek() for
> > holes anyway?
> 
> If we can lseek for holes, then why not just do that?

Checking whether lseek() actually works costs some additional syscalls _per
sparse_ file;  checking for ST_NBLOCKS() is without this penalty.

> We shouldn't need special-case code for btrfs per se. Any filesystem
> where we can lseek for holes should take advantage of that optimization.

It is done so actually, the 'wholesparse' is another optimization on top
of that (but usable also in cases where SEEK_HOLE isn't defined at all).

Pavel




  reply	other threads:[~2018-01-09  8:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87fu7hccci.fsf@netris.org>
2018-01-09  7:46 ` [PATCH] Re: [Bug-tar] Detection of sparse files is broken on btrfs Pavel Raiskup
2018-01-09  7:59   ` [Bug-tar] [PATCH] " Paul Eggert
2018-01-09  8:25     ` Pavel Raiskup [this message]
2018-01-09 10:15       ` Joerg Schilling
2018-01-10 12:00         ` Pavel Raiskup
2018-01-09 10:12     ` Joerg Schilling

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=2685951.fM9P32U3bG@nb.usersys.redhat.com \
    --to=praiskup@redhat.com \
    --cc=bug-tar@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mhw@netris.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).