diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2018-08-13 02:52:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-16 16:37:16 -0400 |
commit | 8f5be0ec23bb9ef3f96659c8dff1340b876600bf (patch) | |
tree | 036a4acdeefe02bd358a83ea6f3168ee67c97d9f | |
parent | 7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff) |
kernfs: update comment about kernfs_path() return value
Now it returns the length of the full path or error code.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 3abb1d90f5d9 ("kernfs: make kernfs_path*() behave in the style of strlcpy()")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/linux/kernfs.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 814643f7ee52..5b36b1287a5a 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
@@ -477,10 +477,11 @@ static inline void kernfs_init(void) { } | |||
477 | * @buf: buffer to copy @kn's name into | 477 | * @buf: buffer to copy @kn's name into |
478 | * @buflen: size of @buf | 478 | * @buflen: size of @buf |
479 | * | 479 | * |
480 | * Builds and returns the full path of @kn in @buf of @buflen bytes. The | 480 | * If @kn is NULL result will be "(null)". |
481 | * path is built from the end of @buf so the returned pointer usually | 481 | * |
482 | * doesn't match @buf. If @buf isn't long enough, @buf is nul terminated | 482 | * Returns the length of the full path. If the full length is equal to or |
483 | * and %NULL is returned. | 483 | * greater than @buflen, @buf contains the truncated path with the trailing |
484 | * '\0'. On error, -errno is returned. | ||
484 | */ | 485 | */ |
485 | static inline int kernfs_path(struct kernfs_node *kn, char *buf, size_t buflen) | 486 | static inline int kernfs_path(struct kernfs_node *kn, char *buf, size_t buflen) |
486 | { | 487 | { |