]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hfsplus: extract hidden directory search into a helper function
authorZilin Guan <zilin@seu.edu.cn>
Fri, 27 Mar 2026 08:47:42 +0000 (16:47 +0800)
committerViacheslav Dubeyko <slava@dubeyko.com>
Fri, 27 Mar 2026 21:17:50 +0000 (14:17 -0700)
commitd47059dcc472ae823c7eebe87fb7cec9148b9f06
treed8bbbc9148aff080d4d727fb2912fa846d186114
parent90c500e4fd83fa33c09bc7ee23b6d9cc487ac733
hfsplus: extract hidden directory search into a helper function

In hfsplus_fill_super(), the process of looking up the hidden directory
involves initializing a catalog search, building a search key, reading
the b-tree record, and releasing the search data.

Currently, this logic is open-coded directly within the main superblock
initialization routine. This makes hfsplus_fill_super() quite lengthy
and its error handling paths less straightforward.

Extract the hidden directory search sequence into a new helper function,
hfsplus_get_hidden_dir_entry(). This improves overall code readability,
cleanly encapsulates the hfs_find_data lifecycle, and simplifies the
error exits in hfsplus_fill_super().

Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Tested-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
fs/hfsplus/super.c