From: Nicholas Miell <nmiell@comcast.net>
To: David Chinner <dgc@sgi.com>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
xfs@oss.sgi.com, hch@infradead.org
Subject: Re: [RFC] add FIEMAP ioctl to efficiently map file allocation
Date: Mon, 30 Apr 2007 21:39:06 -0700 [thread overview]
Message-ID: <1177994346.3362.5.camel@entropy> (raw)
In-Reply-To: <20070501042254.GD77450368@melbourne.sgi.com>
On Tue, 2007-05-01 at 14:22 +1000, David Chinner wrote:
> On Mon, Apr 30, 2007 at 04:44:01PM -0600, Andreas Dilger wrote:
> > On Apr 19, 2007 11:54 +1000, David Chinner wrote:
> > > > struct fiemap {
> > > > __u64 fm_start; /* logical start offset of mapping (in/out) */
> > > > __u64 fm_len; /* logical length of mapping (in/out) */
> > > > __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
> > > > __u32 fm_extent_count; /* number of extents in fm_extents (in/out) */
> > > > __u64 fm_unused;
> > > > struct fiemap_extent fm_extents[0];
> > > > }
> > > >
> > > > /* flags for the fiemap request */
> > > > #define FIEMAP_FLAG_SYNC 0x00000001 /* flush delalloc data to disk*/
> > > > #define FIEMAP_FLAG_HSM_READ 0x00000002 /* retrieve data from HSM */
> > > > #define FIEMAP_FLAG_INCOMPAT 0xff000000 /* must understand these flags*/
> > >
> > > No flags in the INCOMPAT range - shouldn't it be 0x3 at this point?
> >
> > This is actually for future use. Any flags that are added into this range
> > must be understood by both sides or it should be considered an error. Flags
> > outside the FIEMAP_FLAG_INCOMPAT do not necessarily need to be supported.
> > If it turns out that 8 bits is too small a range for INCOMPAT flags, then
> > we can make 0x01000000 an incompat flag that means e.g. 0x00ff0000 are also
> > incompat flags also.
>
> Ah, ok. So it's not really a set of "compatibility" flags,
> it's more a "compulsory" set. Under those terms, i don't really
> see why this is necessary - either the filesystem will understand
> the flags or it will return EINVAL or ignore them...
>
> > I'm assuming that all flags that will be in the original FIEMAP proposal
> > will be understood by the implementations. Most filesystems can safely
> > ignore FLAG_HSM_READ, for example, since they don't support HSM, and for
> > that matter FLAG_SYNC is probably moot for most filesystems also because
> > they do block allocation at preprw time.
>
> Exactly my point - so why do we really need to encode a compulsory set
> of flags in the API?
>
Because flags have meaning, independent of whether or not the filesystem
understands them. And if the filesystem chooses to ignore critically
important flags (instead of returning EINVAL), bad things may happen.
So, either the filesystem will understand the flag
or iff the unknown flag is in the incompat set, it will return EINVAL
or else the unknown flag will be safely ignored.
--
Nicholas Miell <nmiell@comcast.net>
next prev parent reply other threads:[~2007-05-01 4:39 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-12 11:05 [RFC] add FIEMAP ioctl to efficiently map file allocation Andreas Dilger
2007-04-12 11:22 ` Anton Altaparmakov
2007-04-13 4:01 ` Andreas Dilger
2007-04-13 7:46 ` Anton Altaparmakov
2007-04-13 14:53 ` Jeff Mahoney
2007-04-13 1:33 ` Nicholas Miell
2007-04-13 10:15 ` Christoph Hellwig
2007-04-13 11:38 ` Anton Altaparmakov
2007-04-13 18:55 ` Nicholas Miell
2007-04-16 8:01 ` Timothy Shimmin
2007-04-18 23:03 ` Andreas Dilger
2007-04-16 11:22 ` David Chinner
2007-04-19 0:21 ` Andreas Dilger
2007-04-19 1:54 ` David Chinner
2007-04-30 22:44 ` Andreas Dilger
2007-05-01 4:22 ` David Chinner
2007-05-01 4:39 ` Nicholas Miell [this message]
2007-05-01 14:20 ` David Chinner
2007-05-01 18:46 ` Anton Altaparmakov
2007-05-02 9:15 ` David Chinner
2007-05-02 9:36 ` Anton Altaparmakov
2007-05-02 10:57 ` David Chinner
2007-05-02 11:17 ` Anton Altaparmakov
2007-05-03 7:49 ` Andreas Dilger
2007-05-03 8:23 ` Anton Altaparmakov
2007-05-02 9:45 ` Anton Altaparmakov
2007-05-01 22:32 ` Andreas Dilger
2007-05-01 18:37 ` Anton Altaparmakov
2007-05-02 0:06 ` David Chinner
2007-05-02 8:16 ` Anton Altaparmakov
2007-10-29 19:45 ` Andreas Dilger
2007-10-29 20:57 ` Mark Fasheh
2007-10-29 22:13 ` Andreas Dilger
2007-10-29 22:29 ` Andreas Dilger
2007-10-29 22:40 ` Mark Fasheh
2007-10-30 0:11 ` Mark Fasheh
2007-10-30 0:25 ` Andreas Dilger
2007-10-29 22:25 ` David Chinner
2007-05-01 22:30 ` Andreas Dilger
2007-05-02 2:26 ` David Chinner
2007-05-02 8:23 ` Anton Altaparmakov
2007-05-02 8:30 ` Anton Altaparmakov
2007-05-02 9:48 ` David Chinner
2007-05-02 9:56 ` Anton Altaparmakov
2007-04-19 6:23 ` Timothy Shimmin
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=1177994346.3362.5.camel@entropy \
--to=nmiell@comcast.net \
--cc=dgc@sgi.com \
--cc=hch@infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.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).