* [PATCH] kernfs: update comment about kernfs_path() return value
@ 2018-08-13 6:52 Konstantin Khlebnikov
2018-08-13 13:49 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2018-08-13 6:52 UTC (permalink / raw)
To: Tejun Heo, Greg Kroah-Hartman, linux-kernel
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()")
---
include/linux/kernfs.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index ab25c8b6d9e3..0174ec25950e 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -472,10 +472,11 @@ static inline void kernfs_init(void) { }
* @buf: buffer to copy @kn's name into
* @buflen: size of @buf
*
- * Builds and returns the full path of @kn in @buf of @buflen bytes. The
- * path is built from the end of @buf so the returned pointer usually
- * doesn't match @buf. If @buf isn't long enough, @buf is nul terminated
- * and %NULL is returned.
+ * If @kn is NULL result will be "(null)".
+ *
+ * Returns the length of the full path. If the full length is equal to or
+ * greater than @buflen, @buf contains the truncated path with the trailing
+ * '\0'. On error, -errno is returned.
*/
static inline int kernfs_path(struct kernfs_node *kn, char *buf, size_t buflen)
{
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] kernfs: update comment about kernfs_path() return value
2018-08-13 6:52 [PATCH] kernfs: update comment about kernfs_path() return value Konstantin Khlebnikov
@ 2018-08-13 13:49 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2018-08-13 13:49 UTC (permalink / raw)
To: Konstantin Khlebnikov; +Cc: Greg Kroah-Hartman, linux-kernel
On Mon, Aug 13, 2018 at 09:52:09AM +0300, Konstantin Khlebnikov wrote:
> 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>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-13 13:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-13 6:52 [PATCH] kernfs: update comment about kernfs_path() return value Konstantin Khlebnikov
2018-08-13 13:49 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome