linux-next: build failure after merge of the akpm tree

From: Stephen Rothwell
Date: Wed Feb 27 2013 - 20:15:39 EST


Hi Andrew,

After merging the akpm tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/md/dm-cache-policy-cleaner.c: In function 'lookup_cache_entry':
drivers/md/dm-cache-policy-cleaner.c:148:46: error: macro "hlist_for_each_entry" passed 4 arguments, but takes just 3
drivers/md/dm-cache-policy-cleaner.c:148:2: error: 'hlist_for_each_entry' undeclared (first use in this function)
drivers/md/dm-cache-policy-cleaner.c:148:2: note: each undeclared identifier is reported only once for each function it appears in
drivers/md/dm-cache-policy-cleaner.c:148:48: error: expected ';' before '{' token
drivers/md/dm-cache-policy-cleaner.c:146:21: warning: unused variable 'bucket' [-Wunused-variable]
drivers/md/dm-cache-policy-cleaner.c:145:21: warning: unused variable 'tmp' [-Wunused-variable]
drivers/md/dm-cache-policy-cleaner.c:144:25: warning: unused variable 'cur' [-Wunused-variable]
drivers/md/dm-cache-policy-cleaner.c:158:1: warning: no return statement in function returning non-void [-Wreturn-type]
drivers/md/dm-cache-policy-mq.c: In function 'hash_lookup':
drivers/md/dm-cache-policy-mq.c:375:44: error: macro "hlist_for_each_entry" passed 4 arguments, but takes just 3
drivers/md/dm-cache-policy-mq.c:375:2: error: 'hlist_for_each_entry' undeclared (first use in this function)
drivers/md/dm-cache-policy-mq.c:375:2: note: each undeclared identifier is reported only once for each function it appears in
drivers/md/dm-cache-policy-mq.c:376:3: error: expected ';' before 'if'
drivers/md/dm-cache-policy-mq.c:373:16: warning: unused variable 'e' [-Wunused-variable]
drivers/md/dm-cache-policy-mq.c:372:21: warning: unused variable 'tmp' [-Wunused-variable]
drivers/md/dm-cache-policy-mq.c:371:21: warning: unused variable 'bucket' [-Wunused-variable]
drivers/md/dm-cache-policy-mq.c:383:1: warning: no return statement in function returning non-void [-Wreturn-type]

Caused by commit "hlist: drop the node parameter from iterators" from the
akpm tree interacting with commits b5dc50616996 ("A cache policy that
uses a multiqueue ordered by recent hit") and 9c44464a0aed ("A simple
cache policy that writes back all data to the origin") from the
device-mapper tree.

I applied the following merge fix patch:

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Thu, 28 Feb 2013 12:09:42 +1100
Subject: [PATCH] hlist-drop-the-node-parameter-from-iterators-dm-cache-policy-fix

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
drivers/md/dm-cache-policy-cleaner.c | 3 +--
drivers/md/dm-cache-policy-mq.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-cache-policy-cleaner.c b/drivers/md/dm-cache-policy-cleaner.c
index 6b0fdb0..43c270a 100644
--- a/drivers/md/dm-cache-policy-cleaner.c
+++ b/drivers/md/dm-cache-policy-cleaner.c
@@ -142,10 +142,9 @@ static struct wb_cache_entry *lookup_cache_entry(struct policy *p, dm_oblock_t o
struct hash *hash = &p->chash;
unsigned h = hash_64(from_oblock(oblock), hash->hash_bits);
struct wb_cache_entry *cur;
- struct hlist_node *tmp;
struct hlist_head *bucket = &hash->table[h];

- hlist_for_each_entry(cur, tmp, bucket, hlist) {
+ hlist_for_each_entry(cur, bucket, hlist) {
if (cur->oblock == oblock) {
/* Move upfront bucket for faster access. */
hlist_del(&cur->hlist);
diff --git a/drivers/md/dm-cache-policy-mq.c b/drivers/md/dm-cache-policy-mq.c
index cd4582d..63ec258 100644
--- a/drivers/md/dm-cache-policy-mq.c
+++ b/drivers/md/dm-cache-policy-mq.c
@@ -369,10 +369,9 @@ static struct entry *hash_lookup(struct mq_policy *mq, dm_oblock_t oblock)
{
unsigned h = hash_64(from_oblock(oblock), mq->hash_bits);
struct hlist_head *bucket = mq->table + h;
- struct hlist_node *tmp;
struct entry *e;

- hlist_for_each_entry(e, tmp, bucket, hlist)
+ hlist_for_each_entry(e, bucket, hlist)
if (e->oblock == oblock) {
hlist_del(&e->hlist);
hlist_add_head(&e->hlist, bucket);
--
1.8.1

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature