xfs
[Top] [All Lists]

Re: howto preallocate to minimize fragmentation

To: Ying-Hung Chen <ying@xxxxxxxxxxxxxx>
Subject: Re: howto preallocate to minimize fragmentation
From: Eric Sandeen <sandeen@xxxxxxx>
Date: Fri, 23 Sep 2005 07:58:09 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <4333A130.7040709@yingternet.com>
References: <43329839.2070005@yingternet.com> <4332A22B.6070708@sgi.com> <4332BFCC.8050803@yingternet.com> <4332C248.70503@sgi.com> <4332C636.9070509@yingternet.com> <4332CE65.2000500@animezone.org> <4332CF04.2060604@yingternet.com> <4332D17E.6060608@sgi.com> <4333A130.7040709@yingternet.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716)
Ying-Hung Chen wrote:
when I run the sample code, and created "testfile"

[yhchen@fc3 ~]$ ./xfs_fcntl testfile
[yhchen@fc3 ~]$ ls -l testfile
-rwx------  1 yhchen yhchen 0 Sep 23 14:17 testfile
[yhchen@fc3 ~]$ du testfile
20480   testfile
[yhchen@fc3 ~]$ du -h testfile
20M     testfile

I see the filesize is 0, but du does show 20MB

However, when I try to determine the file size via fseek, it returns 0.

so, what does this kind of allocation mean? does it really mean that it

run xfs_bmap on the resulting file and you'll see...

so, if I write anything within this 20MB
range, it will be writing to the allocated space and hence no
fragmentation?

right.

what happens if I go over? my guess is if i go over, xfs
allocation algorithm will be and there will be fragamentation?

well it depends on what else is going on; if there is plenty of free space after that 20M, then no. but if you have parallel streams writing, then fragmentation past the amount of space you allocated is likely.


-Eric


<Prev in Thread] Current Thread [Next in Thread>