Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Jan Engelhardt
On Tuesday 2015-11-17 22:20, David Miller wrote: >> +static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ >> +int len = strlen(path); > ... >> +if (len >= PATH_MAX) >> +return NULL; >> + >> +memcpy(path_buf, path, len + 1); > > static char

Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Tejun Heo
On Tue, Nov 17, 2015 at 04:20:40PM -0500, David Miller wrote: > From: Tejun Heo > Date: Tue, 17 Nov 2015 14:40:37 -0500 > > > + static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ > > + int len = strlen(path); > ... > > + if (len >= PATH_MAX) > > + return NULL; > > +

Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread David Miller
From: Tejun Heo Date: Tue, 17 Nov 2015 14:40:37 -0500 > + static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ > + int len = strlen(path); ... > + if (len >= PATH_MAX) > + return NULL; > + > + memcpy(path_buf, path, len + 1); static char

[PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Tejun Heo
Implement kernfs_walk_and_get() which is similar to kernfs_find_and_get() but can walk a path instead of just a name. Signed-off-by: Tejun Heo Cc: Greg Kroah-Hartman --- fs/kernfs/dir.c| 48 include/linux/kernfs.h | 12 2

Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Jan Engelhardt
On Tuesday 2015-11-17 22:20, David Miller wrote: >> +static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ >> +int len = strlen(path); > ... >> +if (len >= PATH_MAX) >> +return NULL; >> + >> +memcpy(path_buf, path, len + 1); > > static char

[PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Tejun Heo
Implement kernfs_walk_and_get() which is similar to kernfs_find_and_get() but can walk a path instead of just a name. Signed-off-by: Tejun Heo Cc: Greg Kroah-Hartman --- fs/kernfs/dir.c| 48

Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Tejun Heo
On Tue, Nov 17, 2015 at 04:20:40PM -0500, David Miller wrote: > From: Tejun Heo > Date: Tue, 17 Nov 2015 14:40:37 -0500 > > > + static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ > > + int len = strlen(path); > ... > > + if (len >= PATH_MAX) > > +

Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread David Miller
From: Tejun Heo Date: Tue, 17 Nov 2015 14:40:37 -0500 > + static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ > + int len = strlen(path); ... > + if (len >= PATH_MAX) > + return NULL; > + > + memcpy(path_buf, path, len + 1);