LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-20-2015, 06:29 AM   #1
Kullu
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, 07:01 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
You are free to add anything you want to your copy of the kernel.
 
1 members found this post helpful.
Old 10-21-2015, 10:01 AM   #3
gdejonge
Member
 
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.

Cheers.
 
1 members found this post helpful.
Old 10-28-2015, 03:10 AM   #4
Kullu
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...
 
  


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


All times are GMT -5. The time now is 02:15 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration