On Thu, May 24, 2018 at 11:06:59AM -0400, Brian Foster wrote: > On Thu, May 24, 2018 at 10:59:43AM -0400, Brian Foster wrote: > > On Wed, May 23, 2018 at 04:43:48PM +0200, Christoph Hellwig wrote: > > > In the only caller we just did a lookup in the COW extent tree for > > > the same offset. Reuse that result and save a lookup, as well as > > > shortening the ilock hold time. > > > > > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > > --- > > > fs/xfs/xfs_aops.c | 25 +++++++++++++++++-------- > > > fs/xfs/xfs_reflink.c | 33 --------------------------------- > > > fs/xfs/xfs_reflink.h | 2 -- > > > 3 files changed, 17 insertions(+), 43 deletions(-) > > > > > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > > > index a4b4a7037deb..354d26d66c12 100644 > > > --- a/fs/xfs/xfs_aops.c > > > +++ b/fs/xfs/xfs_aops.c > > > @@ -383,11 +383,12 @@ xfs_map_blocks( > > > struct xfs_inode *ip = XFS_I(inode); > > > struct xfs_mount *mp = ip->i_mount; > > > ssize_t count = i_blocksize(inode); > > > - xfs_fileoff_t offset_fsb, end_fsb; > > > + xfs_fileoff_t offset_fsb, end_fsb, cow_fsb = 0; > > > > cow_fsb should probably be initialized to NULLFSBLOCK rather than 0. > > With that, you also shouldn't need cow_valid. Otherwise looks Ok to me. > > > > Err.. I guess NULLFILEOFF would be more appropriate here, but same > idea.. Yes, I'll start using it.