Skip to contentSkip to conversation

dm cache: Avoid conflicting remove_mapping() in mq policy

PATCH In review Geert Uytterhoeven 3 participants 3 messages Jul 26, 2013 – Aug 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm cache: Avoid conflicting remove_mapping() in mq policy

On sparc32, which includes <linux/swap.h> from <asm/pgtable_32.h>:

drivers/md/dm-cache-policy-mq.c:962:13: error: conflicting types for 'remove_mapping' include/linux/swap.h:285:12: note: previous declaration of 'remove_mapping' was here

As mq_remove_mapping() already exists, and the local remove_mapping() is used only once, inline it manually to avoid the conflict.

---
I think this is also needed on hexagon, which includes <linux/swap.h> from <asm/pgtable.h>.

 drivers/md/dm-cache-policy-mq.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/md/dm-cache-policy-mq.c +7 -9
index dc112a7..4296155 100644
@@ -959,23 +959,21 @@ out:
 	return r;
 }
 
-static void remove_mapping(struct mq_policy *mq, dm_oblock_t oblock)
+static void mq_remove_mapping(struct dm_cache_policy *p, dm_oblock_t oblock)
 {
-	struct entry *e = hash_lookup(mq, oblock);
+	struct mq_policy *mq = to_mq_policy(p);
+	struct entry *e;
+
+	mutex_lock(&mq->lock);
+
+	e = hash_lookup(mq, oblock);
 
 	BUG_ON(!e || !e->in_cache);
 
 	del(mq, e);
 	e->in_cache = false;
 	push(mq, e);
-}
 
-static void mq_remove_mapping(struct dm_cache_policy *p, dm_oblock_t oblock)
-{
-	struct mq_policy *mq = to_mq_policy(p);
-
-	mutex_lock(&mq->lock);
-	remove_mapping(mq, oblock);
 	mutex_unlock(&mq->lock);
 }
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 9 lines · Geert Uytterhoeven

On sparc32, which includes <linux/swap.h> from <asm/pgtable_32.h>:

drivers/md/dm-cache-policy-mq.c:962:13: error: conflicting types for 'remove_mapping' include/linux/swap.h:285:12: note: previous declaration of 'remove_mapping' was here

As mq_remove_mapping() already exists, and the local remove_mapping() is used only once, inline it manually to avoid the conflict.

Is this patch going anyhere ? The problem breaks the sparc32:allmodconfig build, so it would be useful to get it fixed.

Thanks,
Guenter

Quoted 43 lines

---
I think this is also needed on hexagon, which includes <linux/swap.h> from <asm/pgtable.h>.

  drivers/md/dm-cache-policy-mq.c |   16 +++++++---------
  1 file changed, 7 insertions(+), 9 deletions(-)
drivers/md/dm-cache-policy-mq.c +7 -9
index dc112a7..4296155 100644
@@ -959,23 +959,21 @@ out:
  	return r;
  }
 
-static void remove_mapping(struct mq_policy *mq, dm_oblock_t oblock)
+static void mq_remove_mapping(struct dm_cache_policy *p, dm_oblock_t oblock)
  {
-	struct entry *e = hash_lookup(mq, oblock);
+	struct mq_policy *mq = to_mq_policy(p);
+	struct entry *e;
+
+	mutex_lock(&mq->lock);
+
+	e = hash_lookup(mq, oblock);
 
  	BUG_ON(!e || !e->in_cache);
 
  	del(mq, e);
  	e->in_cache = false;
  	push(mq, e);
-}
 
-static void mq_remove_mapping(struct dm_cache_policy *p, dm_oblock_t oblock)
-{
-	struct mq_policy *mq = to_mq_policy(p);
-
-	mutex_lock(&mq->lock);
-	remove_mapping(mq, oblock);
  	mutex_unlock(&mq->lock);
  }
 
#2 lore raw
Quoted 2 lines · Guenter Roeck

Is this patch going anyhere ? The problem breaks the sparc32:allmodconfig build, so it would be useful to get it fixed.

We're pulling together a batch of patches today, including this one.

Alasdair