Skip to content

Commit 8f5be0e

Browse files
koct9igregkh
authored andcommitted
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: 3abb1d9 ("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>
1 parent 7876320 commit 8f5be0e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎include/linux/kernfs.h‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,11 @@ static inline void kernfs_init(void) { }
477477
* @buf: buffer to copy @kn's name into
478478
* @buflen: size of @buf
479479
*
480-
* Builds and returns the full path of @kn in @buf of @buflen bytes. The
481-
* path is built from the end of @buf so the returned pointer usually
482-
* doesn't match @buf. If @buf isn't long enough, @buf is nul terminated
483-
* and %NULL is returned.
480+
* If @kn is NULL result will be "(null)".
481+
*
482+
* Returns the length of the full path. If the full length is equal to or
483+
* greater than @buflen, @buf contains the truncated path with the trailing
484+
* '\0'. On error, -errno is returned.
484485
*/
485486
static inline int kernfs_path(struct kernfs_node *kn, char *buf, size_t buflen)
486487
{

0 commit comments

Comments
 (0)