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

Chris Mason chris.mason at oracle.com
Fri Aug 17 12:19:49 PDT 2007


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.

-chris



More information about the Btrfs-devel mailing list