From: Christoph Hellwig <hch@infradead.org>
To: Christoph Hellwig <hch@lst.de>, xfs@oss.sgi.com
Subject: Re: [PATCH 21/26] implement generic xfs_btree_in??ert/insrec
Date: Mon, 4 Aug 2008 21:29:43 -0400 [thread overview]
Message-ID: <20080805012943.GB22147@infradead.org> (raw)
In-Reply-To: <20080805010557.GL6119@disturbed>
On Tue, Aug 05, 2008 at 11:05:57AM +1000, Dave Chinner wrote:
> I think that ->get_dmaxrecs is probably badly named. I called it
> that originally because it matched the macro name it was wrapping.
> Realisitically it should be ->get_root_maxrecs....
Yeah. The name giving macro is already gone in my current tree.
>
> > + /* Make a key out of the record data to be inserted, and save it. */
> > + cur->bc_ops->init_key_from_rec(cur, &key, recp);
> > +
> > + /* If we're off the left edge, return failure. */
> > + ptr = cur->bc_ptrs[level];
> > + if (ptr == 0) {
> > + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT);
> > + *stat = 0;
> > + return 0;
> > + }
>
> You can probably move the key initialisation till after then initial
> 'in this block' checks.
Done.
> > + /*
> > + * If the block is full, we can't insert the new entry until we
> > + * make the block un-full.
> > + */
> > + xfs_btree_set_ptr_null(cur, &nptr);
> > + if (numrecs == cur->bc_ops->get_maxrecs(cur, level)) {
> > + error = xfs_btree_make_block_unfull(cur, level, numrecs,
> > + &optr, &ptr, &nptr, &ncur, &nrec, stat);
> > + if (error || *stat == 0)
> > + goto error0;
> > + }
> > +
> > + /* The current block may have changed during the split. */
> > + block = xfs_btree_get_block(cur, level, &bp);
> > + numrecs = xfs_btree_get_numrecs(block);
>
> The comment here should probably refer to the unfull call, not a
> 'split'. i.e.:
>
> /*
> * the current block may have changed if the block was
> * previously full and we have just made space in it.
> */
Updated.
prev parent reply other threads:[~2008-08-05 1:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-04 1:35 [PATCH 21/26] implement =?unknown-8bit?Q?generic_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Christoph Hellwig
2008-08-05 1:05 ` [PATCH 21/26] implement generic xfs_btree_inѕert/insrec Dave Chinner
2008-08-05 1:29 ` Christoph Hellwig [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=20080805012943.GB22147@infradead.org \
--to=hch@infradead.org \
--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