aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/md/dm-cache-policy-internal.h
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2016-09-15 09:23:46 -0400
committerMike Snitzer <snitzer@redhat.com>2016-09-22 11:15:02 -0400
commit4e781b498ee5008ede91362d91404a362e7a46b3 (patch)
tree039f3914f839b455759253fb0395a639a1912dae /drivers/md/dm-cache-policy-internal.h
parentdm array: add dm_array_new() (diff)
downloadwireguard-linux-4e781b498ee5008ede91362d91404a362e7a46b3.tar.xz
wireguard-linux-4e781b498ee5008ede91362d91404a362e7a46b3.zip
dm cache: speed up writing of the hint array
It's far quicker to always delete the hint array and recreate with dm_array_new() because we avoid the copying caused by mutation. Also simplifies the policy interface, replacing the walk_hints() with the simpler get_hint(). Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-policy-internal.h')
-rw-r--r--drivers/md/dm-cache-policy-internal.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-cache-policy-internal.h b/drivers/md/dm-cache-policy-internal.h
index 2816018faa7f..808ee0e2b2c4 100644
--- a/drivers/md/dm-cache-policy-internal.h
+++ b/drivers/md/dm-cache-policy-internal.h
@@ -48,10 +48,10 @@ static inline int policy_load_mapping(struct dm_cache_policy *p,
return p->load_mapping(p, oblock, cblock, hint, hint_valid);
}
-static inline int policy_walk_mappings(struct dm_cache_policy *p,
- policy_walk_fn fn, void *context)
+static inline uint32_t policy_get_hint(struct dm_cache_policy *p,
+ dm_cblock_t cblock)
{
- return p->walk_mappings ? p->walk_mappings(p, fn, context) : 0;
+ return p->get_hint ? p->get_hint(p, cblock) : 0;
}
static inline int policy_writeback_work(struct dm_cache_policy *p,