vfs: fix docstring of hash_name()
PATCH v2 1/1 vfs: fix docstring of hash_name()
The docstring of hash_name() is falsely reporting that it returns the component length, whereas it returns a pointer to the terminating '/' or NUL character in the pathname being resolved.
--- fs/namei.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/namei.c +8 -2
@@ -2437,8 +2437,14 @@ u64 hashlen_string(const void *salt, const char *name)EXPORT_SYMBOL (hashlen_string);/* -* Calculate the length and hash of the path component, and -* return the length as the result. +* hash_name - Calculate the length and hash of the path component +* @nd: the path resolution state +* @name: the pathname to read the component from +* @lastword: if the component fits in a single word, LAST_WORD_IS_DOT, +* LAST_WORD_IS_DOTDOT, or some other value depending on whether the +* component is '.', '..', or something else. Otherwise, @lastword is 0. +* +* Returns: a pointer to the terminating '/' or NUL character in @name. */ static inline const char *hash_name(struct nameidata *nd, const char *name,
Signature · 1 line
2.53.0
Quoted 3 lines · Jori Koolstra
The docstring of
hash_name()is falsely reporting that it returns the component length, whereas it returns a pointer to the terminating '/' or NUL character in the pathname being resolved.
Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fixes
[1/1] vfs: fix docstring of hash_name()
https://git.kernel.org/vfs/vfs/c/8fb6857f2f5e
Quoted 5 lines · Jori Koolstra
The docstring of
hash_name()is falsely reporting that it returns the component length, whereas it returns a pointer to the terminating '/' or NUL character in the pathname being resolved.Signed-off-by Jori Koolstra <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 28 lines
--- fs/namei.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)fs/namei.c +8
-2@@ -2437,8 +2437,14 @@ u64 hashlen_string(const void *salt, const char *name)EXPORT_SYMBOL (hashlen_string);/* -* Calculate the length and hash of the path component, and -* return the length as the result. +* hash_name - Calculate the length and hash of the path component +* @nd: the path resolution state +* @name: the pathname to read the component from +* @lastword: if the component fits in a single word, LAST_WORD_IS_DOT, +* LAST_WORD_IS_DOTDOT, or some other value depending on whether the +* component is '.', '..', or something else. Otherwise, @lastword is 0. +* +* Returns: a pointer to the terminating '/' or NUL character in @name. */ static inline const char *hash_name(struct nameidata *nd, const char *name,Signature · 1 line
2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR