On Mon, Sep 28, 2009 at 10:36:13AM -0700, Richard Sharpe wrote:
> > ? ? ? ?if (level == 0)
> > ? ? ? ? ? ? ? ?return 1;
> > which should take care of the leaf nodes by exiting early.
> Well, yes there is, but that is the problem I encountered. It is level
> as passed in when starting at the top of the tree, which is obtained
> from the levels value in the AGF, and is decremented by one on each
> if (!(*func)(iocur_top->data, agno, agbno, level - 1, btype, arg))
> However, what should really be looked at is the value bb_level in the
> header in each free-space Btree node.
I think bother are equally valid. The one passed in fro mthe top should
always be right while the ondisk one might be corrupted.
> After I made that change to my changes, I started being able to
> properly count all leaf nodes and free extents, and the numbers came
> out where I expected them to be (instead of not seeing many leaf nodes
> and vastly undercounting free extents).
Still not quite understanding your problem here. Do you have a tool
of your own that doesn't start from the btree root but only walks
subtrees? In that case you need to look at the on-disk level unless
you can find out easily what level you start at. But I don't think we
need this for the existing tools that always walk from the root.
> Richard Sharpe
> xfs mailing list
---end quoted text---