xfs
[Top] [All Lists]

Re: [PATCH] xfs_io: v7 add the lseek() SEEK_DATA/SEEK_HOLE support

To: Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Subject: Re: [PATCH] xfs_io: v7 add the lseek() SEEK_DATA/SEEK_HOLE support
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Fri, 23 Aug 2013 09:57:31 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <08C24AC4-BA56-41C5-BC5C-0DBE2A5C1033@xxxxxxxxxxx>
References: <20130822213148.224998379@xxxxxxx> <52169488.2040303@xxxxxxxxxxx> <521762F4.4050603@xxxxxxx> <08C24AC4-BA56-41C5-BC5C-0DBE2A5C1033@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 08/23/13 08:34, Eric Sandeen wrote:
On Aug 23, 2013, at 8:26 AM, Mark Tinguely<tinguely@xxxxxxx>  wrote:

On 08/22/13 17:45, Eric Sandeen wrote:
On 8/22/13 4:31 PM, Mark Tinguely wrote:

Add the lseek SEEK_DATA/SEEK_HOLE support into xfs_io.
The result from the lseek() call will be printed to the output.
For example:

xfs_io>   seek -h 609k
HOLE    630784

Signed-off-by: Mark Tinguely<tinguely@xxxxxxx>
---
  version 7 or 8 - Eric what number is this?

Go for 13, for luck!

I think this looks ok, I won't torture you any longer.  If there's anything
to fix up when it really gets used in earnest we can do it then.

(it crossed my mind that for the "-r" and "-a" invocations it might be good to 
print
out the offset which was sent for each SEEK_* "whence," but *shrug*)

Thanks for all the iterations,

Reviewed-by: Eric Sandeen<sandeen@xxxxxxxxxx>

Rich, hold off on commit, I can quickly add the whence. We can see how she 
sails.

Was just an idle thought... See if it makes sense I guess...

Thanks,
Eric


without whence:
xfs_io> seek -ar 0
HOLE    0
DATA    528384
HOLE    532480
DATA    819200
HOLE    823296

xfs_io> seek -dh 512k
HOLE    524288
DATA    528384

xfs_io> seek -rd 0
DATA    528384
DATA    819200

============

after with whence:
xfs_io> seek -ar 0:
HOLE    0       0
DATA    0       528384
HOLE    528384  532480
DATA    532480  819200
HOLE    819200  823296

xfs_io> seek -dh 512k:

HOLE    524288
DATA    528384

xfs_io> seek -rd 0
DATA    0       528384
DATA    532480  819200

Seems to make most sense in the case of -rd and -rh

--Mark.

<Prev in Thread] Current Thread [Next in Thread>