From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kernel@vger.kernel.org,
herbert@gondor.apana.org.au, paulmck@linux.vnet.ibm.com,
edumazet@google.com, john.r.fastabend@intel.com,
josh@joshtriplett.org
Subject: [PATCH 2/9] rhashtable: Use rht_obj() instead of manual offset calculation
Date: Mon, 15 Dec 2014 13:51:04 +0100 [thread overview]
Message-ID: <61a4301e8eb49720d976d8a1e8b51e5b80b70e17.1418647641.git.tgraf@suug.ch> (raw)
In-Reply-To: <cover.1418647641.git.tgraf@suug.ch>
In-Reply-To: <cover.1418647641.git.tgraf@suug.ch>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
lib/rhashtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 1ee0eb6..b658245 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -427,7 +427,7 @@ void *rhashtable_lookup(const struct rhashtable *ht, const void *key)
if (memcmp(rht_obj(ht, he) + ht->p.key_offset, key,
ht->p.key_len))
continue;
- return (void *) he - ht->p.head_offset;
+ return rht_obj(ht, he);
}
return NULL;
@@ -460,7 +460,7 @@ void *rhashtable_lookup_compare(const struct rhashtable *ht, const void *key,
rht_for_each_rcu(he, tbl->buckets[hash], ht) {
if (!compare(rht_obj(ht, he), arg))
continue;
- return (void *) he - ht->p.head_offset;
+ return rht_obj(ht, he);
}
return NULL;
--
1.9.3
next prev parent reply other threads:[~2014-12-15 12:51 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 12:51 [PATCH 0/9] rhashtable: Per bucket locks & deferred table resizing Thomas Graf
2014-12-15 12:51 ` [PATCH 1/9] rhashtable: Do hashing inside of rhashtable_lookup_compare() Thomas Graf
2014-12-15 12:51 ` Thomas Graf [this message]
2014-12-15 12:51 ` [PATCH 3/9] rhashtable: Convert bucket iterators to take table and index Thomas Graf
2014-12-15 12:51 ` [PATCH 4/9] rhashtable: Factor out bucket_tail() function Thomas Graf
2014-12-15 12:51 ` [PATCH 5/9] nft_hash: Remove rhashtable_remove_pprev() Thomas Graf
2014-12-15 12:51 ` [PATCH 6/9] spinlock: Add spin_lock_bh_nested() Thomas Graf
2014-12-15 12:51 ` [PATCH 7/9] rhashtable: Per bucket locks & deferred expansion/shrinking Thomas Graf
2015-01-16 15:34 ` Patrick McHardy
2015-01-16 15:58 ` Thomas Graf
2015-01-16 16:03 ` Patrick McHardy
2015-01-16 16:15 ` Thomas Graf
2015-01-16 16:32 ` Patrick McHardy
2015-01-16 16:38 ` Thomas Graf
2015-01-16 16:51 ` Patrick McHardy
2015-01-16 16:43 ` David Laight
2015-01-16 16:53 ` Thomas Graf
2015-01-16 18:36 ` Patrick McHardy
2015-01-16 19:18 ` Thomas Graf
2015-01-16 19:35 ` Patrick McHardy
2015-01-16 20:46 ` Pablo Neira Ayuso
2015-01-16 20:53 ` Patrick McHardy
2015-01-19 9:01 ` Paul E. McKenney
2015-01-21 5:23 ` Herbert Xu
2015-01-21 5:29 ` Paul E. McKenney
2015-01-21 5:30 ` Herbert Xu
2015-01-21 5:36 ` Paul E. McKenney
2015-01-16 20:49 ` Herbert Xu
2015-01-16 21:31 ` Patrick McHardy
2015-01-17 0:33 ` Herbert Xu
2015-01-17 8:06 ` Patrick McHardy
2015-01-17 9:32 ` Herbert Xu
2015-01-17 9:51 ` Patrick McHardy
2015-01-17 10:13 ` Herbert Xu
2015-01-17 11:56 ` Patrick McHardy
2015-01-16 21:36 ` Thomas Graf
2015-01-16 22:07 ` Patrick McHardy
2015-01-16 23:34 ` Thomas Graf
2015-01-17 8:02 ` Patrick McHardy
2015-01-19 12:58 ` Thomas Graf
2015-01-19 9:45 ` David Laight
2014-12-15 12:51 ` [PATCH 8/9] rhashtable: Supports for nulls marker Thomas Graf
2014-12-15 12:51 ` [PATCH 9/9] netlink: Lockless lookup with RCU grace period in socket release Thomas Graf
2014-12-15 13:00 ` [PATCH 0/9 net-next] rhashtable: Per bucket locks & deferred table resizing Thomas Graf
2014-12-15 16:18 ` David Miller
2014-12-15 16:27 ` Thomas Graf
-- strict thread matches above, loose matches on Subject: below --
2015-01-02 22:00 [PATCH 0/9 net-next v2] " Thomas Graf
2015-01-02 22:00 ` [PATCH 2/9] rhashtable: Use rht_obj() instead of manual offset calculation Thomas Graf
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=61a4301e8eb49720d976d8a1e8b51e5b80b70e17.1418647641.git.tgraf@suug.ch \
--to=tgraf@suug.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=john.r.fastabend@intel.com \
--cc=josh@joshtriplett.org \
--cc=kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).