stackglue.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. /* -*- mode: c; c-basic-offset: 8; -*-
  2. * vim: noexpandtab sw=8 ts=8 sts=0:
  3. *
  4. * stackglue.c
  5. *
  6. * Code which implements an OCFS2 specific interface to underlying
  7. * cluster stacks.
  8. *
  9. * Copyright (C) 2007 Oracle. All rights reserved.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public
  13. * License as published by the Free Software Foundation, version 2.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. */
  20. #include <linux/list.h>
  21. #include <linux/spinlock.h>
  22. #include <linux/module.h>
  23. #include <linux/slab.h>
  24. #include <linux/kmod.h>
  25. #include <linux/fs.h>
  26. #include <linux/kobject.h>
  27. #include <linux/sysfs.h>
  28. #include <linux/sysctl.h>
  29. #include "ocfs2_fs.h"
  30. #include "stackglue.h"
  31. #define OCFS2_STACK_PLUGIN_O2CB "o2cb"
  32. #define OCFS2_STACK_PLUGIN_USER "user"
  33. #define OCFS2_MAX_HB_CTL_PATH 256
  34. static struct ocfs2_locking_protocol *lproto;
  35. static DEFINE_SPINLOCK(ocfs2_stack_lock);
  36. static LIST_HEAD(ocfs2_stack_list);
  37. static char cluster_stack_name[OCFS2_STACK_LABEL_LEN + 1];
  38. static char ocfs2_hb_ctl_path[OCFS2_MAX_HB_CTL_PATH] = "/sbin/ocfs2_hb_ctl";
  39. /*
  40. * The stack currently in use. If not null, active_stack->sp_count > 0,
  41. * the module is pinned, and the locking protocol cannot be changed.
  42. */
  43. static struct ocfs2_stack_plugin *active_stack;
  44. static struct ocfs2_stack_plugin *ocfs2_stack_lookup(const char *name)
  45. {
  46. struct ocfs2_stack_plugin *p;
  47. assert_spin_locked(&ocfs2_stack_lock);
  48. list_for_each_entry(p, &ocfs2_stack_list, sp_list) {
  49. if (!strcmp(p->sp_name, name))
  50. return p;
  51. }
  52. return NULL;
  53. }
  54. static int ocfs2_stack_driver_request(const char *stack_name,
  55. const char *plugin_name)
  56. {
  57. int rc;
  58. struct ocfs2_stack_plugin *p;
  59. spin_lock(&ocfs2_stack_lock);
  60. /*
  61. * If the stack passed by the filesystem isn't the selected one,
  62. * we can't continue.
  63. */
  64. if (strcmp(stack_name, cluster_stack_name)) {
  65. rc = -EBUSY;
  66. goto out;
  67. }
  68. if (active_stack) {
  69. /*
  70. * If the active stack isn't the one we want, it cannot
  71. * be selected right now.
  72. */
  73. if (!strcmp(active_stack->sp_name, plugin_name))
  74. rc = 0;
  75. else
  76. rc = -EBUSY;
  77. goto out;
  78. }
  79. p = ocfs2_stack_lookup(plugin_name);
  80. if (!p || !try_module_get(p->sp_owner)) {
  81. rc = -ENOENT;
  82. goto out;
  83. }
  84. /* Ok, the stack is pinned */
  85. p->sp_count++;
  86. active_stack = p;
  87. rc = 0;
  88. out:
  89. spin_unlock(&ocfs2_stack_lock);
  90. return rc;
  91. }
  92. /*
  93. * This function looks up the appropriate stack and makes it active. If
  94. * there is no stack, it tries to load it. It will fail if the stack still
  95. * cannot be found. It will also fail if a different stack is in use.
  96. */
  97. static int ocfs2_stack_driver_get(const char *stack_name)
  98. {
  99. int rc;
  100. char *plugin_name = OCFS2_STACK_PLUGIN_O2CB;
  101. /*
  102. * Classic stack does not pass in a stack name. This is
  103. * compatible with older tools as well.
  104. */
  105. if (!stack_name || !*stack_name)
  106. stack_name = OCFS2_STACK_PLUGIN_O2CB;
  107. if (strlen(stack_name) != OCFS2_STACK_LABEL_LEN) {
  108. printk(KERN_ERR
  109. "ocfs2 passed an invalid cluster stack label: \"%s\"\n",
  110. stack_name);
  111. return -EINVAL;
  112. }
  113. /* Anything that isn't the classic stack is a user stack */
  114. if (strcmp(stack_name, OCFS2_STACK_PLUGIN_O2CB))
  115. plugin_name = OCFS2_STACK_PLUGIN_USER;
  116. rc = ocfs2_stack_driver_request(stack_name, plugin_name);
  117. if (rc == -ENOENT) {
  118. request_module("ocfs2_stack_%s", plugin_name);
  119. rc = ocfs2_stack_driver_request(stack_name, plugin_name);
  120. }
  121. if (rc == -ENOENT) {
  122. printk(KERN_ERR
  123. "ocfs2: Cluster stack driver \"%s\" cannot be found\n",
  124. plugin_name);
  125. } else if (rc == -EBUSY) {
  126. printk(KERN_ERR
  127. "ocfs2: A different cluster stack is in use\n");
  128. }
  129. return rc;
  130. }
  131. static void ocfs2_stack_driver_put(void)
  132. {
  133. spin_lock(&ocfs2_stack_lock);
  134. BUG_ON(active_stack == NULL);
  135. BUG_ON(active_stack->sp_count == 0);
  136. active_stack->sp_count--;
  137. if (!active_stack->sp_count) {
  138. module_put(active_stack->sp_owner);
  139. active_stack = NULL;
  140. }
  141. spin_unlock(&ocfs2_stack_lock);
  142. }
  143. int ocfs2_stack_glue_register(struct ocfs2_stack_plugin *plugin)
  144. {
  145. int rc;
  146. spin_lock(&ocfs2_stack_lock);
  147. if (!ocfs2_stack_lookup(plugin->sp_name)) {
  148. plugin->sp_count = 0;
  149. plugin->sp_proto = lproto;
  150. list_add(&plugin->sp_list, &ocfs2_stack_list);
  151. printk(KERN_INFO "ocfs2: Registered cluster interface %s\n",
  152. plugin->sp_name);
  153. rc = 0;
  154. } else {
  155. printk(KERN_ERR "ocfs2: Stack \"%s\" already registered\n",
  156. plugin->sp_name);
  157. rc = -EEXIST;
  158. }
  159. spin_unlock(&ocfs2_stack_lock);
  160. return rc;
  161. }
  162. EXPORT_SYMBOL_GPL(ocfs2_stack_glue_register);
  163. void ocfs2_stack_glue_unregister(struct ocfs2_stack_plugin *plugin)
  164. {
  165. struct ocfs2_stack_plugin *p;
  166. spin_lock(&ocfs2_stack_lock);
  167. p = ocfs2_stack_lookup(plugin->sp_name);
  168. if (p) {
  169. BUG_ON(p != plugin);
  170. BUG_ON(plugin == active_stack);
  171. BUG_ON(plugin->sp_count != 0);
  172. list_del_init(&plugin->sp_list);
  173. printk(KERN_INFO "ocfs2: Unregistered cluster interface %s\n",
  174. plugin->sp_name);
  175. } else {
  176. printk(KERN_ERR "Stack \"%s\" is not registered\n",
  177. plugin->sp_name);
  178. }
  179. spin_unlock(&ocfs2_stack_lock);
  180. }
  181. EXPORT_SYMBOL_GPL(ocfs2_stack_glue_unregister);
  182. void ocfs2_stack_glue_set_locking_protocol(struct ocfs2_locking_protocol *proto)
  183. {
  184. struct ocfs2_stack_plugin *p;
  185. BUG_ON(proto == NULL);
  186. spin_lock(&ocfs2_stack_lock);
  187. BUG_ON(active_stack != NULL);
  188. lproto = proto;
  189. list_for_each_entry(p, &ocfs2_stack_list, sp_list) {
  190. p->sp_proto = lproto;
  191. }
  192. spin_unlock(&ocfs2_stack_lock);
  193. }
  194. EXPORT_SYMBOL_GPL(ocfs2_stack_glue_set_locking_protocol);
  195. /*
  196. * The ocfs2_dlm_lock() and ocfs2_dlm_unlock() functions take
  197. * "struct ocfs2_lock_res *astarg" instead of "void *astarg" because the
  198. * underlying stack plugins need to pilfer the lksb off of the lock_res.
  199. * If some other structure needs to be passed as an astarg, the plugins
  200. * will need to be given a different avenue to the lksb.
  201. */
  202. int ocfs2_dlm_lock(struct ocfs2_cluster_connection *conn,
  203. int mode,
  204. union ocfs2_dlm_lksb *lksb,
  205. u32 flags,
  206. void *name,
  207. unsigned int namelen,
  208. struct ocfs2_lock_res *astarg)
  209. {
  210. BUG_ON(lproto == NULL);
  211. return active_stack->sp_ops->dlm_lock(conn, mode, lksb, flags,
  212. name, namelen, astarg);
  213. }
  214. EXPORT_SYMBOL_GPL(ocfs2_dlm_lock);
  215. int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn,
  216. union ocfs2_dlm_lksb *lksb,
  217. u32 flags,
  218. struct ocfs2_lock_res *astarg)
  219. {
  220. BUG_ON(lproto == NULL);
  221. return active_stack->sp_ops->dlm_unlock(conn, lksb, flags, astarg);
  222. }
  223. EXPORT_SYMBOL_GPL(ocfs2_dlm_unlock);
  224. int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb)
  225. {
  226. return active_stack->sp_ops->lock_status(lksb);
  227. }
  228. EXPORT_SYMBOL_GPL(ocfs2_dlm_lock_status);
  229. /*
  230. * Why don't we cast to ocfs2_meta_lvb? The "clean" answer is that we
  231. * don't cast at the glue level. The real answer is that the header
  232. * ordering is nigh impossible.
  233. */
  234. void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb)
  235. {
  236. return active_stack->sp_ops->lock_lvb(lksb);
  237. }
  238. EXPORT_SYMBOL_GPL(ocfs2_dlm_lvb);
  239. void ocfs2_dlm_dump_lksb(union ocfs2_dlm_lksb *lksb)
  240. {
  241. active_stack->sp_ops->dump_lksb(lksb);
  242. }
  243. EXPORT_SYMBOL_GPL(ocfs2_dlm_dump_lksb);
  244. int ocfs2_cluster_connect(const char *stack_name,
  245. const char *group,
  246. int grouplen,
  247. void (*recovery_handler)(int node_num,
  248. void *recovery_data),
  249. void *recovery_data,
  250. struct ocfs2_cluster_connection **conn)
  251. {
  252. int rc = 0;
  253. struct ocfs2_cluster_connection *new_conn;
  254. BUG_ON(group == NULL);
  255. BUG_ON(conn == NULL);
  256. BUG_ON(recovery_handler == NULL);
  257. if (grouplen > GROUP_NAME_MAX) {
  258. rc = -EINVAL;
  259. goto out;
  260. }
  261. new_conn = kzalloc(sizeof(struct ocfs2_cluster_connection),
  262. GFP_KERNEL);
  263. if (!new_conn) {
  264. rc = -ENOMEM;
  265. goto out;
  266. }
  267. memcpy(new_conn->cc_name, group, grouplen);
  268. new_conn->cc_namelen = grouplen;
  269. new_conn->cc_recovery_handler = recovery_handler;
  270. new_conn->cc_recovery_data = recovery_data;
  271. /* Start the new connection at our maximum compatibility level */
  272. new_conn->cc_version = lproto->lp_max_version;
  273. /* This will pin the stack driver if successful */
  274. rc = ocfs2_stack_driver_get(stack_name);
  275. if (rc)
  276. goto out_free;
  277. rc = active_stack->sp_ops->connect(new_conn);
  278. if (rc) {
  279. ocfs2_stack_driver_put();
  280. goto out_free;
  281. }
  282. *conn = new_conn;
  283. out_free:
  284. if (rc)
  285. kfree(new_conn);
  286. out:
  287. return rc;
  288. }
  289. EXPORT_SYMBOL_GPL(ocfs2_cluster_connect);
  290. /* If hangup_pending is 0, the stack driver will be dropped */
  291. int ocfs2_cluster_disconnect(struct ocfs2_cluster_connection *conn,
  292. int hangup_pending)
  293. {
  294. int ret;
  295. BUG_ON(conn == NULL);
  296. ret = active_stack->sp_ops->disconnect(conn);
  297. /* XXX Should we free it anyway? */
  298. if (!ret) {
  299. kfree(conn);
  300. if (!hangup_pending)
  301. ocfs2_stack_driver_put();
  302. }
  303. return ret;
  304. }
  305. EXPORT_SYMBOL_GPL(ocfs2_cluster_disconnect);
  306. /*
  307. * Leave the group for this filesystem. This is executed by a userspace
  308. * program (stored in ocfs2_hb_ctl_path).
  309. */
  310. static void ocfs2_leave_group(const char *group)
  311. {
  312. int ret;
  313. char *argv[5], *envp[3];
  314. argv[0] = ocfs2_hb_ctl_path;
  315. argv[1] = "-K";
  316. argv[2] = "-u";
  317. argv[3] = (char *)group;
  318. argv[4] = NULL;
  319. /* minimal command environment taken from cpu_run_sbin_hotplug */
  320. envp[0] = "HOME=/";
  321. envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
  322. envp[2] = NULL;
  323. ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
  324. if (ret < 0) {
  325. printk(KERN_ERR
  326. "ocfs2: Error %d running user helper "
  327. "\"%s %s %s %s\"\n",
  328. ret, argv[0], argv[1], argv[2], argv[3]);
  329. }
  330. }
  331. /*
  332. * Hangup is a required post-umount. ocfs2-tools software expects the
  333. * filesystem to call "ocfs2_hb_ctl" during unmount. This happens
  334. * regardless of whether the DLM got started, so we can't do it
  335. * in ocfs2_cluster_disconnect(). The ocfs2_leave_group() function does
  336. * the actual work.
  337. */
  338. void ocfs2_cluster_hangup(const char *group, int grouplen)
  339. {
  340. BUG_ON(group == NULL);
  341. BUG_ON(group[grouplen] != '\0');
  342. ocfs2_leave_group(group);
  343. /* cluster_disconnect() was called with hangup_pending==1 */
  344. ocfs2_stack_driver_put();
  345. }
  346. EXPORT_SYMBOL_GPL(ocfs2_cluster_hangup);
  347. int ocfs2_cluster_this_node(unsigned int *node)
  348. {
  349. return active_stack->sp_ops->this_node(node);
  350. }
  351. EXPORT_SYMBOL_GPL(ocfs2_cluster_this_node);
  352. /*
  353. * Sysfs bits
  354. */
  355. static ssize_t ocfs2_max_locking_protocol_show(struct kobject *kobj,
  356. struct kobj_attribute *attr,
  357. char *buf)
  358. {
  359. ssize_t ret = 0;
  360. spin_lock(&ocfs2_stack_lock);
  361. if (lproto)
  362. ret = snprintf(buf, PAGE_SIZE, "%u.%u\n",
  363. lproto->lp_max_version.pv_major,
  364. lproto->lp_max_version.pv_minor);
  365. spin_unlock(&ocfs2_stack_lock);
  366. return ret;
  367. }
  368. static struct kobj_attribute ocfs2_attr_max_locking_protocol =
  369. __ATTR(max_locking_protocol, S_IFREG | S_IRUGO,
  370. ocfs2_max_locking_protocol_show, NULL);
  371. static ssize_t ocfs2_loaded_cluster_plugins_show(struct kobject *kobj,
  372. struct kobj_attribute *attr,
  373. char *buf)
  374. {
  375. ssize_t ret = 0, total = 0, remain = PAGE_SIZE;
  376. struct ocfs2_stack_plugin *p;
  377. spin_lock(&ocfs2_stack_lock);
  378. list_for_each_entry(p, &ocfs2_stack_list, sp_list) {
  379. ret = snprintf(buf, remain, "%s\n",
  380. p->sp_name);
  381. if (ret < 0) {
  382. total = ret;
  383. break;
  384. }
  385. if (ret == remain) {
  386. /* snprintf() didn't fit */
  387. total = -E2BIG;
  388. break;
  389. }
  390. total += ret;
  391. remain -= ret;
  392. }
  393. spin_unlock(&ocfs2_stack_lock);
  394. return total;
  395. }
  396. static struct kobj_attribute ocfs2_attr_loaded_cluster_plugins =
  397. __ATTR(loaded_cluster_plugins, S_IFREG | S_IRUGO,
  398. ocfs2_loaded_cluster_plugins_show, NULL);
  399. static ssize_t ocfs2_active_cluster_plugin_show(struct kobject *kobj,
  400. struct kobj_attribute *attr,
  401. char *buf)
  402. {
  403. ssize_t ret = 0;
  404. spin_lock(&ocfs2_stack_lock);
  405. if (active_stack) {
  406. ret = snprintf(buf, PAGE_SIZE, "%s\n",
  407. active_stack->sp_name);
  408. if (ret == PAGE_SIZE)
  409. ret = -E2BIG;
  410. }
  411. spin_unlock(&ocfs2_stack_lock);
  412. return ret;
  413. }
  414. static struct kobj_attribute ocfs2_attr_active_cluster_plugin =
  415. __ATTR(active_cluster_plugin, S_IFREG | S_IRUGO,
  416. ocfs2_active_cluster_plugin_show, NULL);
  417. static ssize_t ocfs2_cluster_stack_show(struct kobject *kobj,
  418. struct kobj_attribute *attr,
  419. char *buf)
  420. {
  421. ssize_t ret;
  422. spin_lock(&ocfs2_stack_lock);
  423. ret = snprintf(buf, PAGE_SIZE, "%s\n", cluster_stack_name);
  424. spin_unlock(&ocfs2_stack_lock);
  425. return ret;
  426. }
  427. static ssize_t ocfs2_cluster_stack_store(struct kobject *kobj,
  428. struct kobj_attribute *attr,
  429. const char *buf, size_t count)
  430. {
  431. size_t len = count;
  432. ssize_t ret;
  433. if (len == 0)
  434. return len;
  435. if (buf[len - 1] == '\n')
  436. len--;
  437. if ((len != OCFS2_STACK_LABEL_LEN) ||
  438. (strnlen(buf, len) != len))
  439. return -EINVAL;
  440. spin_lock(&ocfs2_stack_lock);
  441. if (active_stack) {
  442. if (!strncmp(buf, cluster_stack_name, len))
  443. ret = count;
  444. else
  445. ret = -EBUSY;
  446. } else {
  447. memcpy(cluster_stack_name, buf, len);
  448. ret = count;
  449. }
  450. spin_unlock(&ocfs2_stack_lock);
  451. return ret;
  452. }
  453. static struct kobj_attribute ocfs2_attr_cluster_stack =
  454. __ATTR(cluster_stack, S_IFREG | S_IRUGO | S_IWUSR,
  455. ocfs2_cluster_stack_show,
  456. ocfs2_cluster_stack_store);
  457. static struct attribute *ocfs2_attrs[] = {
  458. &ocfs2_attr_max_locking_protocol.attr,
  459. &ocfs2_attr_loaded_cluster_plugins.attr,
  460. &ocfs2_attr_active_cluster_plugin.attr,
  461. &ocfs2_attr_cluster_stack.attr,
  462. NULL,
  463. };
  464. static struct attribute_group ocfs2_attr_group = {
  465. .attrs = ocfs2_attrs,
  466. };
  467. static struct kset *ocfs2_kset;
  468. static void ocfs2_sysfs_exit(void)
  469. {
  470. kset_unregister(ocfs2_kset);
  471. }
  472. static int ocfs2_sysfs_init(void)
  473. {
  474. int ret;
  475. ocfs2_kset = kset_create_and_add("ocfs2", NULL, fs_kobj);
  476. if (!ocfs2_kset)
  477. return -ENOMEM;
  478. ret = sysfs_create_group(&ocfs2_kset->kobj, &ocfs2_attr_group);
  479. if (ret)
  480. goto error;
  481. return 0;
  482. error:
  483. kset_unregister(ocfs2_kset);
  484. return ret;
  485. }
  486. /*
  487. * Sysctl bits
  488. *
  489. * The sysctl lives at /proc/sys/fs/ocfs2/nm/hb_ctl_path. The 'nm' doesn't
  490. * make as much sense in a multiple cluster stack world, but it's safer
  491. * and easier to preserve the name.
  492. */
  493. #define FS_OCFS2_NM 1
  494. static ctl_table ocfs2_nm_table[] = {
  495. {
  496. .ctl_name = 1,
  497. .procname = "hb_ctl_path",
  498. .data = ocfs2_hb_ctl_path,
  499. .maxlen = OCFS2_MAX_HB_CTL_PATH,
  500. .mode = 0644,
  501. .proc_handler = &proc_dostring,
  502. .strategy = &sysctl_string,
  503. },
  504. { .ctl_name = 0 }
  505. };
  506. static ctl_table ocfs2_mod_table[] = {
  507. {
  508. .ctl_name = FS_OCFS2_NM,
  509. .procname = "nm",
  510. .data = NULL,
  511. .maxlen = 0,
  512. .mode = 0555,
  513. .child = ocfs2_nm_table
  514. },
  515. { .ctl_name = 0}
  516. };
  517. static ctl_table ocfs2_kern_table[] = {
  518. {
  519. .ctl_name = FS_OCFS2,
  520. .procname = "ocfs2",
  521. .data = NULL,
  522. .maxlen = 0,
  523. .mode = 0555,
  524. .child = ocfs2_mod_table
  525. },
  526. { .ctl_name = 0}
  527. };
  528. static ctl_table ocfs2_root_table[] = {
  529. {
  530. .ctl_name = CTL_FS,
  531. .procname = "fs",
  532. .data = NULL,
  533. .maxlen = 0,
  534. .mode = 0555,
  535. .child = ocfs2_kern_table
  536. },
  537. { .ctl_name = 0 }
  538. };
  539. static struct ctl_table_header *ocfs2_table_header = NULL;
  540. /*
  541. * Initialization
  542. */
  543. static int __init ocfs2_stack_glue_init(void)
  544. {
  545. strcpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB);
  546. ocfs2_table_header = register_sysctl_table(ocfs2_root_table);
  547. if (!ocfs2_table_header) {
  548. printk(KERN_ERR
  549. "ocfs2 stack glue: unable to register sysctl\n");
  550. return -ENOMEM; /* or something. */
  551. }
  552. return ocfs2_sysfs_init();
  553. }
  554. static void __exit ocfs2_stack_glue_exit(void)
  555. {
  556. lproto = NULL;
  557. ocfs2_sysfs_exit();
  558. if (ocfs2_table_header)
  559. unregister_sysctl_table(ocfs2_table_header);
  560. }
  561. MODULE_AUTHOR("Oracle");
  562. MODULE_DESCRIPTION("ocfs2 cluter stack glue layer");
  563. MODULE_LICENSE("GPL");
  564. module_init(ocfs2_stack_glue_init);
  565. module_exit(ocfs2_stack_glue_exit);