This patch adds support for a per-target dm_flush_fn method. This is needed to allow dm-loop to invalidate page cache mappings in response to BLKFLSBUF ioctl commands. Signed-off-by: Bryn Reeves Index: linux-2.6.17/drivers/md/dm-table.c =================================================================== --- linux-2.6.17.orig/drivers/md/dm-table.c 2006-08-10 19:28:24.000000000 +0100 +++ linux-2.6.17/drivers/md/dm-table.c 2006-08-10 19:28:27.000000000 +0100 @@ -1001,6 +1001,11 @@ int dm_table_flush_all(struct dm_table * { struct list_head *d, *devices = dm_table_get_devices(t); int ret = 0; + unsigned i; + + for (i = 0; i < t->num_targets; i++) + if (t->targets[i].type->flush) + t->targets[i].type->flush(&t->targets[i]); for (d = devices->next; d != devices; d = d->next) { struct dm_dev *dd = list_entry(d, struct dm_dev, list); Index: linux-2.6.17/include/linux/device-mapper.h =================================================================== --- linux-2.6.17.orig/include/linux/device-mapper.h 2006-08-10 19:28:24.000000000 +0100 +++ linux-2.6.17/include/linux/device-mapper.h 2006-08-10 19:28:27.000000000 +0100 @@ -55,6 +55,7 @@ typedef int (*dm_endio_fn) (struct dm_ta struct bio *bio, int error, union map_info *map_context); +typedef void (*dm_flush_fn) (struct dm_target *ti); typedef void (*dm_presuspend_fn) (struct dm_target *ti); typedef void (*dm_postsuspend_fn) (struct dm_target *ti); typedef int (*dm_preresume_fn) (struct dm_target *ti); @@ -96,6 +97,7 @@ struct target_type { dm_dtr_fn dtr; dm_map_fn map; dm_endio_fn end_io; + dm_flush_fn flush; dm_presuspend_fn presuspend; dm_postsuspend_fn postsuspend; dm_preresume_fn preresume;