Lines Matching refs:nd
87 static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf);
88 static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
90 static ssize_t node_weight_read(struct dlm_node *nd, char *buf);
91 static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
625 struct dlm_node *nd; in make_node() local
627 nd = kzalloc(sizeof(struct dlm_node), GFP_NOFS); in make_node()
628 if (!nd) in make_node()
631 config_item_init_type_name(&nd->item, name, &node_type); in make_node()
632 nd->nodeid = -1; in make_node()
633 nd->weight = 1; /* default weight of 1 if none is set */ in make_node()
634 nd->new = 1; /* set to 0 once it's been read by dlm_nodeid_list() */ in make_node()
637 list_add(&nd->list, &sp->members); in make_node()
641 return &nd->item; in make_node()
647 struct dlm_node *nd = config_item_to_node(i); in drop_node() local
650 list_del(&nd->list); in drop_node()
659 struct dlm_node *nd = config_item_to_node(i); in release_node() local
660 kfree(nd); in release_node()
833 struct dlm_node *nd = config_item_to_node(i); in show_node() local
836 return nda->show ? nda->show(nd, buf) : 0; in show_node()
842 struct dlm_node *nd = config_item_to_node(i); in store_node() local
845 return nda->store ? nda->store(nd, buf, len) : -EINVAL; in store_node()
848 static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf) in node_nodeid_read() argument
850 return sprintf(buf, "%d\n", nd->nodeid); in node_nodeid_read()
853 static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf, in node_nodeid_write() argument
857 int rc = kstrtoint(buf, 0, &nd->nodeid); in node_nodeid_write()
861 dlm_comm_seq(nd->nodeid, &seq); in node_nodeid_write()
862 nd->comm_seq = seq; in node_nodeid_write()
866 static ssize_t node_weight_read(struct dlm_node *nd, char *buf) in node_weight_read() argument
868 return sprintf(buf, "%d\n", nd->weight); in node_weight_read()
871 static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, in node_weight_write() argument
874 int rc = kstrtoint(buf, 0, &nd->weight); in node_weight_write()
941 struct dlm_node *nd; in dlm_config_nodes() local
965 list_for_each_entry(nd, &sp->members, list) { in dlm_config_nodes()
966 node->nodeid = nd->nodeid; in dlm_config_nodes()
967 node->weight = nd->weight; in dlm_config_nodes()
968 node->new = nd->new; in dlm_config_nodes()
969 node->comm_seq = nd->comm_seq; in dlm_config_nodes()
972 nd->new = 0; in dlm_config_nodes()