exfat: move exfat_chain_set() out of __exfat_resolve_path()
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Fri, 13 Sep 2024 10:02:39 +0000 (18:02 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 25 Nov 2024 08:08:24 +0000 (17:08 +0900)
commit0891c7313d87a1b6baf7162bc2f0d755ce70383f
tree3a1847ed549799f336ed970e8f2e214c66ded244
parentac844e91364a03c35838fd488437605fbe56f8c3
exfat: move exfat_chain_set() out of __exfat_resolve_path()

__exfat_resolve_path() mixes two functions. The first one is to
resolve and check if the path is valid. The second one is to output
the cluster assigned to the directory.

The second one is only needed when need to traverse the directory
entries, and calling exfat_chain_set() so early causes p_dir to be
passed as an argument multiple times, increasing the complexity of
the code.

This commit moves the call to exfat_chain_set() before traversing
directory entries.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Reviewed-by: Daniel Palmer <daniel.palmer@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/namei.c