sys/vfs/hammer: Fix wrong parent localization for PFS root
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 10 Dec 2015 15:11:44 +0000 (00:11 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 11 Dec 2015 10:02:34 +0000 (19:02 +0900)
commit5b4785a6e4dd45dbce359247b74e49935c08ac9c
tree17eafb5d763ddaa9add5ea1bc8635d663f6e8a00
parent587c6c14de739603ac99a467c8087793c5b1591d
sys/vfs/hammer: Fix wrong parent localization for PFS root

The idea of PFS root inode having ip localization value of its
parent directory's inode has been #if0'd after ea434b6f in 2008.

(Since then parent_obj_localization field of ondisk inode seems
to be always 0 because the field is never touched after it's
first allocated, unless it's a symlink which uses symlink[24]
part of union)

Since the field is now deprecated, using this as a localization
value of inode's parent is wrong when the inode is PFS root. It
should use a proper localization value HAMMER_DEF_LOCALIZATION
which is also 0.

Note that HAMMER userspace doesn't allow creating a PFS in PFS
unless the parent PFS is PFS0 (see hammer_cmd_pseudofs_create()),
so it doesn't need to consider the parent inode's localization
value other than the default localization value. If that's allowed,
there seems to be no easy way to tell the localization value.

Also remove parent_obj_localization field of ondisk inode since
it's no longer used after this commit.
sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_vnops.c