From owner-freebsd-current Sun Jul 7 4:39:48 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58ABC37B401; Sun, 7 Jul 2002 04:39:45 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id E16E143E52; Sun, 7 Jul 2002 04:39:44 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.3/8.12.3) with ESMTP id g67BfJ0M022797; Sun, 7 Jul 2002 04:41:23 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200207071141.g67BfJ0M022797@gw.catspoiler.org> Date: Sun, 7 Jul 2002 04:40:22 -0700 (PDT) From: Don Lewis Subject: Re: dump(8) is hosed To: iedowse@maths.tcd.ie Cc: Georg.Koltermann@mscsoftware.com, obrien@FreeBSD.ORG, current@FreeBSD.ORG, mckusick@mckusick.com In-Reply-To: <200207071227.aa27815@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 7 Jul, Ian Dowse wrote: > In message <200207070458.g674wI0M021931@gw.catspoiler.org>, Don Lewis writes: >> >>I was finally finally able to reproduce this by creating a large file >>before doing the dump. Dump(8) is *very* hosed. The UFS2 import broke >>it's ability to follow multiple levels of indirect blocks. > > Thanks for tracking this down! One thing is that the code was using > the static pointers to avoid having to malloc and free blocks every > time. Keeping an array of NIADDR pointers and using `ind_level' as > the index is an alternative (patch below) - I doubt the performance > difference is noticable but it avoids having to remember the free() > before each return. Prior to the UFS2 import, the code used an automatic array on the stack, which was even cleaner. If you want to dynamically size the array and don't mind a potential portability problem you could use alloca(). The only time you'll take the performance hit is on large files, since the small ones won't have indirect blocks. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message