Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331307 > unrolled thread
| Started by | Christian Brauner <christian.brauner@mailbox.org> |
|---|---|
| First post | 2016-02-10 17:30 +0100 |
| Last post | 2016-02-10 18:30 +0100 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] let kernfs_name_locked & kernfs_name return size_t Christian Brauner <christian.brauner@mailbox.org> - 2016-02-10 17:30 +0100
Re: [PATCH] let kernfs_name_locked & kernfs_name return size_t Tejun Heo <tj@kernel.org> - 2016-02-10 17:30 +0100
[PATCH] let kernfs_name_locked & kernfs_name return size_t Christian Brauner <christian.brauner@mailbox.org> - 2016-02-10 17:30 +0100
Re: [PATCH] let kernfs_name_locked & kernfs_name return size_t Greg KH <gregkh@linuxfoundation.org> - 2016-02-10 18:00 +0100
Re: [PATCH] let kernfs_name_locked & kernfs_name return size_t Christian Brauner <christian.brauner@mailbox.org> - 2016-02-10 18:30 +0100
| From | Christian Brauner <christian.brauner@mailbox.org> |
|---|---|
| Date | 2016-02-10 17:30 +0100 |
| Subject | [PATCH] let kernfs_name_locked & kernfs_name return size_t |
| Message-ID | <r0FOr-4zg-17@gated-at.bofh.it> |
Simple patch that changes the return value of kernfs_name_locked and kernfs_name to size_t which alignes these functions with kernfs_path_len which also returns size_t. Patch was made against for-4.5 branch. (As per Tejun's request, ccing gregkh@linuxfoundation.org and linux-kernel@vger.kernel.org.) Christian Brauner (1): let kernfs_name_locked & kernfs_name return size_t fs/kernfs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0
[toc] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-10 17:30 +0100 |
| Message-ID | <r0FOs-4zg-35@gated-at.bofh.it> |
| In reply to | #1331307 |
On Wed, Feb 10, 2016 at 05:18:59PM +0100, Christian Brauner wrote: > They return the length of kn->parent or kn->name and should be aligned with > kernfs_path_len which also returns size_t. > > Signed-off-by: Christian Brauner <christian.brauner@mailbox.org> Acked-by: Tejun Heo <tj@kernel.org> Thanks. -- tejun
[toc] | [prev] | [next] | [standalone]
| From | Christian Brauner <christian.brauner@mailbox.org> |
|---|---|
| Date | 2016-02-10 17:30 +0100 |
| Message-ID | <r0FOs-4zg-37@gated-at.bofh.it> |
| In reply to | #1331307 |
They return the length of kn->parent or kn->name and should be aligned with
kernfs_path_len which also returns size_t.
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
---
fs/kernfs/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 742bf4a..a3553b8 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -39,7 +39,7 @@ static bool kernfs_lockdep(struct kernfs_node *kn)
#endif
}
-static int kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)
+static size_t kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)
{
return strlcpy(buf, kn->parent ? kn->name : "/", buflen);
}
@@ -80,7 +80,7 @@ static char * __must_check kernfs_path_locked(struct kernfs_node *kn, char *buf,
*
* This function can be called from any context.
*/
-int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
+size_t kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
{
unsigned long flags;
int ret;
--
2.7.0
[toc] | [prev] | [next] | [standalone]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-10 18:00 +0100 |
| Message-ID | <r0Ght-4Nm-43@gated-at.bofh.it> |
| In reply to | #1331315 |
On Wed, Feb 10, 2016 at 05:18:59PM +0100, Christian Brauner wrote:
> They return the length of kn->parent or kn->name and should be aligned with
> kernfs_path_len which also returns size_t.
>
> Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
> ---
> fs/kernfs/dir.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
> index 742bf4a..a3553b8 100644
> --- a/fs/kernfs/dir.c
> +++ b/fs/kernfs/dir.c
> @@ -39,7 +39,7 @@ static bool kernfs_lockdep(struct kernfs_node *kn)
> #endif
> }
>
> -static int kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)
> +static size_t kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)
> {
> return strlcpy(buf, kn->parent ? kn->name : "/", buflen);
> }
> @@ -80,7 +80,7 @@ static char * __must_check kernfs_path_locked(struct kernfs_node *kn, char *buf,
> *
> * This function can be called from any context.
> */
> -int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
> +size_t kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
> {
> unsigned long flags;
> int ret;
Now if only you had test built this patch :(
Please be more careful, it just makes maintainers grumpy and annoyed
when you do that...
[toc] | [prev] | [next] | [standalone]
| From | Christian Brauner <christian.brauner@mailbox.org> |
|---|---|
| Date | 2016-02-10 18:30 +0100 |
| Message-ID | <r0GKv-5hG-19@gated-at.bofh.it> |
| In reply to | #1331337 |
On Wed, Feb 10, 2016 at 08:53:14AM -0800, Greg KH wrote:
> On Wed, Feb 10, 2016 at 05:18:59PM +0100, Christian Brauner wrote:
> > They return the length of kn->parent or kn->name and should be aligned with
> > kernfs_path_len which also returns size_t.
> >
> > Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
> > ---
> > fs/kernfs/dir.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
> > index 742bf4a..a3553b8 100644
> > --- a/fs/kernfs/dir.c
> > +++ b/fs/kernfs/dir.c
> > @@ -39,7 +39,7 @@ static bool kernfs_lockdep(struct kernfs_node *kn)
> > #endif
> > }
> >
> > -static int kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)
> > +static size_t kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)
> > {
> > return strlcpy(buf, kn->parent ? kn->name : "/", buflen);
> > }
> > @@ -80,7 +80,7 @@ static char * __must_check kernfs_path_locked(struct kernfs_node *kn, char *buf,
> > *
> > * This function can be called from any context.
> > */
> > -int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
> > +size_t kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
> > {
> > unsigned long flags;
> > int ret;
>
> Now if only you had test built this patch :(
I actually did but forgot to commit the changes to include/linux/kernfs.h as
well.
>
> Please be more careful, it just makes maintainers grumpy and annoyed
> when you do that...
Yes, sorry. I will do that. I'll resend with the appropriate changes
to kernfs.h included. Thanks for being patient.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web