All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: "Roger L. Beckermeyer III" <beckerlee3@gmail.com>,
	dsterba@suse.cz, oleg@redhat.com, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org, josef@toxicpanda.com,
	linux-btrfs@vger.kernel.org, lkp@intel.com
Subject: Re: [PATCH 1/6] rbtree: add rb_find_add_cached() to rbtree.h
Date: Mon, 16 Dec 2024 23:22:25 +0100	[thread overview]
Message-ID: <20241216222225.GF9803@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <ad36347a-14a5-41d4-82d5-f557a0a7f08c@gmx.com>

On Tue, Dec 17, 2024 at 08:43:26AM +1030, Qu Wenruo wrote:
> 
> 
> 在 2024/12/13 19:36, Peter Zijlstra 写道:
> > On Thu, Dec 12, 2024 at 10:46:18AM -0600, Roger L. Beckermeyer III wrote:
> > > Adds rb_find_add_cached() as a helper function for use with
> > > red-black trees. Used in btrfs to reduce boilerplate code.
> > > 
> > > Suggested-by: Josef Bacik <josef@toxicpanda.com>
> > > Signed-off-by: Roger L. Beckermeyer III <beckerlee3@gmail.com>
> > 
> > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> 
> I guess it's fine to merge this change through btrfs tree?

Yeah, I think so. I don't think there's anything else pending for this
file -- its not touched much.

> 
> Just curious about the existing cmp() and less() functions, as they only
> accept the exist node as const.
> 
> I'm wondering if this is intentional to allow the less/cmp() functions
> to modify the new node if needed.
> As I normally assume such cmp()/less() should never touch any node nor
> its entries.

Oh yeah, they probably should not. I think it's just because the
callchain as a whole does not have const on the new node (for obvious
raisins), and I failed to put it on for the comparators.

You could add it (and fix up the whole tree) and see if anything comes
apart.

  reply	other threads:[~2024-12-16 22:22 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-08 22:37 [PATCHi 0/6] reduce boilerplate code within btrfs Roger L. Beckermeyer III
2024-12-08 22:38 ` [PATCH] rbtree: add rb_find_add_cached() to rbtree.h Roger L. Beckermeyer III
2024-12-08 22:38 ` [PATCH] btrfs: edit btrfs_add_block_group_cache() to use rb helper Roger L. Beckermeyer III
2024-12-09  5:05   ` kernel test robot
2024-12-08 22:38 ` [PATCH] btrfs: edit prelim_ref_insert() to use rb helpers Roger L. Beckermeyer III
2024-12-09  5:02   ` kernel test robot
2024-12-09  5:06   ` kernel test robot
2024-12-08 22:38 ` [PATCH] btrfs: edit __btrfs_add_delayed_item() to use rb helper Roger L. Beckermeyer III
2024-12-09  5:00   ` kernel test robot
2024-12-09  5:07   ` kernel test robot
2024-12-12  1:18   ` kernel test robot
2024-12-08 22:38 ` [PATCH] btrfs: edit btrfs_add_chunk_map() to use rb helpers Roger L. Beckermeyer III
2024-12-09  5:05   ` kernel test robot
2024-12-09  5:07   ` kernel test robot
2024-12-08 22:38 ` [PATCH] btrfs: edits tree_insert() " Roger L. Beckermeyer III
2024-12-09  5:04   ` kernel test robot
2024-12-09  5:08   ` kernel test robot
2024-12-09 12:36   ` kernel test robot
2024-12-09 12:46   ` Filipe Manana
2024-12-11 22:17   ` kernel test robot
2024-12-09  6:10 ` [PATCHi 0/6] reduce boilerplate code within btrfs Qu Wenruo
2024-12-09 14:05 ` Josef Bacik
2024-12-10 19:06 ` [PATCH " Roger L. Beckermeyer III
2024-12-10 19:06   ` [PATCH 1/6] rbtree: add rb_find_add_cached() to rbtree.h Roger L. Beckermeyer III
2024-12-12 16:46     ` Roger L. Beckermeyer III
2024-12-11 17:47     ` Roger L. Beckermeyer III
2024-12-10 19:58     ` Johannes Thumshirn
2024-12-11 18:41     ` David Sterba
2024-12-13  7:21     ` Qu Wenruo
2024-12-13  9:05       ` Peter Zijlstra
2024-12-13  9:06     ` Peter Zijlstra
2024-12-16 22:13       ` Qu Wenruo
2024-12-16 22:22         ` Peter Zijlstra [this message]
2024-12-16 22:40           ` Qu Wenruo
2024-12-10 19:06   ` [PATCH 2/6] btrfs: edit btrfs_add_block_group_cache() to use rb helper Roger L. Beckermeyer III
2024-12-11 18:45     ` David Sterba
2024-12-11 18:49     ` David Sterba
2024-12-10 19:06   ` [PATCH 3/6] btrfs: edit prelim_ref_insert() to use rb helpers Roger L. Beckermeyer III
2024-12-11 18:47     ` David Sterba
2024-12-10 19:06   ` [PATCH 4/6] btrfs: edit __btrfs_add_delayed_item() to use rb helper Roger L. Beckermeyer III
2024-12-10 19:06   ` [PATCH 5/6] btrfs: edit btrfs_add_chunk_map() to use rb helpers Roger L. Beckermeyer III
2024-12-10 19:06   ` [PATCH 6/6] btrfs: edit tree_insert() " Roger L. Beckermeyer III
2024-12-12 20:29 ` [PATCH 0/6] reduce boilerplate code within btrfs Roger L. Beckermeyer III
2024-12-12 20:29   ` [PATCH 2/6] btrfs: update btrfs_add_block_group_cache() to use rb helpers Roger L. Beckermeyer III
2024-12-13  7:19     ` Qu Wenruo
2024-12-12 20:29   ` [PATCH 3/6] btrfs: update prelim_ref_insert() " Roger L. Beckermeyer III
2024-12-12 20:29   ` [PATCH 4/6] btrfs: update __btrfs_add_delayed_item() " Roger L. Beckermeyer III
2024-12-12 20:29   ` [PATCH 5/6] btrfs: update btrfs_add_chunk_map() " Roger L. Beckermeyer III
2024-12-12 20:29   ` [PATCH 6/6] btrfs: update tree_insert() " Roger L. Beckermeyer III
2024-12-13  6:19     ` Qu Wenruo
2024-12-13  7:30       ` Johannes Thumshirn
2024-12-13  7:32         ` Qu Wenruo
2024-12-13 17:14           ` Lee Beckermeyer
2024-12-13 20:28             ` Qu Wenruo

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=20241216222225.GF9803@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=beckerlee3@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=quwenruo.btrfs@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.