How to read data in kernel that was written to metadata structure during mkfs of FS
I am adding a flag during mkfs time through which the user can enter a number between 1-8 depicting how many BG required for an abstraction. I am storing that value in ext2_super_block metadata structure (say __u16 s_new_field)
Now, how do I read that value in kernel code?
I looked into fs/ext3/super.c file and in the method ext3_fill_super the code refers to super_block structure but I am not sure how is it reading the data we saved during mkfs time. I tried replicating the structure but it shows zero value when I do dmesg and not the value I entered during mkfs. Any suggestions?
**Solution is to look closely in super.c file in fs/ext3/super.c and you will find the solution. I tried so many times and was not getting an answer and so posted this question but I have figured out that closely looking at the code and running few tests will really help you.
Last edited by yashgovin19; 06-24-2015 at 07:55 PM.
Reason: Got the answer
|