From owner-freebsd-fs Thu Apr 26 10:46:40 2001 Delivered-To: freebsd-fs@freebsd.org Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (Postfix) with ESMTP id 93ECB37B422; Thu, 26 Apr 2001 10:46:36 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.9.3/8.9.3) id KAA28384; Thu, 26 Apr 2001 10:46:34 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp04.primenet.com, id smtpdAAAFQaOr3; Thu Apr 26 10:46:20 2001 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id KAA24236; Thu, 26 Apr 2001 10:49:38 -0700 (MST) From: Terry Lambert Message-Id: <200104261749.KAA24236@usr05.primenet.com> Subject: Re: versioned files via snapshot evilness. To: bright@wintelcom.net (Alfred Perlstein) Date: Thu, 26 Apr 2001 17:49:33 +0000 (GMT) Cc: mckusick@FreeBSD.ORG, fs@FreeBSD.ORG In-Reply-To: <20010426093439.J18676@fw.wintelcom.net> from "Alfred Perlstein" at Apr 26, 2001 09:34:39 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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 "///" 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 "///////" to get a full path, or you get "////" (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 "///" or just "", 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