[geeks] Versioning FIlesystem
Jonathan C. Patschke
jp at celestrion.net
Sat May 24 00:01:01 CDT 2003
On Sat, 24 May 2003 vance at neurotica.com wrote:
> This sounds strange even to me, but would it be possible to store just
> diffs and access them as full files? It would be slow as hell, but it
> would work, no? There's gotta be a faster way of doing something similar.
If you can explain how to cause data to -force- a programmer to write a
program to access it a certain way and still have it be "just an image"
of the data, you're up for a Turing award and then a Lifetime Achievement
award from the MPAA.
It's the same problem that the copy-protection fanatics have been
dealing with for years. If data XYZ is getting read from or written to
a medium in digital form, it is, at some point, decoded and reencoded.
If you've -written- the decoder, you control what lies on both ends of
the data stream. It's a relatively fundamental law of logic.
The only reason storing diffs works is because you'd have to read all
the versioning data in anyway just to -read- the file, so it'd be
trivial to write it back the Right Way. However, you could still be
antisocial and just flatten the diffs into the new file.
So, if the only reason to implement a new FS is to absolutely guarantee
that it never gets accidentally managed as a regular filesystem, someone
can always throw a wrench into things. However, something that might
make more sense would be alter the way that inodes get mapped.
Instead of having each directory entry point to one "head" inode for
each link, you could have it point to one with each revision, in reverse
order. The inode for the first revision would be the last one in the
list. This would give you your wish of being able to use something like
chattr to tune the number of revisions on a per-file basis. If you
played your cards right, you could probably keep the filesystem
compatible so that you could mount it on a different OS, with the only
impact being that a fsck would move all the "unattached" inodes to
lost+found. This is perfectly reasonable, IMO, since you shouldn't be
using one OS's fs-repair tools on another OS's fs; ufs behaves this way
between SunOS and the BSDs.
Still, though, this wouldn't overcome the need to rewrite basic system
calls like stat and basic tools like du, ls, rm, and cp. I'm guessing
that this is precisely -why- we haven't seen versioned filesystems in
too many places outside of VMS.
--
Jonathan Patschke ) "Lawsuit...why doesn't it surprise me that more
Thorndale, TX ( than half of that word is Suit?"
) --George Adkins
More information about the geeks
mailing list