blob: 96734cdb9b452e33555b742754474d28dc44d5e6 [file] [log] [blame]
Goldwyn Rodrigues8e854e92014-03-07 11:21:15 -06001/*
2 * Copyright (C) 2015, SUSE
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
8 *
9 */
10
11
12#include <linux/module.h>
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -060013#include <linux/dlm.h>
14#include <linux/sched.h>
15#include "md.h"
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -050016#include "bitmap.h"
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -050017#include "md-cluster.h"
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -060018
19#define LVB_SIZE 64
20
21struct dlm_lock_resource {
22 dlm_lockspace_t *ls;
23 struct dlm_lksb lksb;
24 char *name; /* lock name. */
25 uint32_t flags; /* flags to pass to dlm_lock() */
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -060026 struct completion completion; /* completion for synchronized locking */
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -050027 void (*bast)(void *arg, int mode); /* blocking AST function pointer*/
28 struct mddev *mddev; /* pointing back to mddev. */
29};
30
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -050031struct suspend_info {
32 int slot;
33 sector_t lo;
34 sector_t hi;
35 struct list_head list;
36};
37
38struct resync_info {
39 __le64 lo;
40 __le64 hi;
41};
42
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -050043struct md_cluster_info {
44 /* dlm lock space and resources for clustered raid. */
45 dlm_lockspace_t *lockspace;
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -050046 int slot_number;
47 struct completion completion;
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -050048 struct dlm_lock_resource *sb_lock;
49 struct mutex sb_mutex;
Goldwyn Rodrigues54519c52014-06-06 12:12:32 -050050 struct dlm_lock_resource *bitmap_lockres;
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -050051 struct list_head suspend_list;
52 spinlock_t suspend_lock;
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -050053 struct md_thread *recovery_thread;
54 unsigned long recovery_map;
Goldwyn Rodrigues46646802014-06-07 01:08:29 -050055 /* communication loc resources */
56 struct dlm_lock_resource *ack_lockres;
57 struct dlm_lock_resource *message_lockres;
58 struct dlm_lock_resource *token_lockres;
59 struct md_thread *recv_thread;
60};
61
62enum msg_type {
63 METADATA_UPDATED = 0,
64 RESYNCING,
65};
66
67struct cluster_msg {
68 int type;
69 int slot;
70 sector_t low;
71 sector_t high;
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -060072};
73
74static void sync_ast(void *arg)
75{
76 struct dlm_lock_resource *res;
77
78 res = (struct dlm_lock_resource *) arg;
79 complete(&res->completion);
80}
81
82static int dlm_lock_sync(struct dlm_lock_resource *res, int mode)
83{
84 int ret = 0;
85
86 init_completion(&res->completion);
87 ret = dlm_lock(res->ls, mode, &res->lksb,
88 res->flags, res->name, strlen(res->name),
89 0, sync_ast, res, res->bast);
90 if (ret)
91 return ret;
92 wait_for_completion(&res->completion);
93 return res->lksb.sb_status;
94}
95
96static int dlm_unlock_sync(struct dlm_lock_resource *res)
97{
98 return dlm_lock_sync(res, DLM_LOCK_NL);
99}
100
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500101static struct dlm_lock_resource *lockres_init(struct mddev *mddev,
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -0600102 char *name, void (*bastfn)(void *arg, int mode), int with_lvb)
103{
104 struct dlm_lock_resource *res = NULL;
105 int ret, namelen;
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500106 struct md_cluster_info *cinfo = mddev->cluster_info;
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -0600107
108 res = kzalloc(sizeof(struct dlm_lock_resource), GFP_KERNEL);
109 if (!res)
110 return NULL;
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500111 res->ls = cinfo->lockspace;
112 res->mddev = mddev;
Goldwyn Rodrigues47741b72014-03-07 13:49:26 -0600113 namelen = strlen(name);
114 res->name = kzalloc(namelen + 1, GFP_KERNEL);
115 if (!res->name) {
116 pr_err("md-cluster: Unable to allocate resource name for resource %s\n", name);
117 goto out_err;
118 }
119 strlcpy(res->name, name, namelen + 1);
120 if (with_lvb) {
121 res->lksb.sb_lvbptr = kzalloc(LVB_SIZE, GFP_KERNEL);
122 if (!res->lksb.sb_lvbptr) {
123 pr_err("md-cluster: Unable to allocate LVB for resource %s\n", name);
124 goto out_err;
125 }
126 res->flags = DLM_LKF_VALBLK;
127 }
128
129 if (bastfn)
130 res->bast = bastfn;
131
132 res->flags |= DLM_LKF_EXPEDITE;
133
134 ret = dlm_lock_sync(res, DLM_LOCK_NL);
135 if (ret) {
136 pr_err("md-cluster: Unable to lock NL on new lock resource %s\n", name);
137 goto out_err;
138 }
139 res->flags &= ~DLM_LKF_EXPEDITE;
140 res->flags |= DLM_LKF_CONVERT;
141
142 return res;
143out_err:
144 kfree(res->lksb.sb_lvbptr);
145 kfree(res->name);
146 kfree(res);
147 return NULL;
148}
149
150static void lockres_free(struct dlm_lock_resource *res)
151{
152 if (!res)
153 return;
154
155 init_completion(&res->completion);
156 dlm_unlock(res->ls, res->lksb.sb_lkid, 0, &res->lksb, res);
157 wait_for_completion(&res->completion);
158
159 kfree(res->name);
160 kfree(res->lksb.sb_lvbptr);
161 kfree(res);
162}
Goldwyn Rodrigues8e854e92014-03-07 11:21:15 -0600163
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500164static char *pretty_uuid(char *dest, char *src)
165{
166 int i, len = 0;
167
168 for (i = 0; i < 16; i++) {
169 if (i == 4 || i == 6 || i == 8 || i == 10)
170 len += sprintf(dest + len, "-");
171 len += sprintf(dest + len, "%02x", (__u8)src[i]);
172 }
173 return dest;
174}
175
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -0500176static void add_resync_info(struct mddev *mddev, struct dlm_lock_resource *lockres,
177 sector_t lo, sector_t hi)
178{
179 struct resync_info *ri;
180
181 ri = (struct resync_info *)lockres->lksb.sb_lvbptr;
182 ri->lo = cpu_to_le64(lo);
183 ri->hi = cpu_to_le64(hi);
184}
185
186static struct suspend_info *read_resync_info(struct mddev *mddev, struct dlm_lock_resource *lockres)
187{
188 struct resync_info ri;
189 struct suspend_info *s = NULL;
190 sector_t hi = 0;
191
192 dlm_lock_sync(lockres, DLM_LOCK_CR);
193 memcpy(&ri, lockres->lksb.sb_lvbptr, sizeof(struct resync_info));
194 hi = le64_to_cpu(ri.hi);
195 if (ri.hi > 0) {
196 s = kzalloc(sizeof(struct suspend_info), GFP_KERNEL);
197 if (!s)
198 goto out;
199 s->hi = hi;
200 s->lo = le64_to_cpu(ri.lo);
201 }
202 dlm_unlock_sync(lockres);
203out:
204 return s;
205}
206
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -0500207void recover_bitmaps(struct md_thread *thread)
208{
209 struct mddev *mddev = thread->mddev;
210 struct md_cluster_info *cinfo = mddev->cluster_info;
211 struct dlm_lock_resource *bm_lockres;
212 char str[64];
213 int slot, ret;
214 struct suspend_info *s, *tmp;
215 sector_t lo, hi;
216
217 while (cinfo->recovery_map) {
218 slot = fls64((u64)cinfo->recovery_map) - 1;
219
220 /* Clear suspend_area associated with the bitmap */
221 spin_lock_irq(&cinfo->suspend_lock);
222 list_for_each_entry_safe(s, tmp, &cinfo->suspend_list, list)
223 if (slot == s->slot) {
224 list_del(&s->list);
225 kfree(s);
226 }
227 spin_unlock_irq(&cinfo->suspend_lock);
228
229 snprintf(str, 64, "bitmap%04d", slot);
230 bm_lockres = lockres_init(mddev, str, NULL, 1);
231 if (!bm_lockres) {
232 pr_err("md-cluster: Cannot initialize bitmaps\n");
233 goto clear_bit;
234 }
235
236 ret = dlm_lock_sync(bm_lockres, DLM_LOCK_PW);
237 if (ret) {
238 pr_err("md-cluster: Could not DLM lock %s: %d\n",
239 str, ret);
240 goto clear_bit;
241 }
242 ret = bitmap_copy_from_slot(mddev, slot, &lo, &hi);
Goldwyn Rodrigues4b26a082014-06-07 00:52:29 -0500243 if (ret) {
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -0500244 pr_err("md-cluster: Could not copy data from bitmap %d\n", slot);
Goldwyn Rodrigues4b26a082014-06-07 00:52:29 -0500245 goto dlm_unlock;
246 }
247 if (hi > 0) {
248 /* TODO:Wait for current resync to get over */
249 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
250 if (lo < mddev->recovery_cp)
251 mddev->recovery_cp = lo;
252 md_check_recovery(mddev);
253 }
254dlm_unlock:
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -0500255 dlm_unlock_sync(bm_lockres);
256clear_bit:
257 clear_bit(slot, &cinfo->recovery_map);
258 }
259}
260
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500261static void recover_prep(void *arg)
262{
263}
264
265static void recover_slot(void *arg, struct dlm_slot *slot)
266{
267 struct mddev *mddev = arg;
268 struct md_cluster_info *cinfo = mddev->cluster_info;
269
270 pr_info("md-cluster: %s Node %d/%d down. My slot: %d. Initiating recovery.\n",
271 mddev->bitmap_info.cluster_name,
272 slot->nodeid, slot->slot,
273 cinfo->slot_number);
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -0500274 set_bit(slot->slot - 1, &cinfo->recovery_map);
275 if (!cinfo->recovery_thread) {
276 cinfo->recovery_thread = md_register_thread(recover_bitmaps,
277 mddev, "recover");
278 if (!cinfo->recovery_thread) {
279 pr_warn("md-cluster: Could not create recovery thread\n");
280 return;
281 }
282 }
283 md_wakeup_thread(cinfo->recovery_thread);
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500284}
285
286static void recover_done(void *arg, struct dlm_slot *slots,
287 int num_slots, int our_slot,
288 uint32_t generation)
289{
290 struct mddev *mddev = arg;
291 struct md_cluster_info *cinfo = mddev->cluster_info;
292
293 cinfo->slot_number = our_slot;
294 complete(&cinfo->completion);
295}
296
297static const struct dlm_lockspace_ops md_ls_ops = {
298 .recover_prep = recover_prep,
299 .recover_slot = recover_slot,
300 .recover_done = recover_done,
301};
302
Goldwyn Rodrigues46646802014-06-07 01:08:29 -0500303/*
304 * The BAST function for the ack lock resource
305 * This function wakes up the receive thread in
306 * order to receive and process the message.
307 */
308static void ack_bast(void *arg, int mode)
309{
310 struct dlm_lock_resource *res = (struct dlm_lock_resource *)arg;
311 struct md_cluster_info *cinfo = res->mddev->cluster_info;
312
313 if (mode == DLM_LOCK_EX)
314 md_wakeup_thread(cinfo->recv_thread);
315}
316
317static void process_recvd_msg(struct mddev *mddev, struct cluster_msg *msg)
318{
319 switch (msg->type) {
320 case METADATA_UPDATED:
321 pr_info("%s: %d Received message: METADATA_UPDATE from %d\n",
322 __func__, __LINE__, msg->slot);
323 break;
324 case RESYNCING:
325 pr_info("%s: %d Received message: RESYNCING from %d\n",
326 __func__, __LINE__, msg->slot);
327 break;
328 };
329}
330
331/*
332 * thread for receiving message
333 */
334static void recv_daemon(struct md_thread *thread)
335{
336 struct md_cluster_info *cinfo = thread->mddev->cluster_info;
337 struct dlm_lock_resource *ack_lockres = cinfo->ack_lockres;
338 struct dlm_lock_resource *message_lockres = cinfo->message_lockres;
339 struct cluster_msg msg;
340
341 /*get CR on Message*/
342 if (dlm_lock_sync(message_lockres, DLM_LOCK_CR)) {
343 pr_err("md/raid1:failed to get CR on MESSAGE\n");
344 return;
345 }
346
347 /* read lvb and wake up thread to process this message_lockres */
348 memcpy(&msg, message_lockres->lksb.sb_lvbptr, sizeof(struct cluster_msg));
349 process_recvd_msg(thread->mddev, &msg);
350
351 /*release CR on ack_lockres*/
352 dlm_unlock_sync(ack_lockres);
353 /*up-convert to EX on message_lockres*/
354 dlm_lock_sync(message_lockres, DLM_LOCK_EX);
355 /*get CR on ack_lockres again*/
356 dlm_lock_sync(ack_lockres, DLM_LOCK_CR);
357 /*release CR on message_lockres*/
358 dlm_unlock_sync(message_lockres);
359}
360
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -0500361static int gather_all_resync_info(struct mddev *mddev, int total_slots)
362{
363 struct md_cluster_info *cinfo = mddev->cluster_info;
364 int i, ret = 0;
365 struct dlm_lock_resource *bm_lockres;
366 struct suspend_info *s;
367 char str[64];
368
369
370 for (i = 0; i < total_slots; i++) {
371 memset(str, '\0', 64);
372 snprintf(str, 64, "bitmap%04d", i);
373 bm_lockres = lockres_init(mddev, str, NULL, 1);
374 if (!bm_lockres)
375 return -ENOMEM;
376 if (i == (cinfo->slot_number - 1))
377 continue;
378
379 bm_lockres->flags |= DLM_LKF_NOQUEUE;
380 ret = dlm_lock_sync(bm_lockres, DLM_LOCK_PW);
381 if (ret == -EAGAIN) {
382 memset(bm_lockres->lksb.sb_lvbptr, '\0', LVB_SIZE);
383 s = read_resync_info(mddev, bm_lockres);
384 if (s) {
385 pr_info("%s:%d Resync[%llu..%llu] in progress on %d\n",
386 __func__, __LINE__,
387 (unsigned long long) s->lo,
388 (unsigned long long) s->hi, i);
389 spin_lock_irq(&cinfo->suspend_lock);
390 s->slot = i;
391 list_add(&s->list, &cinfo->suspend_list);
392 spin_unlock_irq(&cinfo->suspend_lock);
393 }
394 ret = 0;
395 lockres_free(bm_lockres);
396 continue;
397 }
398 if (ret)
399 goto out;
400 /* TODO: Read the disk bitmap sb and check if it needs recovery */
401 dlm_unlock_sync(bm_lockres);
402 lockres_free(bm_lockres);
403 }
404out:
405 return ret;
406}
407
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500408static int join(struct mddev *mddev, int nodes)
409{
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500410 struct md_cluster_info *cinfo;
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500411 int ret, ops_rv;
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500412 char str[64];
413
414 if (!try_module_get(THIS_MODULE))
415 return -ENOENT;
416
417 cinfo = kzalloc(sizeof(struct md_cluster_info), GFP_KERNEL);
418 if (!cinfo)
419 return -ENOMEM;
420
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500421 init_completion(&cinfo->completion);
422
423 mutex_init(&cinfo->sb_mutex);
424 mddev->cluster_info = cinfo;
425
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500426 memset(str, 0, 64);
427 pretty_uuid(str, mddev->uuid);
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500428 ret = dlm_new_lockspace(str, mddev->bitmap_info.cluster_name,
429 DLM_LSFL_FS, LVB_SIZE,
430 &md_ls_ops, mddev, &ops_rv, &cinfo->lockspace);
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500431 if (ret)
432 goto err;
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500433 wait_for_completion(&cinfo->completion);
Goldwyn Rodriguesb97e92572014-06-06 11:50:56 -0500434 if (nodes <= cinfo->slot_number) {
435 pr_err("md-cluster: Slot allotted(%d) greater than available slots(%d)", cinfo->slot_number - 1,
436 nodes);
437 ret = -ERANGE;
438 goto err;
439 }
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500440 cinfo->sb_lock = lockres_init(mddev, "cmd-super",
441 NULL, 0);
442 if (!cinfo->sb_lock) {
443 ret = -ENOMEM;
444 goto err;
445 }
Goldwyn Rodrigues46646802014-06-07 01:08:29 -0500446 /* Initiate the communication resources */
447 ret = -ENOMEM;
448 cinfo->recv_thread = md_register_thread(recv_daemon, mddev, "cluster_recv");
449 if (!cinfo->recv_thread) {
450 pr_err("md-cluster: cannot allocate memory for recv_thread!\n");
451 goto err;
452 }
453 cinfo->message_lockres = lockres_init(mddev, "message", NULL, 1);
454 if (!cinfo->message_lockres)
455 goto err;
456 cinfo->token_lockres = lockres_init(mddev, "token", NULL, 0);
457 if (!cinfo->token_lockres)
458 goto err;
459 cinfo->ack_lockres = lockres_init(mddev, "ack", ack_bast, 0);
460 if (!cinfo->ack_lockres)
461 goto err;
462 /* get sync CR lock on ACK. */
463 if (dlm_lock_sync(cinfo->ack_lockres, DLM_LOCK_CR))
464 pr_err("md-cluster: failed to get a sync CR lock on ACK!(%d)\n",
465 ret);
Goldwyn Rodrigues54519c52014-06-06 12:12:32 -0500466
467 pr_info("md-cluster: Joined cluster %s slot %d\n", str, cinfo->slot_number);
468 snprintf(str, 64, "bitmap%04d", cinfo->slot_number - 1);
469 cinfo->bitmap_lockres = lockres_init(mddev, str, NULL, 1);
470 if (!cinfo->bitmap_lockres)
471 goto err;
472 if (dlm_lock_sync(cinfo->bitmap_lockres, DLM_LOCK_PW)) {
473 pr_err("Failed to get bitmap lock\n");
474 ret = -EINVAL;
475 goto err;
476 }
477
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -0500478 INIT_LIST_HEAD(&cinfo->suspend_list);
479 spin_lock_init(&cinfo->suspend_lock);
480
481 ret = gather_all_resync_info(mddev, nodes);
482 if (ret)
483 goto err;
484
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500485 return 0;
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500486err:
Goldwyn Rodrigues46646802014-06-07 01:08:29 -0500487 lockres_free(cinfo->message_lockres);
488 lockres_free(cinfo->token_lockres);
489 lockres_free(cinfo->ack_lockres);
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -0500490 lockres_free(cinfo->bitmap_lockres);
491 lockres_free(cinfo->sb_lock);
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500492 if (cinfo->lockspace)
493 dlm_release_lockspace(cinfo->lockspace, 2);
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500494 mddev->cluster_info = NULL;
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500495 kfree(cinfo);
496 module_put(THIS_MODULE);
497 return ret;
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500498}
499
500static int leave(struct mddev *mddev)
501{
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500502 struct md_cluster_info *cinfo = mddev->cluster_info;
503
504 if (!cinfo)
505 return 0;
Goldwyn Rodriguese94987d2014-06-07 00:45:22 -0500506 md_unregister_thread(&cinfo->recovery_thread);
Goldwyn Rodrigues46646802014-06-07 01:08:29 -0500507 md_unregister_thread(&cinfo->recv_thread);
508 lockres_free(cinfo->message_lockres);
509 lockres_free(cinfo->token_lockres);
510 lockres_free(cinfo->ack_lockres);
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500511 lockres_free(cinfo->sb_lock);
Goldwyn Rodrigues54519c52014-06-06 12:12:32 -0500512 lockres_free(cinfo->bitmap_lockres);
Goldwyn Rodriguesc4ce8672014-03-29 10:20:02 -0500513 dlm_release_lockspace(cinfo->lockspace, 2);
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500514 return 0;
515}
516
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500517/* slot_number(): Returns the MD slot number to use
518 * DLM starts the slot numbers from 1, wheras cluster-md
519 * wants the number to be from zero, so we deduct one
520 */
521static int slot_number(struct mddev *mddev)
522{
523 struct md_cluster_info *cinfo = mddev->cluster_info;
524
525 return cinfo->slot_number - 1;
526}
527
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -0500528static void resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi)
529{
530 struct md_cluster_info *cinfo = mddev->cluster_info;
531
532 add_resync_info(mddev, cinfo->bitmap_lockres, lo, hi);
533 /* Re-acquire the lock to refresh LVB */
534 dlm_lock_sync(cinfo->bitmap_lockres, DLM_LOCK_PW);
535}
536
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500537static struct md_cluster_operations cluster_ops = {
538 .join = join,
539 .leave = leave,
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -0500540 .slot_number = slot_number,
Goldwyn Rodrigues96ae9232014-06-06 12:35:34 -0500541 .resync_info_update = resync_info_update,
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500542};
543
Goldwyn Rodrigues8e854e92014-03-07 11:21:15 -0600544static int __init cluster_init(void)
545{
546 pr_warn("md-cluster: EXPERIMENTAL. Use with caution\n");
547 pr_info("Registering Cluster MD functions\n");
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500548 register_md_cluster_operations(&cluster_ops, THIS_MODULE);
Goldwyn Rodrigues8e854e92014-03-07 11:21:15 -0600549 return 0;
550}
551
552static void cluster_exit(void)
553{
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -0500554 unregister_md_cluster_operations();
Goldwyn Rodrigues8e854e92014-03-07 11:21:15 -0600555}
556
557module_init(cluster_init);
558module_exit(cluster_exit);
559MODULE_LICENSE("GPL");
560MODULE_DESCRIPTION("Clustering support for MD");