diff options
author | NeilBrown <neil@brown.name> | 2025-07-19 18:46:42 +0900 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2025-07-20 19:17:13 -0500 |
commit | a5dc90a9c355a30300ea4b4b25f0732270568d83 (patch) | |
tree | 4e88f97716959ec1280a0bc5dd681e75a2eda815 /scripts/lib/kdoc/kdoc_parser.py | |
parent | 09f124b2871b3cf1e04fcdd3aff7932ecc8c125c (diff) |
smb/server: simplify ksmbd_vfs_kern_path_locked()
ksmbd_vfs_kern_path_locked() first tries to look up the path with the
given case. When this fails, if caseless is set, it loops over the
components in the path, opening the relevant directory and searching
for a name which matches. This name is copied over the original and the
the process repeats. Each time a lookup with the newly updated path is
repeated from the top (vfs_path_lookup()).
When the last component has been case-corrected the simplest next step
is to repeat the original lookup with ksmbd_vfs_path_lookup_locked().
If this works it gives exactly what we want, if it fails it gives the
correct failure.
This observation allows the code to be simplified, in particular
removing the ksmbd_vfs_lock_parent() call.
This patch also removes the duplication of name and filepath (two
names for the one thing) and calls path_put(parent_path) sooner so
parent_path can be passed directly to vfs_path_lookup avoiding the need
to store it temporarily in path and then copying into parent_path.
This patch removes one user of ksmbd_vfs_lock_parent() which will
simplify a future patch.
Signed-off-by: NeilBrown <neil@brown.name>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions