<p dir="ltr"><br>
On 17 Sep 2015 04:02, "Greg KH" <<a href="mailto:greg@kroah.com">greg@kroah.com</a>> wrote:<br>
><br>
> On Fri, Sep 04, 2015 at 04:26:06PM +0000, priyamn wrote:<br>
> ><br>
> > Hi,<br>
> ><br>
> > I happened to come across this discussion. I am having a similar issue.<br>
> > I am using Rhel7-3.10.0-123<br>
> > kernel. I tried all the options that are mentioned above and none of the api's<br>
> > including kern_path() return valid dentry value.<br>
> > My requirement is to fetch directory name from filepath.<br>
><br>
> Why do you need a directory name from a filepath within the kernel?<br>
> What problem are you trying to solve that you feel a directory name is<br>
> the correct solution?<br>
><br>
> And remember, namespaces, what does a "directory name" really mean... :)<br>
><br>
> thanks,<br>
><br>
> greg k-h<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
><a href="mailto:Kernelnewbies@kernelnewbies.org"> Kernelnewbies@kernelnewbies.org</a><br>
><a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies"> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a></p>
<p dir="ltr">Hi Priya,</p>
<p dir="ltr">Please make use of a single thread for one topic. There was another thread by you on the same topic. Anyways, I am replying to this one.</p>
<p dir="ltr">Greg has asked questions that you should ask yourself before going on with choosing one approach.</p>
<p dir="ltr">I had suggested you using kern_path() earlier, since it doesn't makes use of nameidata, but as you are telling its not working too. Here I would like to know the actual context of the approach so as to figure out if something I know that can work for you or maybe you shouldn't be doing it that way.</p>
<p dir="ltr">Enjoy life,<br>
Rohan</p>