提交 769aef30 编写于 作者: H Heinz Mauelshagen 提交者: Alasdair G Kergon

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: NHeinz Mauelshagen <hjm@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 b7fd54a7
...@@ -6,7 +6,7 @@ dm-mod-objs := dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \ ...@@ -6,7 +6,7 @@ dm-mod-objs := dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \
dm-ioctl.o dm-io.o kcopyd.o dm-ioctl.o dm-io.o kcopyd.o
dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o
dm-snapshot-objs := dm-snap.o dm-exception-store.o dm-snapshot-objs := dm-snap.o dm-exception-store.o
dm-mirror-objs := dm-log.o dm-raid1.o dm-mirror-objs := dm-raid1.o
dm-rdac-objs := dm-mpath-rdac.o dm-rdac-objs := dm-mpath-rdac.o
dm-hp-sw-objs := dm-mpath-hp-sw.o dm-hp-sw-objs := dm-mpath-hp-sw.o
md-mod-objs := md.o bitmap.o md-mod-objs := md.o bitmap.o
...@@ -39,7 +39,7 @@ obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o ...@@ -39,7 +39,7 @@ obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o
obj-$(CONFIG_DM_MULTIPATH_HP) += dm-hp-sw.o obj-$(CONFIG_DM_MULTIPATH_HP) += dm-hp-sw.o
obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o
obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o
obj-$(CONFIG_DM_MIRROR) += dm-mirror.o obj-$(CONFIG_DM_MIRROR) += dm-mirror.o dm-log.o
obj-$(CONFIG_DM_ZERO) += dm-zero.o obj-$(CONFIG_DM_ZERO) += dm-zero.o
quiet_cmd_unroll = UNROLL $@ quiet_cmd_unroll = UNROLL $@
......
...@@ -777,7 +777,7 @@ int __init dm_dirty_log_init(void) ...@@ -777,7 +777,7 @@ int __init dm_dirty_log_init(void)
return r; return r;
} }
void dm_dirty_log_exit(void) void __exit dm_dirty_log_exit(void)
{ {
dm_unregister_dirty_log_type(&_disk_type); dm_unregister_dirty_log_type(&_disk_type);
dm_unregister_dirty_log_type(&_core_type); dm_unregister_dirty_log_type(&_core_type);
...@@ -787,3 +787,10 @@ EXPORT_SYMBOL(dm_register_dirty_log_type); ...@@ -787,3 +787,10 @@ EXPORT_SYMBOL(dm_register_dirty_log_type);
EXPORT_SYMBOL(dm_unregister_dirty_log_type); EXPORT_SYMBOL(dm_unregister_dirty_log_type);
EXPORT_SYMBOL(dm_create_dirty_log); EXPORT_SYMBOL(dm_create_dirty_log);
EXPORT_SYMBOL(dm_destroy_dirty_log); EXPORT_SYMBOL(dm_destroy_dirty_log);
module_init(dm_dirty_log_init);
module_exit(dm_dirty_log_exit);
MODULE_DESCRIPTION(DM_NAME " dirty region log");
MODULE_AUTHOR("Joe Thornber, Heinz Mauelshagen <dm-devel@redhat.com>");
MODULE_LICENSE("GPL");
...@@ -1862,15 +1862,9 @@ static int __init dm_mirror_init(void) ...@@ -1862,15 +1862,9 @@ static int __init dm_mirror_init(void)
{ {
int r; int r;
r = dm_dirty_log_init();
if (r)
return r;
r = dm_register_target(&mirror_target); r = dm_register_target(&mirror_target);
if (r < 0) { if (r < 0)
DMERR("Failed to register mirror target"); DMERR("Failed to register mirror target");
dm_dirty_log_exit();
}
return r; return r;
} }
...@@ -1882,8 +1876,6 @@ static void __exit dm_mirror_exit(void) ...@@ -1882,8 +1876,6 @@ static void __exit dm_mirror_exit(void)
r = dm_unregister_target(&mirror_target); r = dm_unregister_target(&mirror_target);
if (r < 0) if (r < 0)
DMERR("unregister failed %d", r); DMERR("unregister failed %d", r);
dm_dirty_log_exit();
} }
/* Module hooks */ /* Module hooks */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册