summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorViacheslav Dubeyko <slava@dubeyko.com>2026-04-03 16:05:55 -0700
committerViacheslav Dubeyko <slava@dubeyko.com>2026-04-08 14:23:29 -0700
commit732af3aa6337fd56025c0548a9e54d6231052144 (patch)
tree3fe7d66379f4b18188acf5870b022aea82a5b8af /include/linux
parent63584d76765bb3e212f70c4c3951ea785fabef1b (diff)
hfsplus: rework logic of map nodes creation in xattr b-tree
In hfsplus_init_header_node() when node_count > 63488 (header bitmap capacity), the code calculates map_nodes, subtracts them from free_nodes, and marks their positions used in the bitmap. However, it doesn't write the actual map node structure (type, record offsets, bitmap) for those physical positions, only node 0 is written. This patch reworks hfsplus_create_attributes_file() logic by introducing a specialized method of hfsplus_init_map_node() and writing the allocated map b-tree's nodes by means of hfsplus_write_attributes_file_node() method. 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> Link: https://lore.kernel.org/r/20260403230556.614171-5-slava@dubeyko.com Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hfs_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hfs_common.h b/include/linux/hfs_common.h
index 9e71b9a03b60..07dfc39630ab 100644
--- a/include/linux/hfs_common.h
+++ b/include/linux/hfs_common.h
@@ -518,6 +518,8 @@ struct hfs_btree_header_rec {
#define HFSPLUS_BTREE_HDR_MAP_REC_INDEX 2 /* Map (bitmap) record in Header node */
#define HFSPLUS_BTREE_MAP_NODE_REC_INDEX 0 /* Map record in Map Node */
#define HFSPLUS_BTREE_HDR_USER_BYTES 128
+#define HFSPLUS_BTREE_MAP_NODE_RECS_COUNT 2
+#define HFSPLUS_BTREE_MAP_NODE_RESERVED_BYTES 2
/* btree key type */
#define HFSPLUS_KEY_CASEFOLDING 0xCF /* case-insensitive */