linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Nicholas Miell <nmiell@comcast.net>
Cc: Josef Bacik <jbacik@redhat.com>,
	linux-fsdevel@vger.kernel.org,
	Andreas Dilger <adilger@clusterfs.com>
Subject: Re: [RFC][PATCH] Implement SEEK_HOLE/SEEK_DATA
Date: Wed, 28 Nov 2007 16:39:59 -0700	[thread overview]
Message-ID: <20071128233959.GF4913@webber.adilger.int> (raw)
In-Reply-To: <1196290614.18231.17.camel@entropy>

On Nov 28, 2007  14:56 -0800, Nicholas Miell wrote:
> I stand by my belief that SEEK_HOLE/SEEK_DATA is a lousy interface.
> 
> It abuses the seek operation to become a query operation, it requires a
> total number of system calls proportional to the number holes+data and
> it isn't general enough for other similar uses (e.g. total number of
> contiguous extents, compressed extents, offline extents, extents
> currently shared with other inodes, extents embedded in the inode
> (tails), etc.)
> 
> Something like the following would be much better:
> 
> int getfilextents(int fd, off_t offset, int type, size_t *length, struct
> extent *extents)
> 
> with
> 
> int fd: open file
> 
> offset: offset in file to start reporting extents
> 
> type: one of EXTENT_TYPE_HOLE, EXTENT_TYPE_DATA, EXTENT_TYPE_EXTENTS,
> EXTENT_TYPE_COMPRESSED, EXTENT_TYPE_UNCOMPRESSED etc.

This is what FIEMAP is supposed to do.  We wrote a spec and implemented
a prototype for ext4, but haven't had time to make it generic to move
the large part of the code into the VFS.  If someone wanted to take that
up, it would be much appreciated.

See "[RFC] add FIEMAP ioctl to efficiently map file allocation" in
linux-fsdevel for details on this interface.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


  parent reply	other threads:[~2007-11-28 23:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28 20:02 [RFC][PATCH] Implement SEEK_HOLE/SEEK_DATA Josef Bacik
2007-11-28 21:56 ` Brad Boyer
2007-11-28 23:38   ` Josef Bacik
2007-11-28 22:56 ` Nicholas Miell
2007-11-28 23:33   ` Josef Bacik
2007-11-28 23:50     ` Nicholas Miell
2007-11-28 23:39   ` Andreas Dilger [this message]
2007-11-28 23:48     ` Jörn Engel
2007-11-29  0:06       ` Nicholas Miell
2007-11-29  3:07         ` Jörn Engel
2007-11-29  3:27       ` Andreas Dilger
2007-11-29  4:14         ` Jörn Engel
2007-11-28 23:49 ` Andreas Dilger

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=20071128233959.GF4913@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=adilger@clusterfs.com \
    --cc=jbacik@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nmiell@comcast.net \
    /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).