From owner-freebsd-fs Tue Nov 5 18:39:33 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 B5A9537B401 for ; Tue, 5 Nov 2002 18:39:32 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 789BA43E42 for ; Tue, 5 Nov 2002 18:39:32 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 489FBAE341; Tue, 5 Nov 2002 18:39:32 -0800 (PST) Date: Tue, 5 Nov 2002 18:39:32 -0800 From: Alfred Perlstein To: Rashim Gupta Cc: "David E. Cross" , fs@freebsd.org Subject: Re: Block alloc question Message-ID: <20021106023932.GC24139@elvis.mu.org> References: <20021101093713.GK24139@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i 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 [021105 17:33] wrote: > > Hi, > > I have a question about the Block Alloc operation. When I have to log > a block alloc operation, I think I need to log the Inode number of the > file, the corresponding block and the position in the file where the > block is added. My question is how can I know at what position in the > file is the block added? What function/structure handles this operation? see src/sys/ufs/ffs/ffs_alloc.c:ffs_alloc(ip, lbn, bpref, size, cred, bnp) ip is the inode, and lbn seems to he the logical block offset into the file, i'm not sure offhand what scaling needs to be applied to 'lbn' to get the byte offset. -- -Alfred Perlstein [alfred@freebsd.org] '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