This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Performance optimization in av::fixup - use buffered IO, not mapped file


On 12/12/2012 07:31 AM, Corinna Vinschen wrote:
> On Dec 12 07:04, Eric Blake wrote:
>> On 12/12/2012 06:22 AM, Corinna Vinschen wrote:
>>> On Dec 12 06:11, Eric Blake wrote:
>>>> Eww.  That would be a regression for coreutils, [...]
>>>
>>> Really?  How so?
>>
>> When using 'cp --sparse=always', coreutils relies on lseek() to create
>> sparse files.  Removing this code from cygwin would mean that coreutils
>> now has to be rewritten to explicitly ftruncate() instead of lseek() for
>> creating sparse files.
> 
> On Cygwin only or on Linux as well?

On cygwin only.

>> of using ftruncate() when plain lseek() would do to keep them sparse.
> 
> Couldn't Devil's advocate also argue that coreutils are wrong?

If ftruncate() is the only way on cygwin to make a sparse file, I
suppose coreutils could adapt.

> 
>> Oh, and while I'm thinking about it, it would be nice to copy Linux'
>> fallocate(FALLOC_FL_PUNCH_HOLE) for punching holes into already-existing
>> files, rather than only being able to create holes by sequentially
>> building a file with each new hole possible only as the file size is
>> extended.
> 
> Hmm, that might be possible by utilising the FSCTL_SET_SPARSE and
> FSCTL_SET_ZERO_DATA DeviceIoControl codes.  However, we don't export
> fallocate at all right now.  This is a clear case of PHC(*)
> 
> 
> Corinna
> 
> (*) Patches happily considered.

Yep, I thought as much on this one :)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]