From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 7 05:55:06 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF08D16A4CE for ; Mon, 7 Feb 2005 05:55:06 +0000 (GMT) Received: from mta1.srv.hcvlny.cv.net (mta1.srv.hcvlny.cv.net [167.206.5.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D1D143D1D for ; Mon, 7 Feb 2005 05:55:06 +0000 (GMT) (envelope-from alex@hightemplar.com) Received: from [192.168.1.50] (ool-18b99517.dyn.optonline.net [24.185.149.23]) by mta1.srv.hcvlny.cv.net (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0IBJ00CSL1RS7O@mta1.srv.hcvlny.cv.net> for freebsd-hackers@freebsd.org; Mon, 07 Feb 2005 00:55:05 -0500 (EST) Date: Mon, 07 Feb 2005 00:54:55 -0500 From: A G Keahan To: Nick Strebkov Message-id: <420702AF.3000705@hightemplar.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) cc: freebsd-hackers@freebsd.org Subject: Re: Question: tracking filesystem changes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2005 05:55:06 -0000 > > No, won't do the trick either. I cannot afford setting up watchdogs > > for every file or even every directory. And I'm essentially > > "interested" in every one of them (for mirroring purposes). A more > > general approach is needed. E.g., if an unlink call is issued and > > an inode is within a particular filesystem (luckily, most of our > > data already lives on or can be easily moved to a separate > > filesystem), a notice is sent to some userland daemon: > > "file /www/xxx/yyy.shtml is unlinked". Or opened for writing, or > > renamed... etc. The file is then scheduled for distribution to > > mirrors. The idea seems simple and straightforward, yet I don't > > know if it is achievable. > > > > The essential part is obtaining the full pathname of the file (won't > > bother with hardlinks at first, they aren't used here). Could that > > be done with the FreeBSD's filesystem (vnode/vfs?) code? (which I'm > > not familiar with) Nick, You might want to take a look at Matt Dillon's journalling work in DragonFly BSD. Their journalling layer can send a filesystem operations change stream (essentially, vfsops such as create, write, truncate, rmdir, etc) to any file descriptor, which makes filesystem changes easy to track and replicate to other machines. See the "Description of the Journaling topology" thread at http://leaf.dragonflybsd.org/mailarchive/kernel/2004-12/dateindex.html Alex