xfs
[Top] [All Lists]

Re: [PATCH] Introduce SEEK_DATA/SEEK_HOLE support to XFS V1

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH] Introduce SEEK_DATA/SEEK_HOLE support to XFS V1
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sun, 20 Nov 2011 10:30:13 -0500
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, aelder@xxxxxxx, Chris Mason <chris.mason@xxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <4EC907C3.7020901@xxxxxxxxxx>
References: <4E887D7F.2010306@xxxxxxxxxx> <20111114102444.GA27791@xxxxxxxxxxxxx> <4EC10DE8.6030607@xxxxxxxxxx> <20111114125044.GA9802@xxxxxxxxxxxxx> <4EC768F5.4050904@xxxxxxxxxx> <4EC76AB9.9030604@xxxxxxxxxx> <20111120003031.GM7046@dastard> <4EC907C3.7020901@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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.

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