linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [f]truncate64 and user space sparse file handling
@ 2015-11-30 12:26 Elmar Stellnberger
  0 siblings, 0 replies; only message in thread
From: Elmar Stellnberger @ 2015-11-30 12:26 UTC (permalink / raw)
  To: linux-kernel

a.) Having written a program to patch binary files I wonder how it is 
possible to truncate a file to a length greater than 2GB on a 32bit 
system. This is f.i. an issue when patching big files like qemu disk 
images. The given limitations of the off_t on 32bit systems are not as 
bad for seeking as you can seek forward in a loop (and that is the way I 
have implemented binpatch) multiple times. Why not have an 
[f]truncate64/off64_t if we are currently implementing timespec64?

b.) A very similar program has to check each page/sector of a qemu image 
file for all containing zeroes when compressing such files. This results 
in an unnecessary high CPU load for huge sparse files which are very 
sparsely populated with data. Why not have a user space callable 
'readzeroes' function which reads as long as the input just contains 
zero bytes and then returns the number of read bytes like a normal read 
would do. The only difference would be that it could skip sparse 
sections without having to zero the memory first and then let the user 
program compare the read block for all being zeroed out.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-30 12:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-30 12:26 [f]truncate64 and user space sparse file handling Elmar Stellnberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).