<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 &#39;dentry&#39; value from file path information. For this: earlier I had written the code as below :<div><br></div><div>







<p class="">#if(LINUX_VERSION_CODE &gt;= KERNEL_VERSION(<span class="">2</span>,<span class="">6</span>,<span class="">39</span>))</p><p class=""><span class="">        </span><span class="">        </span>err= kern_path_parent(tmp,nd);</p><p class="">#else</p><p class=""><span class="">        </span><span class="">        </span>err= path_lookup(tmp, <span class="">0</span>, nd);</p><p class="">











</p><p class="">#endif</p><div><div>Now that &quot;nameidata&quot; structure is not exposed with kernel version &gt;= 3.6.0</div></div></div><div>I used kern_path_create() which is returning invalid dentry value.</div><div>
<p class=""><span class="">        </span><span class="">        </span>dentry =kern_path_create(AT_FDCWD, tmp, path, <span class="">1</span>);</p><p class="">So, I tried using : user_path_at() , kern_path() which are not helping me.</p>







<p class="">How to fetch &#39;dentry&#39; data from file name ? </p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 7, 2015 at 12:45 PM, Rohan Puri <span dir="ltr">&lt;<a href="mailto:rohan.puri15@gmail.com" target="_blank">rohan.puri15@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Sep 7, 2015 at 12:10 PM, Pria Mn <span dir="ltr">&lt;<a href="mailto:pria.mn9@gmail.com" target="_blank">pria.mn9@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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&#39;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>