Date: Mon, 19 Feb 2007 08:53:53 +0100 (CET) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-fs@FreeBSD.ORG, adamsch1@yahoo.com Subject: Re: Advice on runtime directories ala .snapshot Message-ID: <200702190753.l1J7rrFO012210@lurza.secnetix.de> In-Reply-To: <401753.71633.qm@web31809.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Shane Adams wrote: > I've been thinking about how I could add a "virtual" directory entry > similar to netapp, namely a .snapshot. Obviously I'd want to do this > at runtime, but I'm having trouble attacking this problem. There's no precedent for such a thing in FreeBSD currently. The closest thing would be the ".snap" directory used for FreeBSD's snapshot feature, or maybe even the historical "lost+found" directory. But both of them are created statically in the file system, and they represent ordinary directory entries without any magic. You will find purely synthetic files and directories only in the synthetic file systems such as procfs or devfs. > I've been looking at the ufs_lookup routines, seems thats the only > place to tackle such a feature? Or possibly inject a .snapshot entry > as the last entry read in a call to ufs_readdir ? It would be easier to give advice if we knew what you're actually trying to implement. Personally, I think it's not a good idea to mix real and synthetic entries within the same file system. Or at least there should be _very_ good reasons for doing so, and very careful consideration of all possible cases. For example, what's supposed to happen in case of a conflict, i.e. if there is already a real entry with the same name (".snapshot") with some contents? > I believe doing a ls -la on a netapp will not return the .snapshot > directory, only explicitly nameing the directory will achieve the > effects you want. That behaviour is configurable. On a NetApp filer you can configure per volume whether the .snapshot directory appears only in the mount point directory, or in every directory below it. In the case of a NetApp it's not a big problem to manage such synthetic directories, because it has full controll over its file system. Clients can only access it remotely (NFS, SMB, ...), so from the clients' viewpoint the whole file system is kind of "synthetic". Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart Any opinions expressed in this message are personal to the author and may not necessarily reflect the opinions of secnetix GmbH & Co KG in any way. FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor, and when was the last time you needed one?" -- Tom Cargil, C++ Journal
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702190753.l1J7rrFO012210>