git: sbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Thu Aug 25 08:22:49 PDT 2016


commit 935c61ab3898085f4f64a200dfbc57c3ca542c47
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Aug 25 21:40:12 2016 +0900

    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().

Summary of changes:
 sbin/newfs_hammer/newfs_hammer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/935c61ab3898085f4f64a200dfbc57c3ca542c47


-- 
DragonFly BSD source repository


More information about the Commits mailing list