LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-21-2010, 04:45 AM   #1
Pratik dhamdhere
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Rep: Reputation: 0
how to access Inode structure of file


can i access the Inode structure?
want to know how to access process table?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-22-2010, 12:01 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
https://www.redhat.com/mirrors/LDP/L...s/vfstour.html
and
http://webcache.googleusercontent.co...&ct=clnk&gl=in
 
Old 10-22-2010, 12:47 AM   #3
tthtlc
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Rep: Reputation: 2
Smile

"Process Table".....what do u mean and from userspace or kernel?

From userspace, just "cd /proc/" and all those numbers are belonging to each process. From kernel, u can enumerate by walking through the PID hash table. Check kernel/pid.c, for example this line:

hlist_for_each_entry_rcu(pnr, elem,
&pid_hash[pid_hashfn(nr, ns)], pid_chain)


For inode, what u mean by "access inode structure"? if u want to know the structure, it is in the header file. If u want to know where are all the blocks stored for EACH inode (one INODE One FILE) u can use "ils" from sleuthkit (apt-get install sleuthkit or tct).

If u want to do do in the kernel....it depends on what information needed.....but it will very filesystem-specific....so which FS is that?
 
2 members found this post helpful.
Old 11-18-2010, 11:50 PM   #4
swap_chau
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Rep: Reputation: 1
If you want to access inode for some particular file you can modify the code in read_write.c in kernelSrc/fs/. You can modify vfs_read function and retrieve inode using file->f_dentry->d_inode. It is the pointer to structure containing inode.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
To lock inode structure saranraj Linux - Newbie 1 03-02-2010 11:04 PM
given a file, how to find last access time using the inode structrure linuxdoniv Programming 1 07-16-2008 06:33 AM
How to access inode of a deleted file? ashwyn222 Linux - Newbie 3 02-13-2008 04:36 AM
Inode file_lock structure sid18 Linux - Kernel 0 09-09-2007 12:13 AM
access file using inode number? allasso Linux - General 1 09-26-2006 09:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration