Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-09 Thread Joerg Sonnenberger
On Sun, Aug 07, 2011 at 02:14:50PM +, David Holland wrote: > On Sun, Aug 07, 2011 at 09:52:11AM +0200, Reinoud Zandijk wrote: > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > > introduced by Solaris for ZFS. > > What does this operation have to do with seeking? And wh

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-09 Thread John Nemeth
On Dec 28, 1:27pm, Reinoud Zandijk wrote: } On Sun, Aug 07, 2011 at 02:14:50PM +, David Holland wrote: } > On Sun, Aug 07, 2011 at 09:52:11AM +0200, Reinoud Zandijk wrote: } > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as } > > introduced by Solaris for ZFS. } > } > W

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-08 Thread Reinoud Zandijk
On Mon, Aug 08, 2011 at 12:15:03AM +, David Holland wrote: > > >struct range range; > > > > > >while (pos < len) { > > > fgetrange(fd, pos, &range); > > > if (range.r_type == RANGE_DATA) { > > > amount = range.r_end - pos; > > > if (amount > sizeof(

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-08 Thread David Laight
On Sun, Aug 07, 2011 at 02:14:50PM +, David Holland wrote: > On Sun, Aug 07, 2011 at 09:52:11AM +0200, Reinoud Zandijk wrote: > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > > introduced by Solaris for ZFS. > > What does this operation have to do with seeking? And wh

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread David Holland
On Sun, Aug 07, 2011 at 08:39:51PM -0500, Eric Haszlakiewicz wrote: > > > > Even your example code does this: it seeks repeatedly, teleporting the > > > > seek pointer all over the place for no reason, then does a bunch of > > > > reads. > > > > > So yes, it changes the file pointer too but tha

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread Eric Haszlakiewicz
On Mon, Aug 08, 2011 at 12:15:03AM +, David Holland wrote: > On Sun, Aug 07, 2011 at 10:03:34PM +0200, Reinoud Zandijk wrote: > > > Even your example code does this: it seeks repeatedly, teleporting the > > > seek pointer all over the place for no reason, then does a bunch of > > > reads. >

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread David Holland
On Sun, Aug 07, 2011 at 10:03:34PM +0200, Reinoud Zandijk wrote: > > > > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > > > > > introduced by Solaris for ZFS. > > > One `seeks' the next hole of data block in the file from a given > > > pos? Sounds logical to me. > > >

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread Reinoud Zandijk
Hi David, hi folks, On Sun, Aug 07, 2011 at 05:06:16PM +, David Holland wrote: > On Sun, Aug 07, 2011 at 06:52:03PM +0200, Reinoud Zandijk wrote: > > > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > > > > introduced by Solaris for ZFS. > > One `seeks' the next hole o

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread David Holland
On Sun, Aug 07, 2011 at 06:52:03PM +0200, Reinoud Zandijk wrote: > > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > > > introduced by Solaris for ZFS. > > > > What does this operation have to do with seeking? And why involve the > > seek pointer, especially at a time w

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread Reinoud Zandijk
Hi David, hi folks, On Sun, Aug 07, 2011 at 02:14:50PM +, David Holland wrote: > On Sun, Aug 07, 2011 at 09:52:11AM +0200, Reinoud Zandijk wrote: > > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > > introduced by Solaris for ZFS. > > What does this operation have to do

Re: RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread David Holland
On Sun, Aug 07, 2011 at 09:52:11AM +0200, Reinoud Zandijk wrote: > i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as > introduced by Solaris for ZFS. What does this operation have to do with seeking? And why involve the seek pointer, especially at a time when new calls are being

RFC: lseek() extensions: SEEK_HOLE / SEEK_DATA with patch

2011-08-07 Thread Reinoud Zandijk
Dear folks, i've implemented the SEEK_HOLE / SEEK_DATA additions to lseek() as introduced by Solaris for ZFS. It ought to perform as in the Solaris implementation. For a test program and trace on Solaris 10 see https://lkml.org/lkml/2011/4/22/79 Test runs have been made on NFS (genfs_seek) and FF