From: Mark Tinguely <tinguely@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs_io: add the lseek() SEEK_DATA/SEEK_HOLE support
Date: Tue, 23 Oct 2012 09:08:32 -0500 [thread overview]
Message-ID: <5086A4E0.7040008@sgi.com> (raw)
In-Reply-To: <20121022232931.GD4291@dastard>
On 10/22/12 18:29, Dave Chinner wrote:
> On Mon, Oct 22, 2012 at 04:38:00PM -0500, Mark Tinguely wrote:
> Type Offset
> HOLE 630784
>
> xfs_io> lseek -r -d 0
> Type Offset
> DATA 0
> DATA 65536
> DATA 524288
> xfs_io> lseek -r -h 0
> Type Offset
> HOLE 16384
> HOLE 131072
> HOLE 1049576
>
> xfs_io> lseek -r -a 0
> DATA 0
> HOLE 16384
> DATA 65536
> HOLE 131072
> DATA 524288
> HOLE 1049576
Good idea.
>> +#define _LARGEFILE64_SOURCE /* See feature_test_macros(7) */
>
> That's defined by _GNU_SOURCE, which is set in the makefiles, so not
> necessary here.
Okay, I think a couple of the header files are redundantly redundant too.
>
>> +static void
>> +lseek_help(void)
>> +{
>> + printf(_(
>> +"\n"
>> +" returns the next hole or data offset at or after the specified offset\n"
>> +"\n"
>> +" Example:\n"
>> +" 'lseek -d 512' - offset of data at or following offset 512\n"
>> +"\n"
>> +" Repositions and returns the offset of either the next data or hole.\n"
>> +" There is an implied hole at the end of file. If the specified offset is\n"
>> +" past end of file, or there is no data past the specied offset, the offset\n"
>> +" -1 is returned.\n"
>
> I'd prefer that "EOF" rather than "-1" is printed in this case.
sounds good.
<deleted mess of things to clean up>
>
> Given that we only support pread and pwrite operations, the
> repositioning of the file pointer is irrelevant so probably should
> not be mentioned. If it was relevant, then we'd also need to support
> the other seek modes to reposition the file pointer. So jsut
> mentioning that it returns the offset of the next ... is probably
> sufficient here.
agreed. I did not the other lseek() whence options for that very reason.
>
> Cheers,
>
> Dave.
Thanks for the feedback.
PS. To Christoph: Yes, a test will be added.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-10-23 14:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20121022213759.033667921@sgi.com>
2012-10-22 21:38 ` [PATCH] xfs_io: add the lseek() SEEK_DATA/SEEK_HOLE support Mark Tinguely
2012-10-22 23:29 ` Dave Chinner
2012-10-23 14:08 ` Mark Tinguely [this message]
2012-10-23 20:01 ` [PATCH v2] " Mark Tinguely
2012-10-25 14:14 ` [PATCH v3] xfs_io: [v3] " Mark Tinguely
2012-10-25 22:29 ` Dave Chinner
2012-10-26 13:31 ` Mark Tinguely
2012-10-29 0:10 ` Dave Chinner
2012-10-23 12:22 ` [PATCH] xfs_io: " Christoph Hellwig
2013-08-16 20:54 Mark Tinguely
2013-08-20 21:26 ` Rich Johnston
2013-08-20 23:07 ` Eric Sandeen
2013-08-21 14:14 ` Mark Tinguely
2013-08-21 16:28 ` Eric Sandeen
2013-08-21 16:52 ` Mark Tinguely
2013-08-21 18:31 ` Eric Sandeen
2013-08-21 19:20 ` Mark Tinguely
2013-08-21 19:37 ` Eric Sandeen
2013-08-21 19:55 ` Eric Sandeen
2013-08-21 19:58 ` Mark Tinguely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5086A4E0.7040008@sgi.com \
--to=tinguely@sgi.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.