From 999d816851c3e080412a19558f111d01852d2f04 Mon Sep 17 00:00:00 2001 From: Bryn Reeves Date: Tue, 3 Oct 2006 01:15:43 -0700 Subject: [PATCH] dm table: add target flush 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 Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/dm-table.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/md') diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 4920998efee..05befa91807 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1001,6 +1001,11 @@ int dm_table_flush_all(struct dm_table *t) { 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); -- cgit v1.2.3