From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, peterz@infradead.org,
jolsa@redhat.com, acme@redhat.com, wuchi.zero@gmail.com,
akpm@linux-foundation.org
Subject: [merged mm-nonmm-stable] lib-btree-simplify-btree_lookupupdate.patch removed from -mm tree
Date: Thu, 16 Jun 2022 19:59:00 -0700 [thread overview]
Message-ID: <20220617025901.39184C3411A@smtp.kernel.org> (raw)
The quilt patch titled
Subject: lib/btree: simplify btree_{lookup|update}
has been removed from the -mm tree. Its filename was
lib-btree-simplify-btree_lookupupdate.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: wuchi <wuchi.zero@gmail.com>
Subject: lib/btree: simplify btree_{lookup|update}
Date: Tue, 7 Jun 2022 21:35:56 +0800
btree_{lookup|update} both need to look up node by key, using the common
parts(add function btree_lookup_node) to simplify code.
Link: https://lkml.kernel.org/r/20220607133556.34732-1-wuchi.zero@gmail.com
Signed-off-by: wuchi <wuchi.zero@gmail.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/btree.c | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
--- a/lib/btree.c~lib-btree-simplify-btree_lookupupdate
+++ a/lib/btree.c
@@ -238,7 +238,7 @@ static int keyzero(struct btree_geo *geo
return 1;
}
-void *btree_lookup(struct btree_head *head, struct btree_geo *geo,
+static void *btree_lookup_node(struct btree_head *head, struct btree_geo *geo,
unsigned long *key)
{
int i, height = head->height;
@@ -257,7 +257,16 @@ void *btree_lookup(struct btree_head *he
if (!node)
return NULL;
}
+ return node;
+}
+
+void *btree_lookup(struct btree_head *head, struct btree_geo *geo,
+ unsigned long *key)
+{
+ int i;
+ unsigned long *node;
+ node = btree_lookup_node(head, geo, key);
if (!node)
return NULL;
@@ -271,23 +280,10 @@ EXPORT_SYMBOL_GPL(btree_lookup);
int btree_update(struct btree_head *head, struct btree_geo *geo,
unsigned long *key, void *val)
{
- int i, height = head->height;
- unsigned long *node = head->node;
-
- if (height == 0)
- return -ENOENT;
-
- for ( ; height > 1; height--) {
- for (i = 0; i < geo->no_pairs; i++)
- if (keycmp(geo, node, i, key) <= 0)
- break;
- if (i == geo->no_pairs)
- return -ENOENT;
- node = bval(geo, node, i);
- if (!node)
- return -ENOENT;
- }
+ int i;
+ unsigned long *node;
+ node = btree_lookup_node(head, geo, key);
if (!node)
return -ENOENT;
_
Patches currently in -mm which might be from wuchi.zero@gmail.com are
lib-debugobjects-fix-stat-count-and-optimize-debug_objects_mem_init.patch
reply other threads:[~2022-06-17 2:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220617025901.39184C3411A@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=acme@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=wuchi.zero@gmail.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.