kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* How to get the inode - no path_lookup
@ 2012-08-07 14:41 Rishi Agrawal
  2012-08-08  7:16 ` Rohan Puri
  0 siblings, 1 reply; 9+ messages in thread
From: Rishi Agrawal @ 2012-08-07 14:41 UTC (permalink / raw)
  To: kernelnewbies

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120807/2c863831/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-09-17  8:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 14:41 How to get the inode - no path_lookup Rishi Agrawal
2012-08-08  7:16 ` Rohan Puri
2012-08-09  3:15   ` Rishi Agrawal
2012-08-09  7:09     ` Rohan Puri
2012-08-13  8:47       ` Rishi Agrawal
2012-08-13  9:34         ` Rohan Puri
2015-09-04 16:26           ` priyamn
2015-09-16 22:31             ` Greg KH
2015-09-17  8:10               ` Rohan Puri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).