Skip to content

Commit

Permalink
dm cache: avoid conflicting remove_mapping() in mq policy
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair Kergon <agk@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
  • Loading branch information
Geert Uytterhoeven authored and Mike Snitzer committed Aug 16, 2013
1 parent d4e4ab8 commit b936bf8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/md/dm-cache-policy-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,23 +959,21 @@ static int mq_walk_mappings(struct dm_cache_policy *p, policy_walk_fn fn,
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);
}

Expand Down

0 comments on commit b936bf8

Please sign in to comment.