• Home
  • Raw
  • Download

Lines Matching +full:cluster +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0-only
2 /* -*- mode: c; c-basic-offset: 8; -*-
8 * cluster stacks.
38 * The stack currently in use. If not null, active_stack->sp_count > 0,
50 if (!strcmp(p->sp_name, name)) in ocfs2_stack_lookup()
70 rc = -EBUSY; in ocfs2_stack_driver_request()
79 if (!strcmp(active_stack->sp_name, plugin_name)) in ocfs2_stack_driver_request()
82 rc = -EBUSY; in ocfs2_stack_driver_request()
87 if (!p || !try_module_get(p->sp_owner)) { in ocfs2_stack_driver_request()
88 rc = -ENOENT; in ocfs2_stack_driver_request()
98 active_stack->sp_count++; in ocfs2_stack_driver_request()
123 "ocfs2 passed an invalid cluster stack label: \"%s\"\n", in ocfs2_stack_driver_get()
125 return -EINVAL; in ocfs2_stack_driver_get()
133 if (rc == -ENOENT) { in ocfs2_stack_driver_get()
138 if (rc == -ENOENT) { in ocfs2_stack_driver_get()
140 "ocfs2: Cluster stack driver \"%s\" cannot be found\n", in ocfs2_stack_driver_get()
142 } else if (rc == -EBUSY) { in ocfs2_stack_driver_get()
144 "ocfs2: A different cluster stack is in use\n"); in ocfs2_stack_driver_get()
154 BUG_ON(active_stack->sp_count == 0); in ocfs2_stack_driver_put()
156 active_stack->sp_count--; in ocfs2_stack_driver_put()
157 if (!active_stack->sp_count) { in ocfs2_stack_driver_put()
158 module_put(active_stack->sp_owner); in ocfs2_stack_driver_put()
169 if (!ocfs2_stack_lookup(plugin->sp_name)) { in ocfs2_stack_glue_register()
170 plugin->sp_count = 0; in ocfs2_stack_glue_register()
171 plugin->sp_max_proto = locking_max_version; in ocfs2_stack_glue_register()
172 list_add(&plugin->sp_list, &ocfs2_stack_list); in ocfs2_stack_glue_register()
173 printk(KERN_INFO "ocfs2: Registered cluster interface %s\n", in ocfs2_stack_glue_register()
174 plugin->sp_name); in ocfs2_stack_glue_register()
178 plugin->sp_name); in ocfs2_stack_glue_register()
179 rc = -EEXIST; in ocfs2_stack_glue_register()
192 p = ocfs2_stack_lookup(plugin->sp_name); in ocfs2_stack_glue_unregister()
196 BUG_ON(plugin->sp_count != 0); in ocfs2_stack_glue_unregister()
197 list_del_init(&plugin->sp_list); in ocfs2_stack_glue_unregister()
198 printk(KERN_INFO "ocfs2: Unregistered cluster interface %s\n", in ocfs2_stack_glue_unregister()
199 plugin->sp_name); in ocfs2_stack_glue_unregister()
202 plugin->sp_name); in ocfs2_stack_glue_unregister()
219 p->sp_max_proto = locking_max_version; in ocfs2_stack_glue_set_max_proto_version()
234 int mode, in ocfs2_dlm_lock() argument
240 if (!lksb->lksb_conn) in ocfs2_dlm_lock()
241 lksb->lksb_conn = conn; in ocfs2_dlm_lock()
243 BUG_ON(lksb->lksb_conn != conn); in ocfs2_dlm_lock()
244 return active_stack->sp_ops->dlm_lock(conn, mode, lksb, flags, in ocfs2_dlm_lock()
253 BUG_ON(lksb->lksb_conn == NULL); in ocfs2_dlm_unlock()
255 return active_stack->sp_ops->dlm_unlock(conn, lksb, flags); in ocfs2_dlm_unlock()
261 return active_stack->sp_ops->lock_status(lksb); in ocfs2_dlm_lock_status()
267 return active_stack->sp_ops->lvb_valid(lksb); in ocfs2_dlm_lvb_valid()
273 return active_stack->sp_ops->lock_lvb(lksb); in ocfs2_dlm_lvb()
279 active_stack->sp_ops->dump_lksb(lksb); in ocfs2_dlm_dump_lksb()
285 return active_stack && active_stack->sp_ops->plock; in ocfs2_stack_supports_plocks()
296 WARN_ON_ONCE(active_stack->sp_ops->plock == NULL); in ocfs2_plock()
297 if (active_stack->sp_ops->plock) in ocfs2_plock()
298 return active_stack->sp_ops->plock(conn, ino, file, cmd, fl); in ocfs2_plock()
299 return -EOPNOTSUPP; in ocfs2_plock()
322 rc = -EINVAL; in ocfs2_cluster_connect()
326 if (memcmp(&lproto->lp_max_version, &locking_max_version, in ocfs2_cluster_connect()
328 rc = -EINVAL; in ocfs2_cluster_connect()
335 rc = -ENOMEM; in ocfs2_cluster_connect()
339 strlcpy(new_conn->cc_name, group, GROUP_NAME_MAX + 1); in ocfs2_cluster_connect()
340 new_conn->cc_namelen = grouplen; in ocfs2_cluster_connect()
342 strlcpy(new_conn->cc_cluster_name, cluster_name, in ocfs2_cluster_connect()
344 new_conn->cc_cluster_name_len = cluster_name_len; in ocfs2_cluster_connect()
345 new_conn->cc_recovery_handler = recovery_handler; in ocfs2_cluster_connect()
346 new_conn->cc_recovery_data = recovery_data; in ocfs2_cluster_connect()
348 new_conn->cc_proto = lproto; in ocfs2_cluster_connect()
350 new_conn->cc_version = lproto->lp_max_version; in ocfs2_cluster_connect()
357 rc = active_stack->sp_ops->connect(new_conn); in ocfs2_cluster_connect()
374 /* The caller will ensure all nodes have the same cluster stack */
401 ret = active_stack->sp_ops->disconnect(conn); in ocfs2_cluster_disconnect()
424 argv[1] = "-K"; in ocfs2_leave_group()
425 argv[2] = "-u"; in ocfs2_leave_group()
444 * Hangup is a required post-umount. ocfs2-tools software expects the
465 return active_stack->sp_ops->this_node(conn, node); in ocfs2_cluster_this_node()
504 p->sp_name); in ocfs2_loaded_cluster_plugins_show()
507 total = -E2BIG; in ocfs2_loaded_cluster_plugins_show()
511 remain -= ret; in ocfs2_loaded_cluster_plugins_show()
531 active_stack->sp_name); in ocfs2_active_cluster_plugin_show()
533 ret = -E2BIG; in ocfs2_active_cluster_plugin_show()
566 if (buf[len - 1] == '\n') in ocfs2_cluster_stack_store()
567 len--; in ocfs2_cluster_stack_store()
571 return -EINVAL; in ocfs2_cluster_stack_store()
578 ret = -EBUSY; in ocfs2_cluster_stack_store()
634 return -ENOMEM; in ocfs2_sysfs_init()
636 ret = sysfs_create_group(&ocfs2_kset->kobj, &ocfs2_attr_group); in ocfs2_sysfs_init()
651 * make as much sense in a multiple cluster stack world, but it's safer
660 .mode = 0644,
671 .mode = 0555,
682 .mode = 0555,
693 .mode = 0555,
714 return -ENOMEM; /* or something. */ in ocfs2_stack_glue_init()