2007-08-14 13:12:40

by Kalpak Shah

[permalink] [raw]
Subject: Change output format of filefrag

Hi,

I am adding FIEMAP support to filefrag and I noticed that current output
format of filefrag can be improved a lot. It is very difficult to add
information like lun, extent type, etc. to such a format.

$ filefrag -v /tmp/abc

Checking /tmp/abc
Filesystem type is: ef53
Filesystem cylinder groups is approximately 296
File is stored in extents format
Blocksize of file /tmp/abc is 1024
File size of /tmp/abc is 10485760 (10240 blocks)
First block: 4609
Last block: 26068
Discontinuity: Block 512 is at 8556 (was 5120)
Discontinuity: Block 517 is at 15729 (was 8560)
Discontinuity: Block 1173 is at 16633 (was 16384)
Discontinuity: Block 9117 is at 24945 (was 24576)
Discontinuity: Block 9125 is at 24954 (was 24952)
/tmp/abc: 6 extents found

I think an output format similar to that of xfs may be better. This is
easier for parsing as well. Like this:

$ filefrag -e {filename}

ext: logical: phys start..end kB: kB :lun: flags
0: [0..151]: 288444888..288445039: 152 : 0 :
1: [152..199]: XXXXXXXX..YYYYYYYYYY: 47 : 0 : hole
2: [200..299]: MMMMMMMM..NNNNNNNNNN: 100 : 0 : unwritten, unknown

Please suggest if this is ok.

Thanks,
Kalpak.


2007-08-14 13:43:35

by Andreas Dilger

[permalink] [raw]
Subject: Re: Change output format of filefrag

On Aug 14, 2007 18:42 +0530, Kalpak Shah wrote:
> I think an output format similar to that of xfs may be better. This is
> easier for parsing as well. Like this:
>
> $ filefrag -e {filename}
>
> ext: logical: phys start..end kB: kB :lun: flags
> 0: [0..151]: 288444888..288445039: 152 : 0 :
> 1: [152..199]: XXXXXXXX..YYYYYYYYYY: 47 : 0 : hole
> 2: [200..299]: MMMMMMMM..NNNNNNNNNN: 100 : 0 : unwritten, unknown
>
> Please suggest if this is ok.

Yes, but please include the filename in the output as the first line,
filename:
ext: logical: ...


Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

2007-08-14 13:54:17

by Alex Tomas

[permalink] [raw]
Subject: Re: Change output format of filefrag

I'd make sense to dump location of index blocks as well (optional?).

thanks, Alex

Kalpak Shah wrote:
> Hi,
>
> I am adding FIEMAP support to filefrag and I noticed that current output
> format of filefrag can be improved a lot. It is very difficult to add
> information like lun, extent type, etc. to such a format.
>
> $ filefrag -v /tmp/abc
>
> Checking /tmp/abc
> Filesystem type is: ef53
> Filesystem cylinder groups is approximately 296
> File is stored in extents format
> Blocksize of file /tmp/abc is 1024
> File size of /tmp/abc is 10485760 (10240 blocks)
> First block: 4609
> Last block: 26068
> Discontinuity: Block 512 is at 8556 (was 5120)
> Discontinuity: Block 517 is at 15729 (was 8560)
> Discontinuity: Block 1173 is at 16633 (was 16384)
> Discontinuity: Block 9117 is at 24945 (was 24576)
> Discontinuity: Block 9125 is at 24954 (was 24952)
> /tmp/abc: 6 extents found
>
> I think an output format similar to that of xfs may be better. This is
> easier for parsing as well. Like this:
>
> $ filefrag -e {filename}
>
> ext: logical: phys start..end kB: kB :lun: flags
> 0: [0..151]: 288444888..288445039: 152 : 0 :
> 1: [152..199]: XXXXXXXX..YYYYYYYYYY: 47 : 0 : hole
> 2: [200..299]: MMMMMMMM..NNNNNNNNNN: 100 : 0 : unwritten, unknown
>
> Please suggest if this is ok.
>
> Thanks,
> Kalpak.
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html