Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-23 Thread Greg KH
On Wed, Dec 23, 2015 at 11:24:33AM -0500, Tejun Heo wrote: > On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hal...@ubuntu.com wrote: > > From: Aditya Kali > > > > The new function kernfs_path_from_node() generates and returns kernfs > > path of a given kernfs_node relative to a given parent kern

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-23 Thread Serge E. Hallyn
On Wed, Dec 23, 2015 at 11:08:54AM -0500, Tejun Heo wrote: > Hello, Serge. > > On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hal...@ubuntu.com wrote: > > @@ -164,18 +286,39 @@ void pr_cont_kernfs_name(struct kernfs_node *kn) > > void pr_cont_kernfs_path(struct kernfs_node *kn) > > { > > un

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-23 Thread Tejun Heo
On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hal...@ubuntu.com wrote: > From: Aditya Kali > > The new function kernfs_path_from_node() generates and returns kernfs > path of a given kernfs_node relative to a given parent kernfs_node. > > Signed-off-by: Aditya Kali > Signed-off-by: Serge E. H

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-23 Thread Tejun Heo
Hello, Serge. On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hal...@ubuntu.com wrote: > @@ -164,18 +286,39 @@ void pr_cont_kernfs_name(struct kernfs_node *kn) > void pr_cont_kernfs_path(struct kernfs_node *kn) > { > unsigned long flags; > - char *p; > + char *p = NULL; > + int

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-09 Thread Serge E. Hallyn
On Wed, Dec 09, 2015 at 05:36:51PM -0500, Tejun Heo wrote: > Hey, > > On Wed, Dec 09, 2015 at 10:13:27PM +, Serge Hallyn wrote: > > we can rename kn_root to from here if you think that's clearer (and > > change the order here as well). > > I think it'd be better for them to be consistent and

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-09 Thread Serge E. Hallyn
On Wed, Dec 09, 2015 at 05:36:51PM -0500, Tejun Heo wrote: > Hey, > > On Wed, Dec 09, 2015 at 10:13:27PM +, Serge Hallyn wrote: > > we can rename kn_root to from here if you think that's clearer (and > > change the order here as well). > > I think it'd be better for them to be consistent and

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-09 Thread Tejun Heo
Hey, On Wed, Dec 09, 2015 at 10:13:27PM +, Serge Hallyn wrote: > we can rename kn_root to from here if you think that's clearer (and > change the order here as well). I think it'd be better for them to be consistent and in the same order - the target and then the optional base. > > Was conve

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-09 Thread Serge Hallyn
Quoting Tejun Heo (t...@kernel.org): > Hello, Serge. > > On Wed, Dec 09, 2015 at 01:28:54PM -0600, serge.hal...@ubuntu.com wrote: > > +/* kernfs_node_depth - compute depth from @from to @to */ > > +static size_t kernfs_depth(struct kernfs_node *from, struct kernfs_node > > *to) > ... > > +char *k

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-12-09 Thread Tejun Heo
Hello, Serge. On Wed, Dec 09, 2015 at 01:28:54PM -0600, serge.hal...@ubuntu.com wrote: > +/* kernfs_node_depth - compute depth from @from to @to */ > +static size_t kernfs_depth(struct kernfs_node *from, struct kernfs_node *to) ... > +char *kernfs_path(struct kernfs_node *kn, char *buf, size_t buf

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-30 Thread Serge E. Hallyn
On Mon, Nov 30, 2015 at 05:53:18PM -0500, Tejun Heo wrote: > Hello, Serge. > > On Mon, Nov 30, 2015 at 12:37:58PM -0600, Serge E. Hallyn wrote: > > > Yeah, I agree but the name is kinda misleading tho. The output isn't > > > really a relative path but rather absolute path against the specified >

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-30 Thread Tejun Heo
Hello, Serge. On Mon, Nov 30, 2015 at 12:37:58PM -0600, Serge E. Hallyn wrote: > > Yeah, I agree but the name is kinda misleading tho. The output isn't > > really a relative path but rather absolute path against the specified > > root. Maybe updating the function and parameter names would be > >

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-30 Thread Serge E. Hallyn
On Mon, Nov 30, 2015 at 10:11:47AM -0500, Tejun Heo wrote: > Hello, > > On Thu, Nov 26, 2015 at 11:25:11PM -0600, Serge E. Hallyn wrote: > > > > + /* Short-circuit the easy case - kn_to is the root node. */ > > > > + if ((kn_from == kn_to) || (!kn_from && !kn_to->parent)) { > > > > +

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-30 Thread Tejun Heo
Hello, On Thu, Nov 26, 2015 at 11:25:11PM -0600, Serge E. Hallyn wrote: > > > + /* Short-circuit the easy case - kn_to is the root node. */ > > > + if ((kn_from == kn_to) || (!kn_from && !kn_to->parent)) { > > > + *p = '/'; > > > + *(p + 1) = '\0'; > > > > Hmm... so if kn_from ==

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-26 Thread Serge E. Hallyn
On Tue, Nov 24, 2015 at 11:16:30AM -0500, Tejun Heo wrote: > Hello, > > On Mon, Nov 16, 2015 at 01:51:38PM -0600, se...@hallyn.com wrote: > > +static char * __must_check kernfs_path_from_node_locked( (Note I've rewritten this to find a common ancestor and walk back to and from that, as you sugges

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-24 Thread Serge E. Hallyn
On Tue, Nov 24, 2015 at 11:17:09AM -0500, Tejun Heo wrote: > Oops, also please cc Greg Kroah-Hartman > on kernfs changes. Will do. Thank you for all the feedback. I'll send out a new set when I get it all addressed. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in t

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-24 Thread Tejun Heo
Oops, also please cc Greg Kroah-Hartman on kernfs changes. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at

Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

2015-11-24 Thread Tejun Heo
Hello, On Mon, Nov 16, 2015 at 01:51:38PM -0600, se...@hallyn.com wrote: > +static char * __must_check kernfs_path_from_node_locked( > + struct kernfs_node *kn_from, > + struct kernfs_node *kn_to, > + char *buf, > + size_t buflen) > +{ > + char *p = buf; > + struct kernfs_n