aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorHeinz Mauelshagen <hjm@redhat.com>2008-04-24 16:43:09 -0400
committerAlasdair G Kergon <agk@redhat.com>2008-04-25 08:26:39 -0400
commit769aef30f0f505c44bbe9fcd2c911a052a386139 (patch)
tree8c9d8da4d1f173935d54398b1daf52df316fc3ca /drivers/md
parentb7fd54a70f99061721e604d72d940541e5b2b168 (diff)
dm log: move dirty region log code into separate module
Move the dirty region log code into a separate module so other targets can share the code. Signed-off-by: Heinz Mauelshagen <hjm@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/Makefile4
-rw-r--r--drivers/md/dm-log.c9
-rw-r--r--drivers/md/dm-raid1.c10
3 files changed, 11 insertions, 12 deletions
diff --git a/drivers/md/Makefile b/drivers/md/Makefile
index d9aa7edb8780..be4b069bbc58 100644
--- a/drivers/md/Makefile
+++ b/drivers/md/Makefile
@@ -6,7 +6,7 @@ dm-mod-objs := dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \
6 dm-ioctl.o dm-io.o kcopyd.o 6 dm-ioctl.o dm-io.o kcopyd.o
7dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o 7dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o
8dm-snapshot-objs := dm-snap.o dm-exception-store.o 8dm-snapshot-objs := dm-snap.o dm-exception-store.o
9dm-mirror-objs := dm-log.o dm-raid1.o 9dm-mirror-objs := dm-raid1.o
10dm-rdac-objs := dm-mpath-rdac.o 10dm-rdac-objs := dm-mpath-rdac.o
11dm-hp-sw-objs := dm-mpath-hp-sw.o 11dm-hp-sw-objs := dm-mpath-hp-sw.o
12md-mod-objs := md.o bitmap.o 12md-mod-objs := md.o bitmap.o
@@ -39,7 +39,7 @@ obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o
39obj-$(CONFIG_DM_MULTIPATH_HP) += dm-hp-sw.o 39obj-$(CONFIG_DM_MULTIPATH_HP) += dm-hp-sw.o
40obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o 40obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o
41obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o 41obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o
42obj-$(CONFIG_DM_MIRROR) += dm-mirror.o 42obj-$(CONFIG_DM_MIRROR) += dm-mirror.o dm-log.o
43obj-$(CONFIG_DM_ZERO) += dm-zero.o 43obj-$(CONFIG_DM_ZERO) += dm-zero.o
44 44
45quiet_cmd_unroll = UNROLL $@ 45quiet_cmd_unroll = UNROLL $@
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 34c25b0073ec..f6b20def2ac8 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -777,7 +777,7 @@ int __init dm_dirty_log_init(void)
777 return r; 777 return r;
778} 778}
779 779
780void dm_dirty_log_exit(void) 780void __exit dm_dirty_log_exit(void)
781{ 781{
782 dm_unregister_dirty_log_type(&_disk_type); 782 dm_unregister_dirty_log_type(&_disk_type);
783 dm_unregister_dirty_log_type(&_core_type); 783 dm_unregister_dirty_log_type(&_core_type);
@@ -787,3 +787,10 @@ EXPORT_SYMBOL(dm_register_dirty_log_type);
787EXPORT_SYMBOL(dm_unregister_dirty_log_type); 787EXPORT_SYMBOL(dm_unregister_dirty_log_type);
788EXPORT_SYMBOL(dm_create_dirty_log); 788EXPORT_SYMBOL(dm_create_dirty_log);
789EXPORT_SYMBOL(dm_destroy_dirty_log); 789EXPORT_SYMBOL(dm_destroy_dirty_log);
790
791module_init(dm_dirty_log_init);
792module_exit(dm_dirty_log_exit);
793
794MODULE_DESCRIPTION(DM_NAME " dirty region log");
795MODULE_AUTHOR("Joe Thornber, Heinz Mauelshagen <dm-devel@redhat.com>");
796MODULE_LICENSE("GPL");
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 64489e714c95..c4ce01180b6f 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -1862,15 +1862,9 @@ static int __init dm_mirror_init(void)
1862{ 1862{
1863 int r; 1863 int r;
1864 1864
1865 r = dm_dirty_log_init();
1866 if (r)
1867 return r;
1868
1869 r = dm_register_target(&mirror_target); 1865 r = dm_register_target(&mirror_target);
1870 if (r < 0) { 1866 if (r < 0)
1871 DMERR("Failed to register mirror target"); 1867 DMERR("Failed to register mirror target");
1872 dm_dirty_log_exit();
1873 }
1874 1868
1875 return r; 1869 return r;
1876} 1870}
@@ -1882,8 +1876,6 @@ static void __exit dm_mirror_exit(void)
1882 r = dm_unregister_target(&mirror_target); 1876 r = dm_unregister_target(&mirror_target);
1883 if (r < 0) 1877 if (r < 0)
1884 DMERR("unregister failed %d", r); 1878 DMERR("unregister failed %d", r);
1885
1886 dm_dirty_log_exit();
1887} 1879}
1888 1880
1889/* Module hooks */ 1881/* Module hooks */