Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-20-2015, 05:29 AM   #1
LQ Newbie
Registered: Oct 2015
Posts: 3

Rep: Reputation: Disabled
Kernel data structure modification

I am new to linux kernel development
I want to add one field to struct inode. My question is how can I add a field to it
Old 10-21-2015, 06:01 AM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,798

Rep: Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749
You are free to add anything you want to your copy of the kernel.
1 members found this post helpful.
Old 10-21-2015, 09:01 AM   #3
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
That's simple.
1. Download the kernel source files.
2. Locate the place where the inode struct is defined.
3. Add your new field.
4. Recompile your kernel.

Of course this probably will break half of your programs and will be guaranteed to corrupt your file system, but hey, it's open source and you are free to do with it whatever you want.

Sorry, could resist.

Problem with your question is that it's to vague to give a clear answer.
For example. You don't tell us what file-system you're thinking of.
Also you don't tell us why you wan't to add this field. If you would explain the reason for it, maybe someone could direct you to an alternative that is more in line with what you want to do.

If you are serious about going into kernel development you should visit the kernelnewbies site.

1 members found this post helpful.
Old 10-28-2015, 02:10 AM   #4
LQ Newbie
Registered: Oct 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
I want to calculate no of pages used per inode, that is why I want to include that field into inode structure so that in /proc file I can traverse through all inodes and print no of pages per inode in /proc file...


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
[SOLVED] How to read data in kernel that was written to metadata structure during mkfs of FS yashgovin19 Linux - Newbie 2 06-25-2015 11:38 AM
C programming (data modification) MiniComa Programming 0 07-08-2012 04:01 PM
Best Data Structure to store data in C meenakshi.khurana Programming 7 10-18-2011 08:54 PM
c++ data structure libraries kpachopoulos Programming 2 01-16-2007 04:22 PM
C & kernel data structure & shell script vishalbutte Programming 7 01-13-2006 08:38 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:11 AM.

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