i_block field

Ganesh Patil patil.ganesh170 at gmail.com
Mon Apr 2 12:20:26 EDT 2012


On Mon, Apr 2, 2012 at 5:59 PM, Pritam Bankar <pritambankar1988 at gmail.com>wrote:

> May I know what is  e4_inode ?
>
> Thanks,
> Pritam
>
> On Mon, Mar 12, 2012 at 6:51 PM, Ganesh Patil <patil.ganesh170 at gmail.com>wrote:
>
>> Hello,
>>
>>       I have printed the i_blocks[EXT4_N_BLOCKS] filed from ext4_inode
>> structure. of my file (a.txt);
>>
>> code:
>>  ret= ext4_get_inode_loc(d_inode1, &iloc);
>>  e4_inode= ext4_raw_inode(&iloc);
>>  for(i=0;i<5;i++)
>>        {
>>             printk(KERN_INFO "%d",e4_inode->i_block[i]);
>>       }
>>
>>   I got the following result.:
>>
>>  127754
>>  4
>>  0
>>  0
>>  1
>>  8705
>>
>>  what is the 127754 (Address of extent or data block)?
>>  what is 8705 &1 ?
>>
>>
>> --
>> Regards,
>> Ganesh Patil.
>>
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> --
>
> Pritam Bankar
>


Above e4_inode field is the pointer of type struct ext4_inode i.e on disk
structure of ext4 inode. i.e

 Struct ext4_inode *e4_inode=ext4_raw_inode(&iloc);

      Sir, but for above question I got answer. because i copied first 12
byte of i_block[..] to ext4_header structure and next 12 bytes in to
ext4_extent.so from that I got actual physical block numbers.

 struct ext4_extent_header *eeh = (struct
ext4_extent_header*)EXT4_I(d_inode1)->i_data;
struct ext4_extent *eex=eex = EXT_FIRST_EXTENT(eeh);
-- 
Regards,
Ganesh Patil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120402/5482e1ce/attachment.html 


More information about the Kernelnewbies mailing list