Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Bryn Reeves and committed by
Linus Torvalds
999d8168 3cb40214

+8 -1
+5
drivers/md/dm-table.c
··· 1001 1001 { 1002 1002 struct list_head *d, *devices = dm_table_get_devices(t); 1003 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 1010 for (d = devices->next; d != devices; d = d->next) { 1006 1011 struct dm_dev *dd = list_entry(d, struct dm_dev, list);
+2
include/linux/device-mapper.h
··· 55 55 struct bio *bio, int error, 56 56 union map_info *map_context); 57 57 58 + typedef void (*dm_flush_fn) (struct dm_target *ti); 58 59 typedef void (*dm_presuspend_fn) (struct dm_target *ti); 59 60 typedef void (*dm_postsuspend_fn) (struct dm_target *ti); 60 61 typedef int (*dm_preresume_fn) (struct dm_target *ti); ··· 97 96 dm_dtr_fn dtr; 98 97 dm_map_fn map; 99 98 dm_endio_fn end_io; 99 + dm_flush_fn flush; 100 100 dm_presuspend_fn presuspend; 101 101 dm_postsuspend_fn postsuspend; 102 102 dm_preresume_fn preresume;
+1 -1
include/linux/dm-ioctl.h
··· 285 285 #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 286 286 287 287 #define DM_VERSION_MAJOR 4 288 - #define DM_VERSION_MINOR 9 288 + #define DM_VERSION_MINOR 10 289 289 #define DM_VERSION_PATCHLEVEL 0 290 290 #define DM_VERSION_EXTRA "-ioctl (2006-09-14)" 291 291