aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2012-07-27 10:08:07 -0400
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 10:08:07 -0400
commit0e9c24ed7443d090e369a2eddfa13f7f0b5afbaf (patch)
tree707aed84bf17ee82bb32bb26e776b97afb3493fe
parentf4b90369d3a9ffe0f48f373c566578c142e95bf2 (diff)
dm: allow targets to request flushes regardless of underlying device support
Allow targets to override the 'supports flush' calculation. Set 'flush_supported' if a target needs to receive flushes regardless of whether or not its underlying devices have support. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r--drivers/md/dm-table.c3
-rw-r--r--include/linux/device-mapper.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 2e227fbf1622..f90069029aae 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1319,6 +1319,9 @@ static bool dm_table_supports_flush(struct dm_table *t, unsigned flush)
1319 if (!ti->num_flush_requests) 1319 if (!ti->num_flush_requests)
1320 continue; 1320 continue;
1321 1321
1322 if (ti->flush_supported)
1323 return 1;
1324
1322 if (ti->type->iterate_devices && 1325 if (ti->type->iterate_devices &&
1323 ti->type->iterate_devices(ti, device_flush_capable, &flush)) 1326 ti->type->iterate_devices(ti, device_flush_capable, &flush))
1324 return 1; 1327 return 1;
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 8bdbbfce759a..bdd65e97a129 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -212,6 +212,12 @@ struct dm_target {
212 char *error; 212 char *error;
213 213
214 /* 214 /*
215 * Set if this target needs to receive flushes regardless of
216 * whether or not its underlying devices have support.
217 */
218 bool flush_supported:1;
219
220 /*
215 * Set if this target needs to receive discards regardless of 221 * Set if this target needs to receive discards regardless of
216 * whether or not its underlying devices have support. 222 * whether or not its underlying devices have support.
217 */ 223 */