<br><br><div class="gmail_quote">On Mon, Jun 15, 2009 at 8:34 PM, Eric Sandeen <span dir="ltr"><<a href="mailto:sandeen@sandeen.net">sandeen@sandeen.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Smit Shah wrote:<br>
> Hi,<br>
><br>
> I wanted to preallocate the file using the ALLOCSP so that the preallocated<br>
> space is zeroed out. Hence i used the xfsctl but the problem is that i<br>
> cannot execute it as a non-root user. So i tried using fallocate but when<br>
> i saw the xfs implementation of kernel it uses the RESVP cmd and since the<br>
> unwritten flag is set i am assuming that the performance of writing to the<br>
> preallocated space will suffer because of the metadata updates. So is there<br>
> a way to preallocate using ALLOCSP as a non-root user or else i would be<br>
> required to modify the kernel ??<br>
><br>
> TIA,<br>
> Smit<br>
<br>
ALLOCSP simply writes 0s to a file.... you may as well do it using posix<br>
calls, as a normal user, I think.<br>
<font color="#888888"></font></blockquote><div><br></div><div>Even the man page of fallocate says that it allocates and initializes to zero the disk space allocated but when i saw the code i did found out that it does not zero it out. Hence was a kindof confused. So posix_allocate is similar to ALLOCSP when falloc is not supported by the underlying filesystem that is to ftruncate the file and zero it out. So all of them try to allocate contiguous blocks but the only difference is when we use the fallocate in ext4/xfs it does not zero out the preallocated space. Am i right ? </div>
<div>But when i fallocate in ext4 i can see the write performance improvement but not in xfs and reason i found out in one of your previous comments is because of the unwritten flag set in xfs. So how do we see if the unwritten flag is set or not ? I did use xfs_info but it didnt show any such information. </div>
<div><br></div><div>Thanks, </div><div>Smit </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888"><br>
-Eric<br>
</font></blockquote></div><br>