Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-25 Thread Eric Blake
te to the ENXIO description: > > ... or the whence argument is SEEK_DATA and the offset falls beyond > the last byte not within a hole. I've added your improved wording as a comment at http://austingroupbugs.net/view.php?id=415 -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-25 Thread Eric Blake
third argument of fcntl has traditionally been no wider than a pointer which is not the case for off_t on 32-bit platforms. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-22 Thread Eric Blake
On 04/22/2011 10:57 AM, Sunil Mushran wrote: > On 04/22/2011 09:40 AM, Eric Blake wrote: >> On 04/22/2011 10:28 AM, Sunil Mushran wrote: >>> while(1) { >>> read(block); >>> if (block_all_zeroes) >>> lseek(SEEK_DATA); >>> } &g

Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-22 Thread Eric Blake
On 04/22/2011 10:28 AM, Sunil Mushran wrote: > On 04/22/2011 04:50 AM, Eric Blake wrote: >> That blog also mentioned the useful idea of adding FIND_HOLE and >> FIND_DATA, not implemented in Solaris, but which could easily be >> provided as additional lseek constants in Linux t

Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-22 Thread Eric Blake
K_DATA in the next revision of POSIX; comments are welcome to make sure that everyone is happy with wording: http://austingroupbugs.net/view.php?id=415 -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-22 Thread Eric Blake
EEK_DATA) - two lseek() calls per iteration if we have 4 constants, but 3 per iteration if we only have SEEK_HOLE and have to manually rewind. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature