LWN.net Logo

Traditional interface is zero-filling

Traditional interface is zero-filling

Posted Nov 29, 2010 1:04 UTC (Mon) by nybble41 (subscriber, #55106)
In reply to: Traditional interface is zero-filling by kolk
Parent article: Punching holes in files

Sometimes you can't use sparse files. For example, swap files need to have all blocks allocated, even if those blocks happen to contain only zeroes. Also, a program may wish to fully allocate a file to ensure that later writes will be able to succeed without running out of disk space, which could happen if sparse blocks were overwritten with non-zero data.

So a separate interface is required after all.


(Log in to post comments)

Traditional interface is zero-filling

Posted Nov 29, 2010 12:17 UTC (Mon) by mfedyk (guest, #55303) [Link]

maybe you can write ones instead if you don't want the blocks deallocated

Traditional interface is zero-filling

Posted Dec 29, 2010 15:33 UTC (Wed) by yoe (subscriber, #25743) [Link]

That would be a horrible, horrible hack.

Traditional interface is zero-filling

Posted Jan 20, 2011 2:22 UTC (Thu) by jzbiciak (✭ supporter ✭, #5246) [Link]

And here's hoping you never swap a page full of zeros by accident...

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds