qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4] block/raw-posix: Try both FIEMAP and SEEK_HOLE
Date: Fri, 9 May 2014 17:29:37 +0200	[thread overview]
Message-ID: <20140509152937.GC26017@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1399575475-9751-1-git-send-email-mreitz@redhat.com>

On Thu, May 08, 2014 at 08:57:55PM +0200, Max Reitz wrote:
> The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if
> FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even
> compiled in in this case. However, there may be implementations which
> support the latter but not the former (e.g., NFSv4.2) as well as vice
> versa.
> 
> To cover both cases, try FIEMAP first (as this will return -ENOTSUP if
> not supported instead of returning a failsafe value (everything
> allocated as a single extent)) and if that does not work, fall back to
> SEEK_HOLE/SEEK_DATA.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> v4:
>  - If the order of FIEMAP and SEEK_HOLE are reversed (that is, kept the
>    way they are now), the tristates from v3 are not required anymore, as
>    FIEMAP can never be in an “unknown” state and the worst that
>    SEEK_HOLE can do is to report everything as allocated (which is the
>    final fallback anyway). This patch is thus basically the same as v2,
>    only with the order of FIEMAP and SEEK_HOLE reversed (first FIEMAP,
>    then SEEK_HOLE). [Paolo]
> ---
>  block/raw-posix.c | 127 +++++++++++++++++++++++++++++++++---------------------
>  1 file changed, 77 insertions(+), 50 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

      parent reply	other threads:[~2014-05-09 15:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 18:57 [Qemu-devel] [PATCH 4] block/raw-posix: Try both FIEMAP and SEEK_HOLE Max Reitz
2014-05-08 18:59 ` Max Reitz
2014-05-09 15:29 ` Stefan Hajnoczi [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=20140509152937.GC26017@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).