On Mon, Sep 7, 2015 at 1:11 PM, Pria Mn <pria.mn9@xxxxxxxxx> wrote:
Hi Rohan,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 :#if(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
err= kern_path_parent(tmp,nd);
#else
err= path_lookup(tmp, 0, nd);
#endif
Now that "nameidata" structure is not exposed with kernel version >= 3.6.0I used kern_path_create() which is returning invalid dentry value.dentry =kern_path_create(AT_FDCWD, tmp, path, 1);
So, I tried using : user_path_at() , kern_path() which are not helping me.
How to fetch 'dentry' data from file name ?
On Mon, Sep 7, 2015 at 12:45 PM, Rohan Puri <rohan.puri15@xxxxxxxxx> wrote:On Mon, Sep 7, 2015 at 12:10 PM, Pria Mn <pria.mn9@xxxxxxxxx> wrote:_______________________________________________Hi,
I happened to come across the below discussion.
http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-August/005914.html
I am having a similar issue.
I am using Rhel7-3.10.0-123
kernel. I tried all the options that are mentioned above and none of the api's
including kern_path()
return valid dentry value. My requirement is to fetch directory name from filepath.
Can anybody suggest a work-around for this ?
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi Pria,This is in regards with which kernel version? also what are you trying to do, please be more detailed.Enjoy life,Rohan
Hi Pria,
Yes, just checked nameidata is moved to fs/internal.h file, I think you can make use of kern_path() here.
NOTE: Also please post reply at the bottom.
Enjoy life,
Rohan
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies