From: Nicholas Miell <nmiell@comcast.net>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
xfs@oss.sgi.com
Subject: Re: [RFC] add FIEMAP ioctl to efficiently map file allocation
Date: Fri, 13 Apr 2007 11:55:49 -0700 [thread overview]
Message-ID: <1176490549.3122.16.camel@entropy> (raw)
In-Reply-To: <37B026AB-60FA-4595-B2B1-F57BB023D91C@cam.ac.uk>
On Fri, 2007-04-13 at 12:38 +0100, Anton Altaparmakov wrote:
> > One addition freature from the XFS getbmapx interface we should
> > provide is the ability to query layout of xattrs. While other
> > filesystems might not have the exact xattr fork XFS has it fits
> > nicely into the interface. Especially when we have Anton's suggested
> > flag for inline data.
>
> Would it not be better to allow people to get a file descriptor on
> the xattr fork and then just run the normal FIEMAP ioctl on that file
> descriptor?
>
> I.e. "openat(base file descriptor, O_STREAM, streamname)" or O_XATTR
> or whatever... An alternative API would be to provide a "getxattrfd
> ()/fgetxattrfd()" call or similar that would instead of returning the
> value of an xattr return an fd to it. Then you do not need to modify
> openat() at all... Interface doesn't bother me, just some ideas...
>
> And for XFS you would define a magic streamname or xattrname (or
> whatever you want to call it) of say
> "com.sgi.filesystem.xfs.xattrstream" (or .xattrfork) or something and
> then XFS would intercept that and know what to do with it...
>
> Such an interface could then be used by NTFS named streams and other
> file systems providing such things...
>
> (Yes I know I will now totally get flamed about named streams not
> being wanted in Linux and crap like that but that is exactly what you
> are asking for except you want to special case a particular stream
> using a flag instead of calling it for what it really is and once you
> start doing that you might as well allow full named streams...)
>
> You can just see named streams as an alternative, non-atomic API to
> xattrs if you like, i.e. you can either use the atomic xattr API
> provided in Linux already or you can get a file descriptor to an
> xattr and then use the normal system calls to access it non-
> atomically thus you can use the FIEMAP ioctl also. (-:
>
> FWIW this two-API approach to xattrs/named streams is the direction
> OSX is heading towards also so it is not without precedent and
> Windows has had both APIs for many years. And Solaris has the "openat
> (O_XATTR)" interface so that is not without precedent either.
Except that xattrs in Linux aren't streams, and providing a stream-like
interface to them would be a weird abuse of the xattr concept.
In essence, Linux xattrs are named extensions to struct stat, with
getxattr() being in the same category as stat() and setxattr() being in
the same category as chmod()/chown()/utime()/etc.
They system namespace exists to provide a better interface than ioctl()
to weird FS-specific features (DOS attribute bits, HFS+ creator/type,
ext2/3/reiserfs/etc. immutable/append-only/secure-delete/etc. attributes
and so on). The uptake of this feature isn't as high as I'd like, but
that's what it's there for.
They security namespace is there for all the neat LSM modules that need
to attach metadata to files in order to function.
Finally, the user namespace exists to allow users to attach small bits
of information to their own files, since the API was already there and
hey!, metadata is useful.
Now, Solaris came along and totally confused the issue by using the same
name for a completely different feature, but that isn't any real reason
to mess up the existing Linux xattr concept just to graft named streams
support into the kernel.
(Not that I'm opposed to named streams in Linux, you just have to
realize that xattrs aren't name streams, can't live in the same
namespace as named streams, and certainly don't serve the same purpose
as named streams.)
--
Nicholas Miell <nmiell@comcast.net>
next prev parent reply other threads:[~2007-04-13 18:55 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 [this message]
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
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=1176490549.3122.16.camel@entropy \
--to=nmiell@comcast.net \
--cc=aia21@cam.ac.uk \
--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).