Lines Matching refs:nd
82 static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf);
83 static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
85 static ssize_t node_weight_read(struct dlm_node *nd, char *buf);
86 static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
570 struct dlm_node *nd; in make_node() local
572 nd = kzalloc(sizeof(struct dlm_node), GFP_KERNEL); in make_node()
573 if (!nd) in make_node()
576 config_item_init_type_name(&nd->item, name, &node_type); in make_node()
577 nd->nodeid = -1; in make_node()
578 nd->weight = 1; /* default weight of 1 if none is set */ in make_node()
579 nd->new = 1; /* set to 0 once it's been read by dlm_nodeid_list() */ in make_node()
582 list_add(&nd->list, &sp->members); in make_node()
586 return &nd->item; in make_node()
592 struct dlm_node *nd = config_item_to_node(i); in drop_node() local
595 list_del(&nd->list); in drop_node()
604 struct dlm_node *nd = config_item_to_node(i); in release_node() local
605 kfree(nd); in release_node()
720 struct dlm_node *nd = config_item_to_node(i); in show_node() local
723 return nda->show ? nda->show(nd, buf) : 0; in show_node()
729 struct dlm_node *nd = config_item_to_node(i); in store_node() local
732 return nda->store ? nda->store(nd, buf, len) : -EINVAL; in store_node()
735 static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf) in node_nodeid_read() argument
737 return sprintf(buf, "%d\n", nd->nodeid); in node_nodeid_read()
740 static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf, in node_nodeid_write() argument
743 nd->nodeid = simple_strtol(buf, NULL, 0); in node_nodeid_write()
747 static ssize_t node_weight_read(struct dlm_node *nd, char *buf) in node_weight_read() argument
749 return sprintf(buf, "%d\n", nd->weight); in node_weight_read()
752 static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, in node_weight_write() argument
755 nd->weight = simple_strtol(buf, NULL, 0); in node_weight_write()
854 struct dlm_node *nd; in dlm_nodeid_list() local
877 list_for_each_entry(nd, &sp->members, list) { in dlm_nodeid_list()
878 ids[i++] = nd->nodeid; in dlm_nodeid_list()
879 if (nd->new) in dlm_nodeid_list()
897 list_for_each_entry(nd, &sp->members, list) { in dlm_nodeid_list()
898 if (nd->new) { in dlm_nodeid_list()
899 new[i++] = nd->nodeid; in dlm_nodeid_list()
900 nd->new = 0; in dlm_nodeid_list()
918 struct dlm_node *nd; in dlm_node_weight() local
926 list_for_each_entry(nd, &sp->members, list) { in dlm_node_weight()
927 if (nd->nodeid != nodeid) in dlm_node_weight()
929 w = nd->weight; in dlm_node_weight()