linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Eric Blake <eblake@redhat.com>
Cc: Sunil Mushran <sunil.mushran@oracle.com>,
	Markus Trippelsdorf <markus@trippelsdorf.de>,
	Christoph Hellwig <hch@infradead.org>,
	Josef Bacik <josef@toxicpanda.com>,
	linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags
Date: Mon, 25 Apr 2011 15:15:40 +0100	[thread overview]
Message-ID: <20110425141540.GB20461@shareable.org> (raw)
In-Reply-To: <4DB56B11.5090505@redhat.com>

Eric Blake wrote:
> On 04/24/2011 11:49 AM, Jamie Lokier wrote:
> >> My problem with FIND_* is that we are messing with the well understood
> >> semantics of lseek().
> > 
> > fcntl() looks a better fit for FIND_HOLE/DATA anyway.
> 
> With fcntl(), it would have to be something like:
> 
> off_t offset = start;
> if (fcntl (fd, F_FIND_HOLE, &offset) != 0)
>     ; // find failed
> // offset is now set to the next location after start

Yes that, or a pointer-to-struct in the style of other fcntl()
operations.

A struct offers more flexibiliy such as a limit on search distance
(may be useful on filesystems where searching reads a lot of metadata
and you don't really want to scan all of a large file), and whether to
include unwritten prealloc space or written-known-zeros space.

I thought of fcntl() because historically it's often how you get quirky
information about files and how to read them, on many OSes.

-- Jamie

  reply	other threads:[~2011-04-25 14:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 19:42 [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags Josef Bacik
2011-04-21 19:42 ` [PATCH 2/2] Btrfs: implement our own ->llseek Josef Bacik
2011-04-21 20:45 ` [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags Theodore Tso
2011-04-21 21:29   ` Sunil Mushran
2011-04-22  3:23   ` Matthew Wilcox
2011-04-22  4:47 ` Christoph Hellwig
     [not found] ` <loom.20110422T001650-760@post.gmane.org>
     [not found]   ` <BANLkTiknb+hzFAjpwESwMcqMVtkFc0HFQQ@mail.gmail.com>
2011-04-22  4:50     ` Christoph Hellwig
2011-04-22 11:28       ` Markus Trippelsdorf
2011-04-22 11:50         ` Eric Blake
2011-04-22 16:28           ` Sunil Mushran
2011-04-22 16:40             ` Eric Blake
2011-04-22 16:57               ` Sunil Mushran
2011-04-22 17:03                 ` Eric Blake
2011-04-22 17:08                   ` Sunil Mushran
2011-04-22 18:06                     ` Andreas Dilger
2011-04-22 23:33                       ` Sunil Mushran
2011-04-24 17:49             ` Jamie Lokier
2011-04-25 12:37               ` Eric Blake
2011-04-25 14:15                 ` Jamie Lokier [this message]
     [not found]         ` <4DB17D5B.2090303@redhat.com>
2011-04-25 15:02           ` Nick Bowler
2011-04-22 20:10 ` Jonathan Nieder
2011-04-22 20:49   ` Sunil Mushran
2011-04-25  3:11 ` Valdis.Kletnieks

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=20110425141540.GB20461@shareable.org \
    --to=jamie@shareable.org \
    --cc=eblake@redhat.com \
    --cc=hch@infradead.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    --cc=sunil.mushran@oracle.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).