do_for_each_ref(): only iterate over the subtree that was requested