- Subject: How to get the inode - no path_lookup
- From: Rishi Agrawal <rishi.b.agrawal@xxxxxxxxx>
- Date: Tue, 7 Aug 2012 20:11:45 +0530
Hi All,
I had a module which used the path_lookup function to print the details of any file's inode. I now want to rewrite that module in order to show some juniors how to write some code in kernel.
I am using 3.4.6 kernel, I tried finding out path_lookup but google showed that it has been removed.
I tried the following code then which did not work
.
.
.
dentry = kern_path_create(AT_FDCWD, filename, &path, 1);
if (IS_ERR(dentry)) {
printk("Failed to obtain the dentry");
return;
}
its not returning dentry
I again tried after seeing the implementation of vfs_stat function
user_path_at(AT_FDCWD, filename, lookup_flags, &path);
but this also fails.
I am using a proc interface to pass the filename, and copying the filename into a kernel buffer.
How can I get a copy of vfs inode for a file name.
--
Regards,
Rishi Agrawal
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
[Newbies FAQ]
[Linux Kernel Mentors]
[Linux Kernel Development]
[IETF Annouce]
[Git]
[Networking]
[Security]
[Bugtraq]
[Photo]
[Yosemite]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux Networking]
[Linux RAID]
[Linux SCSI]
[Linux ACPI]