From owner-freebsd-questions@FreeBSD.ORG Mon Oct 20 02:24:51 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6406106566C for ; Mon, 20 Oct 2008 02:24:51 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id 946338FC12 for ; Mon, 20 Oct 2008 02:24:51 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id m9K2OZhH084417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 19 Oct 2008 19:24:35 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id m9K2OZ07084416; Sun, 19 Oct 2008 19:24:35 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA25517; Sun, 19 Oct 08 19:12:49 PDT Date: Sun, 19 Oct 2008 19:18:00 -0700 From: perryh@pluto.rain.com To: freebsd@edvax.de Message-Id: <48fbea58.MJTNxk/Em/TmZNW9%perryh@pluto.rain.com> References: <20081019044058.9ff31b6f.freebsd@edvax.de> <48fac99c.v09a2DdmpE7xdWZS%perryh@pluto.rain.com> <20081019185224.d0ce3bd3.freebsd@edvax.de> In-Reply-To: <20081019185224.d0ce3bd3.freebsd@edvax.de> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Inode numbering X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 02:24:51 -0000 Polytropon wrote: > ... It will force me to > do what I originally intended to do: Iterate from 2 up > to the maximal number and then check the availability, > and, if given, "trace back" the ".. chain" to an existing > directory entry point - or re-create one, if it is missing, > too. Will be a lot of work, but I think I can learn much > from this. You may be able to reuse some code from dump(8). When doing an incremental dump, it reads through the inodes, makes a list of those which are newer than the previous dump, then recursively locates all parent directories of selected inodes and adds them to the list. (When doing a level 0 dump, it does the same thing but by definition every inode is selected.) Having done all that, it dumps all the selected directories followed by the rest of the selected inodes. Dump's purpose is to ensure that the dump will be complete in the sense of containing the full path to any file that is on the tape, and your purpose is different, but I suspect much of the "find parent" logic may be reusable.