<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 7, 2015 at 1:11 PM, Pria Mn <span dir="ltr"><<a href="mailto:pria.mn9@gmail.com" target="_blank">pria.mn9@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hi Rohan,</div><div><br></div>I am using 3.10.0-123.el7.x86_64 kernel (RHEL-7). I am trying to obtain 'dentry' value from file path information. For this: earlier I had written the code as below :<div><br></div><div>
<p>#if(LINUX_VERSION_CODE >= KERNEL_VERSION(<span>2</span>,<span>6</span>,<span>39</span>))</p><p><span>        </span><span>        </span>err= kern_path_parent(tmp,nd);</p><p>#else</p><p><span>        </span><span>        </span>err= path_lookup(tmp, <span>0</span>, nd);</p><p>
</p><p>#endif</p><div><div>Now that "nameidata" structure is not exposed with kernel version >= 3.6.0</div></div></div><div>I used kern_path_create() which is returning invalid dentry value.</div><div>
<p><span>        </span><span>        </span>dentry =kern_path_create(AT_FDCWD, tmp, path, <span>1</span>);</p><p>So, I tried using : user_path_at() , kern_path() which are not helping me.</p>
<p>How to fetch 'dentry' data from file name ? </p></div></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 7, 2015 at 12:45 PM, Rohan Puri <span dir="ltr"><<a href="mailto:rohan.puri15@gmail.com" target="_blank">rohan.puri15@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Sep 7, 2015 at 12:10 PM, Pria Mn <span dir="ltr"><<a href="mailto:pria.mn9@gmail.com" target="_blank">pria.mn9@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr"><div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I happened to come across the below discussion.</p><p class="MsoNormal"><br></p><p class="MsoNormal"><a href="http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-August/005914.html" target="_blank">http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-August/005914.html</a><br></p><p class="MsoNormal"><br></p><p class="MsoNormal">I am having a
similar issue. </p>
<p class="MsoNormal">I am using Rhel7-3.10.0-123 </p>
<p class="MsoNormal">kernel. I tried all the options that are mentioned above and
none of the api's </p>
<p class="MsoNormal">including kern_path() </p>
<p class="MsoNormal">return valid dentry value. My requirement is to fetch
directory name from filepath.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Can anybody suggest a work-around for this ?</p>
</div><div><br></div><br></div>
<br></div></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div><div class="gmail_extra">Hi Pria,</div><div class="gmail_extra"><br></div><div class="gmail_extra">This is in regards with which kernel version? also what are you trying to do, please be more detailed.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Enjoy life,</div><div class="gmail_extra">Rohan</div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div><div class="gmail_extra">Hi Pria,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Yes, just checked nameidata is moved to fs/internal.h file, I think you can make use of <a href="http://lxr.free-electrons.com/ident?v=2.6.34;i=kern_path" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:0.95em;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">kern_path</a>() here.</div><div class="gmail_extra"><br></div><div class="gmail_extra">NOTE: Also please post reply at the bottom.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Enjoy life,</div><div class="gmail_extra">Rohan</div></div>