From owner-freebsd-current Mon Oct 28 8:56:22 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 84BC537B401 for ; Mon, 28 Oct 2002 08:56:21 -0800 (PST) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A2D943E42 for ; Mon, 28 Oct 2002 08:56:21 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 23129 invoked from network); 28 Oct 2002 16:56:24 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 28 Oct 2002 16:56:24 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g9SGuJn5087785; Mon, 28 Oct 2002 11:56:19 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <1035610607.1601.25.camel@shumai.marcuscom.com> Date: Mon, 28 Oct 2002 11:56:19 -0500 (EST) From: John Baldwin To: Joe Marcus Clarke Subject: Re: libgtop port and v_tag changes Cc: current@FreeBSD.org, Nate Lawson 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 26-Oct-2002 Joe Marcus Clarke wrote: > On Fri, 2002-10-25 at 14:15, John Baldwin wrote: >> Well, here's the thing. If libgtop is intended to be used only with live >> kernels then it might be a better idea to use xvnode's that you get with >> from the kernel. Alternatively, you could grab the inode and dev number >> the same way the sysctl handler does: >> >> switch (vp->v_type) { >> case VREG: >> case VDIR: >> case VLNK: >> xvn[n].xv_dev = vp->v_cachedfs; >> xvn[n].xv_ino = vp->v_cachedid; >> >> i.e., you could look at those members of struct vnode instead of trying >> to dig into the details of a UFS inode structure in v_data. This >> would remove the need to look at v_tag at all. > > I can certainly do it this way, but would it be equivalent to the > existing code? It doesn't seem like it would be. At least using the > kvm_read method, we get similar behavior for both -stable and -CURRENT. > Correct me if I'm wrong, but the current code is looking at UFS inodes, > where as you're suggesting to look at generic vnodes. Yes. This means that you don't need to even look at v_tag to see if it is a UFS vnode or not. What does libgtop want with device and inode numbers anways? Does it actually do anything useful with them or does it just print them somewhere? Is a user going to care if the inode number was obtained from the vnode or if we groveled in the internals of UFS to find it? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message