public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 21/21] clean up xfs_bmap_btree.c
Date: Wed, 30 Jul 2008 17:32:45 +1000	[thread overview]
Message-ID: <20080730073245.GV13395@disturbed> (raw)
In-Reply-To: <20080729193200.GV19104@lst.de>

On Tue, Jul 29, 2008 at 09:32:00PM +0200, Christoph Hellwig wrote:
> From: Dave Chinner <dgc@sgi.com>
> 
> Reimplement xfs_bmbt_newroot and xfs_bmbt_kill_root using the new generic
> btree helpers and clean out all cruft needed for the old implementations.
> 
> This requires exporting some functionality from xfs_btree.c that's only
> used locally otherwise.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
.....
> +	nrecs += i;
> +	xfs_btree_set_numrecs(block, nrecs);
> +
> +	ASSERT(nrecs == crecs);
> +	kp = xfs_bmbt_key_addr(cur, 1, block);
> +	ckp = xfs_bmbt_key_addr(cur, 1, cblock);
> +	memcpy(kp, ckp, nrecs * sizeof(xfs_bmbt_key_t));

Should really be xfs_bmbt_copy_keys(), right?

> +	pp = xfs_bmbt_ptr_addr(cur, 1, block);
> +	cpp = xfs_bmbt_ptr_addr(cur, 1, cblock);
> +
> +#ifdef DEBUG
> +	for (i = 0; i < crecs; i++) {
> +		int	error;
> +
> +		error = xfs_btree_check_ptr(cur, cpp, i, level - 1);
> +		if (error) {
> +			XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
> +			return error;
> +		}
> +	}
> +#endif
> +
> +	memcpy(pp, cpp, nrecs * sizeof(xfs_bmbt_key_t));

xfs_bmbt_copy_recs()?

Otherwise looks ok.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2008-07-30  7:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-29 19:32 [PATCH 21/21] clean up xfs_bmap_btree.c Christoph Hellwig
2008-07-30  7:32 ` Dave Chinner [this message]
2008-08-01 19:55   ` Christoph Hellwig

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=20080730073245.GV13395@disturbed \
    --to=david@fromorbit.com \
    --cc=hch@lst.de \
    --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