[Ocfs2-tools-devel] [PATCH 13/19] Ocfs2-tools: Add running codes for '--file-statistics' in operation.c

tristan tristan.ye at oracle.com
Mon Apr 19 04:33:51 PDT 2010


Wengang Wang wrote:
> Hi,
>
> On 10-04-19 15:19, tristan wrote:
>   
>> Sunil Mushran wrote:
>>     
>>> How is this different from the stat tool?
>>>
>>> We want this tool to provide info that may not be available
>>> to non privileged users.
>>>       
>> Sunil,
>>
>> It's an extension of standard 'stat' tool, following is the difference 
>> between 'stat' and 'o2info --file-statstics':
>>
>> [oracle at ocfs2-test4 ~]$ stat /storage/testfile
>> File: `/storage/testfile'
>> Size: 0 Blocks: 0 IO Block: 32768 regular empty file
>> Device: 808h/2056d Inode: 17962 Links: 1
>> Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
>> Access: 2010-04-19 14:56:32.822439918 +0800
>> Modify: 2010-04-19 14:56:32.822439918 +0800
>> Change: 2010-04-19 14:56:32.822439918 +0800
>>
>>
>> [oracle at ocfs2-test4 ~]$ o2info --file-statistics /storage/testfile
>> File: /storage/testfile
>> Size: 0 Blocks: 0 IO Block: 4096 regular empty file
>> Device: 808h/2056d Inode: 17962 Links: 1
>> Frag%: 0.00 Clusters: 0 Extents: 0 Score: 0
>>     
>
> "Frag%" means the fragmentation in percentage? --looks odd to me :)
>   
Hi wengang,

frag = 100 * (e / c);


Here 'e' is the number of all extents in a volume, while 'c' is all 
clusters of volume,

it's no more accurate than a ratio of 'extents / clusters';) and it's 
quite rough.

The operation 'freefrag' of o2info will make much more sense on this point!


Tristan.

> regards,
> wengang.
>   




More information about the Ocfs2-tools-devel mailing list