Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b936bf8b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mike Snitzer
Browse files

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.

Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair Kergon <agk@redhat.com>
Acked-by: default avatarJoe Thornber <ejt@redhat.com>
parent d4e4ab86
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -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);
}