aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-cache-policy.h
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2015-05-15 10:20:09 -0400
committerMike Snitzer <snitzer@redhat.com>2015-05-29 14:19:04 -0400
commit20f6814b94fff4a98b123f1c2b691e936be27aaf (patch)
tree1845743b06f1a2e999a37c5ae98ba6649753a95a /drivers/md/dm-cache-policy.h
parent066dbaa386c751164c39ab025e5e8803b4a4d691 (diff)
dm cache: pass a new 'critical' flag to the policies when requesting writeback work
We only allow non critical writeback if the origin is idle. It is up to the policy to decide what writeback work is critical. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-policy.h')
-rw-r--r--drivers/md/dm-cache-policy.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-policy.h b/drivers/md/dm-cache-policy.h
index 5524e21e4836..6106ca3aa350 100644
--- a/drivers/md/dm-cache-policy.h
+++ b/drivers/md/dm-cache-policy.h
@@ -178,7 +178,9 @@ struct dm_cache_policy {
178 int (*remove_cblock)(struct dm_cache_policy *p, dm_cblock_t cblock); 178 int (*remove_cblock)(struct dm_cache_policy *p, dm_cblock_t cblock);
179 179
180 /* 180 /*
181 * Provide a dirty block to be written back by the core target. 181 * Provide a dirty block to be written back by the core target. If
182 * critical_only is set then the policy should only provide work if
183 * it urgently needs it.
182 * 184 *
183 * Returns: 185 * Returns:
184 * 186 *
@@ -186,7 +188,8 @@ struct dm_cache_policy {
186 * 188 *
187 * -ENODATA: no dirty blocks available 189 * -ENODATA: no dirty blocks available
188 */ 190 */
189 int (*writeback_work)(struct dm_cache_policy *p, dm_oblock_t *oblock, dm_cblock_t *cblock); 191 int (*writeback_work)(struct dm_cache_policy *p, dm_oblock_t *oblock, dm_cblock_t *cblock,
192 bool critical_only);
190 193
191 /* 194 /*
192 * How full is the cache? 195 * How full is the cache?