From: Jeff Liu <jeff.liu@oracle.com>
To: Mark Tinguely <tinguely@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>, Ben Myers <bpm@sgi.com>,
Chris Mason <chris.mason@oracle.com>,
xfs@oss.sgi.com
Subject: Re: [PATCH] Introduce SEEK_DATA/SEEK_HOLE support V8
Date: Wed, 22 Feb 2012 11:05:23 +0800 [thread overview]
Message-ID: <4F445B73.4000501@oracle.com> (raw)
In-Reply-To: <4F43B081.3000300@sgi.com>
On 02/21/2012 10:56 PM, Mark Tinguely wrote:
> On 02/17/12 07:16, Jeff Liu wrote:
>> Hello,
>>
>> This is the revised patch according to Dave's comments for V7.
>>
>> Changes to V8:
>> --------------
>> 1. If there is an internal error raised at extent reading routine, just
>> return it rather than ENXIO.
>> 2. Add the commit message.
>> 3. Remove the for(;;) loop since there is no continuous holes shown even
>> if create a Petabyte sparse file with hole extent length longer than
>> 32-bit. Thanks Dave for helping verify that!
>> 4. In xfs_seek_data(), s/len/end/, looks 'end' is more meaningful here
>> to indicate the range of extents mapped.
>> 5. Remove BUG() from xfs_seek_data() since xfs_bmapi_read() have found
>> any corruption during the lookup, it should not occurred at all.
>>
>> Any comments are appreciated!
>>
>> Thanks,
>> -Jeff
>>
>>
>> Signed-off-by: Jie Liu<jeff.liu@oracle.com>
>
> ...
>
>> +STATIC loff_t
>> +xfs_seek_hole(
> ...
>> +
>> + fsbno = XFS_B_TO_FSBT(mp, start);
>> + error = xfs_bmap_first_unused(NULL, ip, 1,&fsbno, XFS_DATA_FORK);
>> + if (error)
>> + goto out_unlock;
>> +
>> + holeoff = XFS_FSB_TO_B(mp, fsbno);
>> + if (holeoff<= start)
>> + offset = start;
>> + else
>> + offset = min_t(loff_t, holeoff, isize);
>> +
>
> ...
>
> Very Nice. Much more concise.
>
> Can xfs_bmap_first_unused() return something larger than the end of file?
I think it could be happen if the file has no holes past the given
offset. In this case, it will return the first block past the end of
file. That is why "min_t()" is used to determine the final value.
Thanks,
-Jeff
>
> Reviewed-by: Mark Tinguely <tinguely@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-02-22 3:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 13:16 [PATCH] Introduce SEEK_DATA/SEEK_HOLE support V8 Jeff Liu
2012-02-21 14:56 ` Mark Tinguely
2012-02-22 3:05 ` Jeff Liu [this message]
2012-02-22 14:26 ` Mark Tinguely
2012-05-09 17:42 ` Mark Tinguely
2012-05-10 2:51 ` Jeff Liu
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=4F445B73.4000501@oracle.com \
--to=jeff.liu@oracle.com \
--cc=bpm@sgi.com \
--cc=chris.mason@oracle.com \
--cc=hch@infradead.org \
--cc=tinguely@sgi.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox