From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:52372 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbcGMSm0 (ORCPT ); Wed, 13 Jul 2016 14:42:26 -0400 Date: Wed, 13 Jul 2016 14:42:24 -0400 From: Brian Foster To: "Darrick J. Wong" Cc: linux-fsdevel@vger.kernel.org, vishal.l.verma@intel.com, xfs@oss.sgi.com, Dave Chinner Subject: Re: [PATCH 039/119] xfs: add rmap btree insert and delete helpers Message-ID: <20160713184224.GE34396@bfoster.bfoster> References: <146612627129.12839.3827886950949809165.stgit@birch.djwong.org> <146612652222.12839.8353722216601177344.stgit@birch.djwong.org> <20160713182813.GB34396@bfoster.bfoster> <20160713183704.GC12567@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160713183704.GC12567@birch.djwong.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jul 13, 2016 at 11:37:04AM -0700, Darrick J. Wong wrote: > On Wed, Jul 13, 2016 at 02:28:13PM -0400, Brian Foster wrote: > > On Thu, Jun 16, 2016 at 06:22:02PM -0700, Darrick J. Wong wrote: > > > Add a couple of helper functions to encapsulate rmap btree insert and > > > delete operations. Add tracepoints to the update function. > > > > > > Signed-off-by: Darrick J. Wong > > > Reviewed-by: Dave Chinner > > > Signed-off-by: Dave Chinner > > > --- > > > fs/xfs/libxfs/xfs_rmap.c | 78 +++++++++++++++++++++++++++++++++++++++- > > > fs/xfs/libxfs/xfs_rmap_btree.h | 3 ++ > > > 2 files changed, 80 insertions(+), 1 deletion(-) > > > > > > > > > diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c > > > index 53ba14e..f92eaa1 100644 > > > --- a/fs/xfs/libxfs/xfs_rmap.c > > > +++ b/fs/xfs/libxfs/xfs_rmap.c > > > @@ -92,13 +92,89 @@ xfs_rmap_update( > > ... > > > +STATIC int > > > +xfs_rmapbt_delete( > > > > This throws an unused warning that persists to the end of the rmap > > patches..? > > Oh, yeah, we don't need it until "xfs: use interval query for rmap alloc > operations on shared files". Will move. > Ok, with that snipped out: Reviewed-by: Brian Foster > --D > > > > > Brian > > > > > + struct xfs_btree_cur *rcur, > > > + xfs_agblock_t agbno, > > > + xfs_extlen_t len, > > > + uint64_t owner, > > > + uint64_t offset, > > > + unsigned int flags) > > > +{ > > > + int i; > > > + int error; > > > + > > > + trace_xfs_rmapbt_delete(rcur->bc_mp, rcur->bc_private.a.agno, agbno, > > > + len, owner, offset, flags); > > > + > > > + error = xfs_rmap_lookup_eq(rcur, agbno, len, owner, offset, flags, &i); > > > + if (error) > > > + goto done; > > > + XFS_WANT_CORRUPTED_GOTO(rcur->bc_mp, i == 1, done); > > > + > > > + error = xfs_btree_delete(rcur, &i); > > > + if (error) > > > + goto done; > > > + XFS_WANT_CORRUPTED_GOTO(rcur->bc_mp, i == 1, done); > > > +done: > > > + if (error) > > > + trace_xfs_rmapbt_delete_error(rcur->bc_mp, > > > + rcur->bc_private.a.agno, error, _RET_IP_); > > > + return error; > > > } > > > > > > static int > > > diff --git a/fs/xfs/libxfs/xfs_rmap_btree.h b/fs/xfs/libxfs/xfs_rmap_btree.h > > > index 9d92da5..6674340 100644 > > > --- a/fs/xfs/libxfs/xfs_rmap_btree.h > > > +++ b/fs/xfs/libxfs/xfs_rmap_btree.h > > > @@ -64,6 +64,9 @@ int xfs_rmap_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, > > > int xfs_rmap_lookup_eq(struct xfs_btree_cur *cur, xfs_agblock_t bno, > > > xfs_extlen_t len, uint64_t owner, uint64_t offset, > > > unsigned int flags, int *stat); > > > +int xfs_rmapbt_insert(struct xfs_btree_cur *rcur, xfs_agblock_t agbno, > > > + xfs_extlen_t len, uint64_t owner, uint64_t offset, > > > + unsigned int flags); > > > int xfs_rmap_get_rec(struct xfs_btree_cur *cur, struct xfs_rmap_irec *irec, > > > int *stat); > > > > > > > > > _______________________________________________ > > > xfs mailing list > > > xfs@oss.sgi.com > > > http://oss.sgi.com/mailman/listinfo/xfs > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs