Re: NTFS-like streams?

From: wingel@t1.ctrl-c.liu.se
Date: Mon Aug 14 2000 - 02:48:33 EST


torvalds@transmeta.com wrote:
>Anyway, somebody. Somebody was suggesting the utterly limited and
>braindead interface of "set_extended_attribute(file, xxxx, yyy, zzzz)"
>kind of approach. Which obviously does not handle the generic case.

That depends entirely on what ones goal is. If the goal is to have
multiple data streams that can be read and written, sure, then the
{set,get}_extended_attribute is madness, so it wont fit NTFS for
example. But if the goal is to have _small_ attributes with the
requirement that an attribute operation is atomic (i.e. doing a
set_extended_attribute either sets the attribute or not, it won't
ever write half of the data), then the above interface is quite sane.

I belive it was Theodore Y. Ts'o who said that one of the problems
with this discussion is that everybody has their own idea of what
they are trying to do but everyone is calling it streams/EAs.

But, for the NTFS case, is this what you have in mind?

Files with alternate streams look exactly like normal files except
that they also have a S_IFCOMPLEX flag and that one can use them as
directories. When accessing such a file as a directory, it should
act as a separate filesystem of its own, so that renames and links
work inside this filesystem, but not outside it:

bash$ ls -l file-with-forks
-rw-r--r-- 1 root root 20816 Sep 20 1999 file-with-forks

bash$ cd file-with-forks

bash$ ls -l
-rw-r--r-- 1 root root 16 Sep 20 1999 foo

bash$ cat foo
contents of foo

bash$ ln foo bar

bash$ cat bar
contents of foo

bash$ mv foo xyzzy

bash$ ln bar ..
ln: cannot create hard link `../bar' to `bar': Permission denied

bash$ mkdir newdir
mkdir: cannot make directory `newdir': Permission denied

Of course, this means that an unmodified tar and cp won't work, but that's
something we'll have to live with.

  /Christer

-- 
"Just how much can I get away with and still go to heaven?"

- 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:32 EST