Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2001 17:49:33 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        bright@wintelcom.net (Alfred Perlstein)
Cc:        mckusick@FreeBSD.ORG, fs@FreeBSD.ORG
Subject:   Re: versioned files via snapshot evilness.
Message-ID:  <200104261749.KAA24236@usr05.primenet.com>
In-Reply-To: <20010426093439.J18676@fw.wintelcom.net> from "Alfred Perlstein" at Apr 26, 2001 09:34:39 AM

next in thread | previous in thread | raw e-mail | index | archive | help
> I'm wondering if it might be possible to abuse the ffs snapshot
> stuff to do file versioning ala VMS.

Not really, IMO.

Versioning ala VMS requires kernel globbing, or amazingly
intrusive library modifications, coupled with a guarantee
by programmers that they will only use the preferred APIs
in their applications.

Consider how you would make:

	fd = open( "foo", O_RDWR, 0);

open version 17 of the file "foo", as opposed to an earlier version,
and how you would tag versions into the file names, without stealing
a character (e.g. ";").  Also note that "/" is valid in a UTF-8
filename today, if it is part of a multibyte sequence (but FreeBSD
can not handle this).

The only permissable namespace escape mechanism on UNIX is the POSIX
"//<namespace>/<path>" sequence.

Unfortunately, FreeBSD's "namei", "lookup", and individual per-FS
"VOP_LOOKUP" routines are broken, in that a namespace escape would
need to be specified per-path component, since it could not be
inherited by subsequent components.  Fixing this is hard (but not
impossible; I've done it twice now), and without the fix, you end
up with "//<namespace>/<component>//<namespace>//<component>" to
get a full path, or you get "/<component>//<namespace>/<component>"
(both of these latter are illegal, since POSIX only permits the
escape at the start of the path).

You could create a "poor man's versioning system" using a modified
union FS (to take the initial namespace escape) mounted over top
of a folded namespace FS, mounted over e.g. FFS, to do the job of
letting you say "//<version>/<path>" or just "<path>", if you only
wanted the latest version.  But this would still leave you with the
problem of how to _list_ which versions were available for any given
file, which -- again -- requires globbing in the kernel.

Make sense?


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104261749.KAA24236>