From 21680cfa565e7b8b000b2e2ef7bfa6d573c0f4ca Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 22 Jun 2012 08:58:10 +0100 Subject: [PATCH 06/41] dm: 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 Signed-off-by: Mike Snitzer --- drivers/md/dm-table.c | 3 +++ include/linux/device-mapper.h | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 2e227fb..f900690 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) if (!ti->num_flush_requests) continue; + if (ti->flush_supported) + return 1; + if (ti->type->iterate_devices && ti->type->iterate_devices(ti, device_flush_capable, &flush)) return 1; diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 8bdbbfc..ceac407 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -212,6 +212,12 @@ struct dm_target { char *error; /* + * Set if this target needs to receive flushes regardless of + * whether or not its underlying devices have support. + */ + unsigned flush_supported:1; + + /* * Set if this target needs to receive discards regardless of * whether or not its underlying devices have support. */ -- 1.7.1