hfs/hfsplus: move on-disk layout declarations into hfs_common.h
authorViacheslav Dubeyko <slava@dubeyko.com>
Tue, 25 Nov 2025 23:13:27 +0000 (15:13 -0800)
committerViacheslav Dubeyko <slava@dubeyko.com>
Tue, 25 Nov 2025 23:16:03 +0000 (15:16 -0800)
commitec95cd103c3a1e2567927014e4a710416cde3e52
treec15281086507b2f2c3fa9e03f8ea484a6f0bc86d
parent3f04ee216bc1406cb6214ceaa7e544114108e0fa
hfs/hfsplus: move on-disk layout declarations into hfs_common.h

Currently, HFS declares on-disk layout's metadata structures
in fs/hfs/hfs.h and HFS+ declares it in fs/hfsplus/hfsplus_raw.h.
However, HFS and HFS+ on-disk layouts have some similarity and
overlapping in declarations. As a result, fs/hfs/hfs.h and
fs/hfsplus/hfsplus_raw.h contain multiple duplicated declarations.
Moreover, both HFS and HFS+ drivers contain completely similar
implemented functionality in multiple places.

This patch is moving the on-disk layout declarations from
fs/hfs/hfs.h and fs/hfsplus/hfsplus_raw.h into
include/linux/hfs_common.h with the goal to exclude
the duplication in declarations. Also, this patch prepares
the basis for creating a hfslib that can aggregate common
functionality without necessity to duplicate the same code
in HFS and HFS+ drivers.

Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
cc: Yangtao Li <frank.li@vivo.com>
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
fs/hfs/btree.h
fs/hfs/hfs.h
fs/hfs/hfs_fs.h
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/hfsplus_raw.h
fs/hfsplus/xattr.c
include/linux/hfs_common.h