aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-log.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2008-04-24 16:43:38 -0400
committerAlasdair G Kergon <agk@redhat.com>2008-04-25 08:26:47 -0400
commitb8206bc3de0b0665d47655d270c18ea46aff5372 (patch)
treeae52f89c65b36f12887015104a37c4178303e889 /drivers/md/dm-log.c
parent416cd17b1982217bca3dc41b9f00b0b38fdaadad (diff)
dm log: move register functions
Reorder a couple of functions in the file so the next patch is readable. Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r--drivers/md/dm-log.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index b776701cc8fa..82df73f67a0d 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -19,32 +19,6 @@
19static LIST_HEAD(_log_types); 19static LIST_HEAD(_log_types);
20static DEFINE_SPINLOCK(_lock); 20static DEFINE_SPINLOCK(_lock);
21 21
22int dm_dirty_log_type_register(struct dm_dirty_log_type *type)
23{
24 spin_lock(&_lock);
25 type->use_count = 0;
26 list_add(&type->list, &_log_types);
27 spin_unlock(&_lock);
28
29 return 0;
30}
31EXPORT_SYMBOL(dm_dirty_log_type_register);
32
33int dm_dirty_log_type_unregister(struct dm_dirty_log_type *type)
34{
35 spin_lock(&_lock);
36
37 if (type->use_count)
38 DMWARN("Attempt to unregister a log type that is still in use");
39 else
40 list_del(&type->list);
41
42 spin_unlock(&_lock);
43
44 return 0;
45}
46EXPORT_SYMBOL(dm_dirty_log_type_unregister);
47
48static struct dm_dirty_log_type *_get_type(const char *type_name) 22static struct dm_dirty_log_type *_get_type(const char *type_name)
49{ 23{
50 struct dm_dirty_log_type *type; 24 struct dm_dirty_log_type *type;
@@ -122,6 +96,32 @@ static void put_type(struct dm_dirty_log_type *type)
122 spin_unlock(&_lock); 96 spin_unlock(&_lock);
123} 97}
124 98
99int dm_dirty_log_type_register(struct dm_dirty_log_type *type)
100{
101 spin_lock(&_lock);
102 type->use_count = 0;
103 list_add(&type->list, &_log_types);
104 spin_unlock(&_lock);
105
106 return 0;
107}
108EXPORT_SYMBOL(dm_dirty_log_type_register);
109
110int dm_dirty_log_type_unregister(struct dm_dirty_log_type *type)
111{
112 spin_lock(&_lock);
113
114 if (type->use_count)
115 DMWARN("Attempt to unregister a log type that is still in use");
116 else
117 list_del(&type->list);
118
119 spin_unlock(&_lock);
120
121 return 0;
122}
123EXPORT_SYMBOL(dm_dirty_log_type_unregister);
124
125struct dm_dirty_log *dm_dirty_log_create(const char *type_name, 125struct dm_dirty_log *dm_dirty_log_create(const char *type_name,
126 struct dm_target *ti, 126 struct dm_target *ti,
127 unsigned int argc, char **argv) 127 unsigned int argc, char **argv)