Re: To display indirect block numbers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 1, 2011 at 12:18 PM, kashish bhatia <koolest77@xxxxxxxxx> wrote:
> Hi all ,
>
> If I want to display block numbers of a file.
> For instance file size is 64KB and block size is 4KB. So the data will
> accommodate in 16 blocks.
>
> Now I accessed an array named "i_block[ ]" present in ext2_inode structure.
> This array stores the
> block numbers of a file.
>
> The first 12 blocks are direct blocks which will store 48KB data of file and
> the 13th block will be single indirect block which will store the rest of
> the data.
>
> In this way I can directly get the data of 48KB by referring first 12 direct
> blocks.
>
> My question is how can I access this 13th block to  get the remaining block
> numbers which will directly point to rest of the data.

In kernel or userspace ?

In userspace use debugfs. In kernel see the function ext3_block_to_path

-- 
Thanks -
Manish

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux