]> git.ipfire.org Git - thirdparty/linux.git/commit
exfat: simplify exfat_lookup()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 24 Apr 2026 13:29:06 +0000 (22:29 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 15 Jun 2026 10:55:26 +0000 (19:55 +0900)
commit623f0aa1eca5c2a94ca1e4e5de719d062eac3b6c
treeb5caa2602242dbe97e205dd5490589ce7b07d199
parent3f5f8ee9917cc2b9076ac533492d8a200edcabb8
exfat: simplify exfat_lookup()

1) d_splice_alias() handles ERR_PTR() for inode just fine
2) no need to even look for existing aliases in case of directory inodes;
   just punt to d_splice_alias(), it'll do the right thing
3) no need to bother with 'd_unhashed(alias)' case - d_find_alias()
   would've returned that only in case of a directory, and d_splice_alias()
   will handle that just fine on its own.
4) exfat_d_anon_disconn() is entirely pointless now - we only get to
   evaluating it in case dentry->d_parent == alias->d_parent and
   alias being a non-directory.  But in that case IS_ROOT(alias) can't
   possibly be true - that would've reqiured alias == alias->d_parent,
   i.e alias == dentry->d_parent and dentry->d_parent is guaranteed to
   be a directory.  So exfat_d_anon_disconn() would always return false
   when it's called, which makes && !exfat_d_anon_disconn(alias)
   a no-op.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/namei.c