* [PATCH] dm cache: Avoid conflicting remove_mapping() in mq policy
@ 2013-07-26 7:57 Geert Uytterhoeven
2013-08-16 8:31 ` Guenter Roeck
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2013-07-26 7:57 UTC (permalink / raw)
To: Alasdair Kergon, Joe Thornber, Mike Snitzer
Cc: dm-devel, sparclinux, linux-hexagon, linux-kernel,
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.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
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(-)
diff --git a/drivers/md/dm-cache-policy-mq.c b/drivers/md/dm-cache-policy-mq.c
index dc112a7..4296155 100644
--- a/drivers/md/dm-cache-policy-mq.c
+++ b/drivers/md/dm-cache-policy-mq.c
@@ -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);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dm cache: Avoid conflicting remove_mapping() in mq policy
2013-07-26 7:57 [PATCH] dm cache: Avoid conflicting remove_mapping() in mq policy Geert Uytterhoeven
@ 2013-08-16 8:31 ` Guenter Roeck
2013-08-16 11:38 ` Alasdair G Kergon
0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2013-08-16 8:31 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Alasdair Kergon, Joe Thornber, Mike Snitzer, dm-devel, sparclinux,
linux-hexagon, linux-kernel, Greg Kroah-Hartman
On 07/26/2013 12:57 AM, Geert Uytterhoeven wrote:
> 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.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Is this patch going anyhere ? The problem breaks the sparc32:allmodconfig build,
so it would be useful to get it fixed.
Thanks,
Guenter
> ---
> 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(-)
>
> diff --git a/drivers/md/dm-cache-policy-mq.c b/drivers/md/dm-cache-policy-mq.c
> index dc112a7..4296155 100644
> --- a/drivers/md/dm-cache-policy-mq.c
> +++ b/drivers/md/dm-cache-policy-mq.c
> @@ -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);
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dm cache: Avoid conflicting remove_mapping() in mq policy
2013-08-16 8:31 ` Guenter Roeck
@ 2013-08-16 11:38 ` Alasdair G Kergon
0 siblings, 0 replies; 3+ messages in thread
From: Alasdair G Kergon @ 2013-08-16 11:38 UTC (permalink / raw)
To: Guenter Roeck
Cc: Geert Uytterhoeven, Alasdair Kergon, Joe Thornber, Mike Snitzer,
dm-devel, sparclinux, linux-hexagon, linux-kernel,
Greg Kroah-Hartman
On Fri, Aug 16, 2013 at 01:31:18AM -0700, Guenter Roeck wrote:
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-16 11:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26 7:57 [PATCH] dm cache: Avoid conflicting remove_mapping() in mq policy Geert Uytterhoeven
2013-08-16 8:31 ` Guenter Roeck
2013-08-16 11:38 ` Alasdair G Kergon
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).