From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Liu <jeff.liu@oracle.com>,
xfs@oss.sgi.com, Chris Mason <chris.mason@oracle.com>,
aelder@sgi.com
Subject: Re: [PATCH] Introduce SEEK_DATA/SEEK_HOLE support to XFS V1
Date: Mon, 21 Nov 2011 09:34:18 +1100 [thread overview]
Message-ID: <20111120223418.GD2386@dastard> (raw)
In-Reply-To: <20111120153013.GA19199@infradead.org>
On Sun, Nov 20, 2011 at 10:30:13AM -0500, Christoph Hellwig wrote:
> On Sun, Nov 20, 2011 at 09:59:31PM +0800, Jeff Liu wrote:
> > > fsb = XFS_B_TO_FSBT(mp, start_offset);
> > > error = xfs_bmap_first_unused(NULL, ip, 1, &fsb,
> > > XFS_DATA_FORK);
> > > if (error)
> > > return -error;
> > >
> > > if (fsb <= XFS_B_TO_FSBT(mp, start_offset))
> > > return start_offset;
> > > return XFS_FSB_TO_B(mp, fsb);
> >
> > Thanks for pointing it out, I even don't know XFS has this convenient routine at that time. :(
>
> I didn't remember it either, but Dave has been working the dir code
> which makes use of this funtion lately :)
>
> Btw, the documentation for the function doesn't mention that it starts
> searching for the hole only after the passed in block number, which
> is something that could be improved.
Definitely.
A bit of code archeology shows that the location of the hole was
originally the return value of the function, then it got moved to a
function parameter so that the return value could be used for error
status (1995). Then the parameter go changed to be used as the first
block to start searching from when the dir2 code was introduced in
1999. So it's been wrong for quite some time ;)
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2011-11-20 22:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-02 15:04 SEEK_DATA/SEEK_HOLE support Jeff Liu
2011-10-02 15:42 ` Christoph Hellwig
2011-10-02 16:06 ` Jeff Liu
2011-10-02 17:59 ` Christoph Hellwig
2011-10-02 19:11 ` Andi Kleen
2011-10-03 4:04 ` Jeff Liu
2011-10-03 23:43 ` Dave Chinner
2011-10-04 13:02 ` Christoph Hellwig
2011-10-05 4:36 ` Dave Chinner
2011-10-05 5:32 ` Jeff Liu
2011-10-05 9:23 ` Dave Chinner
2011-10-05 13:56 ` Jeff Liu
2011-10-05 7:34 ` Michael Monnerie
2011-10-05 9:36 ` Dave Chinner
2011-10-05 18:22 ` Michael Monnerie
2011-10-06 0:32 ` Dave Chinner
2011-11-14 10:24 ` Christoph Hellwig
2011-11-14 12:47 ` Jeff Liu
2011-11-14 12:50 ` Christoph Hellwig
2011-11-19 8:29 ` XFS SEEK_DATA/SEEK_HOLE support V1 Jeff Liu
2011-11-19 8:34 ` Jeff Liu
2011-11-19 8:37 ` [PATCH] Introduce SEEK_DATA/SEEK_HOLE support to XFS V1 Jeff Liu
2011-11-19 19:11 ` Christoph Hellwig
2011-11-20 13:15 ` Jeff Liu
2011-11-20 0:30 ` Dave Chinner
2011-11-20 13:59 ` Jeff Liu
2011-11-20 15:30 ` Christoph Hellwig
2011-11-20 22:34 ` Dave Chinner [this message]
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=20111120223418.GD2386@dastard \
--to=david@fromorbit.com \
--cc=aelder@sgi.com \
--cc=chris.mason@oracle.com \
--cc=hch@infradead.org \
--cc=jeff.liu@oracle.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