From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 25 03:26:35 2005 Return-Path: X-Original-To: FreeBSD-hackers@freebsd.org 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 3EF8816A41F for ; Sun, 25 Sep 2005 03:26:35 +0000 (GMT) (envelope-from frank@exit.com) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D981E43D48 for ; Sun, 25 Sep 2005 03:26:34 +0000 (GMT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.13.4/8.13.3) with ESMTP id j8P3QZMt066281 for ; Sat, 24 Sep 2005 20:26:35 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.13.4/8.13.3) with ESMTP id j8P3QYPU039559 for ; Sat, 24 Sep 2005 20:26:34 -0700 (PDT) (envelope-from frank@exit.com) Received: (from frank@localhost) by realtime.exit.com (8.13.4/8.13.4/Submit) id j8P3QY5Z039558 for FreeBSD-hackers@freebsd.org; Sat, 24 Sep 2005 20:26:34 -0700 (PDT) (envelope-from frank@exit.com) X-Authentication-Warning: realtime.exit.com: frank set sender to frank@exit.com using -f From: Frank Mayhar To: FreeBSD-hackers@freebsd.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Exit Consulting Date: Sat, 24 Sep 2005 20:26:33 -0700 Message-Id: <1127618793.38683.9.camel@realtime.exit.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port X-Virus-Scanned: ClamAV 0.86.2/1099/Fri Sep 23 13:29:28 2005 on tinker.exit.com X-Virus-Status: Clean Cc: Subject: Oddity in libufs. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: frank@exit.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2005 03:26:35 -0000 I've been using libufs as the I/O mechanism for my (heavy) modification of sysutils/ffsrecov. It's working to my needs and now I'm poking at other bits and pieces to maybe get it suitable for release into the wild. I just looked at cgread() to see what it does and noticed that there seems to be a redundant line: . . if (c >= fs->fs_ncg) { return (0); } ccg = fsbtodb(fs, cgtod(fs, c)) * disk->d_bsize; if (bread(disk, fsbtodb(fs, cgtod(fs, c)), disk->d_cgunion.d_buf, . . That assignment up there looks redundant, as ccg is never used. I suspect that it's a relic of an old lseek()/read() pair that's long gone. -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/