sbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 25 Aug 2016 12:40:12 +0000 (21:40 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 25 Aug 2016 15:10:22 +0000 (00:10 +0900)
commit935c61ab3898085f4f64a200dfbc57c3ca542c47
treeaaf0c7d1e64450a1f3185c1db1a6211062b98d20
parent9ed6fcdb4ff9d712f0d38b633836f42a4bd7491f
sbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data

Ondisk PFS data is a record part of the root ip (inode) when
a new PFS is created via ioctl, so it's normal for ondisk PFS
data to have HAMMER_OBJTYPE_DIRECTORY for obj_type. It's
rather insane that PFS#0 (the only PFS created without ioctl)
has 0 (HAMMER_OBJTYPE_UNKNOWN) for obj_type while the root ip
(not PFS root but HAMMER root) is apparently a directory.

Although PFS#0 and the rest of the PFS are a bit different,
PFS ioctls treat all the ondisk PFS data in the same fashion.
Having consistent obj_type value for the same data type is
considered better than not having.

This change does affect 1 byte of ondisk PFS#0 data initially
created by newfs_hammer, but doesn't break compatibility.
Also see hammer_mkroot_pseudofs().
sbin/newfs_hammer/newfs_hammer.c