Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Nov 2002 18:39:32 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        Rashim Gupta <guptar@cs.rpi.edu>
Cc:        "David E. Cross" <crossd@cs.rpi.edu>, fs@freebsd.org
Subject:   Re: Block alloc question
Message-ID:  <20021106023932.GC24139@elvis.mu.org>
In-Reply-To: <Pine.GSO.4.31.0211052018400.276-100000@jenolen.cs.rpi.edu>
References:  <20021101093713.GK24139@elvis.mu.org> <Pine.GSO.4.31.0211052018400.276-100000@jenolen.cs.rpi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
* Rashim Gupta <guptar@cs.rpi.edu> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021106023932.GC24139>