On Wed, Aug 28, 2019 at 04:01:04PM +0300, Nikolay Borisov wrote:
>
>
> On 28.08.19 г. 12:56 ч., Anand Jain wrote:
> > So when searching for BTRFS_DEV_ITEMS_OBJECTID it hits. Albeit it is
> > defined same as BTRFS_ROOT_TREE_OBJECTID.
> >
> > Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
> > ---
> > print-tree.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/print-tree.c b/print-tree.c
> > index b31e515f8989..5832f3089e3d 100644
> > --- a/print-tree.c
> > +++ b/print-tree.c
> > @@ -704,6 +704,7 @@ void print_objectid(FILE *stream, u64 objectid, u8 type)
> > }
> >
> > switch (objectid) {
> > + /* BTRFS_DEV_ITEMS_OBJECTID */
>
> That comment looks really cryptic to someone just looking at the code.
> Adding case BTRFS_DEV_ITEMS_OBJECTID: is better.
> > case BTRFS_ROOT_TREE_OBJECTID:
Both constants have the same value so they can't be in one switch, but
yeah the comment should be a bit more verbose, just the constant name is
bringing more questions than answers.