From owner-freebsd-fs Thu Aug 22 20:36: 1 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D49637B400 for ; Thu, 22 Aug 2002 20:35:59 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id D771C43E6A for ; Thu, 22 Aug 2002 20:35:58 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id B1809AE22C; Thu, 22 Aug 2002 20:35:58 -0700 (PDT) Date: Thu, 22 Aug 2002 20:35:58 -0700 From: Alfred Perlstein To: Rashim Gupta Cc: fs@freebsd.org, "David E. Cross" Subject: Re: Block free question Message-ID: <20020823033558.GY75574@elvis.mu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org * Rashim Gupta [020822 20:28] wrote: > > Hi > As you all know we are working on logging the FS metadata. We are stuck > while we are trying to free a block . When we free a block, we need to > write this block number into the log file. We are storing the handle to > the journal file in the ufsmount structure, how do we get access to that > in ffs_blkfree? We have available to us "struct fs *fs", but there > doesn't seem to be a way to get back to the ufsmount from there. We also > have struct vnode *devvp, but that points to the /dev/foo entry (devfs), > so its not usefull. The last bits of information we have are the > block-number and inode-number, which I don't see an easy O(reasonable) way > to extract the ufsmount information. > > As a status update we have the following metadata operations mostly done: > inodealloc, link, unlink, blockalloc. here's one way: you can look at devvp->v_rdev->si_mountpoint for 'struct mount', you can use VFS_VGET on the mount along with the inode number to get the vnode, the vnode can also give you the info you require. -- -Alfred Perlstein [alfred@freebsd.org] [#bsdcode/efnet/irc.prison.net] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message