From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 26 17:58:07 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 D58A016A420 for ; Mon, 26 Sep 2005 17:58:07 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 154EF43D49 for ; Mon, 26 Sep 2005 17:58:04 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.41.233] (Not Verified[10.50.41.233]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Mon, 26 Sep 2005 14:14:01 -0400 From: John Baldwin To: freebsd-hackers@freebsd.org, frank@exit.com Date: Mon, 26 Sep 2005 13:50:01 -0400 User-Agent: KMail/1.8 References: <1127618793.38683.9.camel@realtime.exit.com> In-Reply-To: <1127618793.38683.9.camel@realtime.exit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509261350.02589.jhb@FreeBSD.org> Cc: Subject: Re: Oddity in libufs. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2005 17:58:08 -0000 On Saturday 24 September 2005 11:26 pm, Frank Mayhar wrote: > 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. The person you probably want to ask is jmallett@. I can't find anything in cvs annotate or in the p4 depot to give history on how that got there. On the face of it, it looks like it shouldn't cause any harm to just remove ccg. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org