Re: NTFS-like streams?

From: Theodore Y. Ts'o (tytso@MIT.EDU)
Date: Sun Aug 13 2000 - 14:58:57 EST


   Date: Sun, 13 Aug 2000 13:42:04 -0400
   From: Michael Rothwell <rothwell@flyingbuttmonkeys.com>

   While I'm not neccissarily an "NTFS person," I feel
   compelled to point out that NTFS named streams operate
   as normal files, and are accessed via a namespace
   extension, the ":" character. BeFS, HPFS, etc. Extended
   Attributes can be built on top of NTFS-style Named
   Streams by providing accessor functions that simply
   opening a stream, writing a chunk of data to it, and
   closing it again. NTFS is the only FS, AFAIK, that
   supports such a generic view of streams. BeFS, the Mac,
   etc. all use Extended Attributes available as name-value
   pairs only via special functions.

Trying to map Extended Attributes on top of the Named Streams
abstraction is at best problematic.

For example, suppose you have an EA:

        Creator=tytso

Now suppose you do the following:

        fd = open("~/Myfile/Creator")
        write(fd, "acox", 4);
        close(fd)

What does the EA contain now? Is it:

        Creator=acoxo

or is it

        Creator=acox

Under Named Streams, it should be "acoxo", but trying to implement that
on a filesystem that uses Extended Attributes is very strange.

If you go in the other direction, and you write:

        fd = open("~/Myfile/Creator")
        write(fd, "The ", 4);
        write(fd, "Eric ", 5);
        write(fd, "Youngdale ", 10);
        write(fd, "Committee" , 9);
        close(fd);

This is going to be awkward at best for a filesystem with Extended
Attributes, as it will need to do an EA replace operation for each
write, while it simluates the concept of a file pointer ---- which
doesn't exist in the standard EA programming interface:

     int attr_{get,set}(const char *path, const char *attrname,
                   char *attrvalue, int *valuelength, int flags);

So as much as I understand the desire for one API "to rule them them all
and in the darkness bind them", I really believe that Extended
Attributes are fundamentally different from Named Streams, and you
really shouldn't try to stretch EA's over the Named Streams procrustean
bed.

                                                        - Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:31 EST