diff options
Diffstat (limited to 'drivers/md/dm-cache-policy-mq.c')
-rw-r--r-- | drivers/md/dm-cache-policy-mq.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/md/dm-cache-policy-mq.c b/drivers/md/dm-cache-policy-mq.c index dc112a7137fe..4296155090b2 100644 --- a/drivers/md/dm-cache-policy-mq.c +++ b/drivers/md/dm-cache-policy-mq.c | |||
@@ -959,23 +959,21 @@ out: | |||
959 | return r; | 959 | return r; |
960 | } | 960 | } |
961 | 961 | ||
962 | static void remove_mapping(struct mq_policy *mq, dm_oblock_t oblock) | 962 | static void mq_remove_mapping(struct dm_cache_policy *p, dm_oblock_t oblock) |
963 | { | 963 | { |
964 | struct entry *e = hash_lookup(mq, oblock); | 964 | struct mq_policy *mq = to_mq_policy(p); |
965 | struct entry *e; | ||
966 | |||
967 | mutex_lock(&mq->lock); | ||
968 | |||
969 | e = hash_lookup(mq, oblock); | ||
965 | 970 | ||
966 | BUG_ON(!e || !e->in_cache); | 971 | BUG_ON(!e || !e->in_cache); |
967 | 972 | ||
968 | del(mq, e); | 973 | del(mq, e); |
969 | e->in_cache = false; | 974 | e->in_cache = false; |
970 | push(mq, e); | 975 | push(mq, e); |
971 | } | ||
972 | 976 | ||
973 | static void mq_remove_mapping(struct dm_cache_policy *p, dm_oblock_t oblock) | ||
974 | { | ||
975 | struct mq_policy *mq = to_mq_policy(p); | ||
976 | |||
977 | mutex_lock(&mq->lock); | ||
978 | remove_mapping(mq, oblock); | ||
979 | mutex_unlock(&mq->lock); | 977 | mutex_unlock(&mq->lock); |
980 | } | 978 | } |
981 | 979 | ||