[Btrfs-devel] I'm kind of confused...

Josef Bacik jbacik at redhat.com
Fri Aug 17 12:29:33 PDT 2007


On Fri, Aug 17, 2007 at 03:19:49PM -0400, Chris Mason wrote:
> On Fri, 17 Aug 2007 15:08:18 -0400
> Josef Bacik <jbacik at redhat.com> wrote:
> 
>  
> > So the only way I see that the dir_item is associated with the
> > root_item is that the dir_item->location.objectid matches the
> > objectid for my corresponding root_item.  However the item key the
> > leave has is
> > 
> > (4 10000000 8178316903378239287)
> > 
> > so I would have to search through all of the items in the leaf, check
> > the type of object it was, if its a DIR_ITEM pull it out and look at
> > the key's objectid and match it to the root item's objectid.  This
> > seems like a bad idea to me as far as performance is concerned, is
> > there a better way to do this that I haven't found yet?  Or is there
> > no way to associate these two objects easily and I have something to
> > add to my TODO list?  Thanks much,
> 
> One thing on my todo list is to create back pointers from the inode to
> the directory that linked it in.  But, I'm not sure why you can't save
> the name when the root is first created?  We only got to the root by
> walking the directory, so we might as well toss the name into struct
> btrfs_root and save it during the walk.
> 

Ahh sorry I'm a bit conservative when it comes to changing things so I ignored
my urge to just throw it in the struct.  Would you rather have it in memory
populated at the time we read it, or actually add it to the root_item so its
written to disk.  Thank you,

Josef



More information about the Btrfs-devel mailing list