Reading and Writing to Block from di_spare

Adam urbansnap at
Thu Jan 17 07:12:57 PST 2008

Hi, I am working on a project for where I want to take the standard  
UFS/FFS file system that BSD ships with and add several blocks of  
information to the dinode.  The simplest way of doing it seemed to be  
to allocate blocks to di_spare.  I believe that I have figured out how  
to do that:

ffs_alloc(inode, 0 , 0, (int)(inode->i_fs->fs_bsize), td->td_ucred,  

I'm having problems taking that block address and reading/writing to  
it.   As far as I can tell most of the buffer read routines (getblk,  
bread) seem to be geared toward reading and writing direct and  
indirect blocks in an inode.

How do I read and write a block that is neither a direct nor an  
indirect block?

I apologize in advance if this is has been posted before. I have spent  
a considerable amount of time searching past posts for the solution.


More information about the freebsd-current mailing list