Reading and Writing to Block from di_spare

David Schultz das at FreeBSD.ORG
Thu Jan 17 13:02:09 PST 2008


On Thu, Jan 17, 2008, Adam wrote:
> David,
> I understand that there is no routine to read and write specifically  
> to an address contained in the di_spare.   I also understand that  
> di_spare is currently unused and has no specific manipulators.
> 
> Allow me to clarify.  I am looking for a way to take a ufs2_daddr_t  
> (which is neither a direct nor indirect block of a di_node) and read/ 
> write to that address.

To do it cleanly you'd probably need to hack ufs_bmap and
ffs_balloc to map your 'extra' block to a particular LBN (or at
least that's the only way I know how to do it easily.)  But as I
said before, if you just need to store a small amount of
information, extended attributes are most likely a much simpler
alternative.


More information about the freebsd-current mailing list