aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn Reeves <breeves@redhat.com>2006-10-03 04:15:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:16 -0400
commit999d816851c3e080412a19558f111d01852d2f04 (patch)
tree8b75a8e97d6fa7c41e81169e9b2ba5f7806e23a9
parent3cb4021453a69585e458ec2177677c0c1300dccf (diff)
[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 <breeves@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/md/dm-table.c5
-rw-r--r--include/linux/device-mapper.h2
-rw-r--r--include/linux/dm-ioctl.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 4920998efeeb..05befa91807a 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)
1001{ 1001{
1002 struct list_head *d, *devices = dm_table_get_devices(t); 1002 struct list_head *d, *devices = dm_table_get_devices(t);
1003 int ret = 0; 1003 int ret = 0;
1004 unsigned i;
1005
1006 for (i = 0; i < t->num_targets; i++)
1007 if (t->targets[i].type->flush)
1008 t->targets[i].type->flush(&t->targets[i]);
1004 1009
1005 for (d = devices->next; d != devices; d = d->next) { 1010 for (d = devices->next; d != devices; d = d->next) {
1006 struct dm_dev *dd = list_entry(d, struct dm_dev, list); 1011 struct dm_dev *dd = list_entry(d, struct dm_dev, list);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 7a48d428d0a1..03ef41c1eaac 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -55,6 +55,7 @@ typedef int (*dm_endio_fn) (struct dm_target *ti,
55 struct bio *bio, int error, 55 struct bio *bio, int error,
56 union map_info *map_context); 56 union map_info *map_context);
57 57
58typedef void (*dm_flush_fn) (struct dm_target *ti);
58typedef void (*dm_presuspend_fn) (struct dm_target *ti); 59typedef void (*dm_presuspend_fn) (struct dm_target *ti);
59typedef void (*dm_postsuspend_fn) (struct dm_target *ti); 60typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
60typedef int (*dm_preresume_fn) (struct dm_target *ti); 61typedef int (*dm_preresume_fn) (struct dm_target *ti);
@@ -96,6 +97,7 @@ struct target_type {
96 dm_dtr_fn dtr; 97 dm_dtr_fn dtr;
97 dm_map_fn map; 98 dm_map_fn map;
98 dm_endio_fn end_io; 99 dm_endio_fn end_io;
100 dm_flush_fn flush;
99 dm_presuspend_fn presuspend; 101 dm_presuspend_fn presuspend;
100 dm_postsuspend_fn postsuspend; 102 dm_postsuspend_fn postsuspend;
101 dm_preresume_fn preresume; 103 dm_preresume_fn preresume;
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index f28b5c87aa6b..8853fc4d1c5e 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -285,7 +285,7 @@ typedef char ioctl_struct[308];
285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
286 286
287#define DM_VERSION_MAJOR 4 287#define DM_VERSION_MAJOR 4
288#define DM_VERSION_MINOR 9 288#define DM_VERSION_MINOR 10
289#define DM_VERSION_PATCHLEVEL 0 289#define DM_VERSION_PATCHLEVEL 0
290#define DM_VERSION_EXTRA "-ioctl (2006-09-14)" 290#define DM_VERSION_EXTRA "-ioctl (2006-09-14)"
291 291