struct hlist_node *hnode,
void *nodemap_list_head);
+bool nodemap_mgs(void);
int nodemap_idx_nodemap_add(const struct lu_nodemap *nodemap);
int nodemap_idx_nodemap_update(const struct lu_nodemap *nodemap);
int nodemap_idx_nodemap_del(const struct lu_nodemap *nodemap);
/* MGS index is different than others, others are listeners to MGS idx */
static struct nm_config_file *nodemap_mgs_ncf;
+bool nodemap_mgs(void)
+{
+ return (nodemap_mgs_ncf != NULL);
+}
+
static void nodemap_cluster_key_init(struct nodemap_key *nk, unsigned int nm_id,
enum nodemap_cluster_rec_subid subid)
{
ENTRY;
if (idx == NULL) {
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
int rc2 = 0;
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
int rc = 0;
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
int rc = 0;
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
- CERROR("cannot add nodemap config to non-existing MGS.\n");
+ if (!nodemap_mgs()) {
+ CERROR("cannot del nodemap config from non-existing MGS.\n");
return -EINVAL;
}
int rc = 0;
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
int rc = 0;
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
int rc = 0;
ENTRY;
- if (nodemap_mgs_ncf == NULL) {
+ if (!nodemap_mgs()) {
CERROR("cannot add nodemap config to non-existing MGS.\n");
return -EINVAL;
}
int rc = 0;
ENTRY;
- if (nodemap_mgs_ncf != NULL)
+ if (nodemap_mgs())
GOTO(out, ncf = ERR_PTR(-EEXIST));
OBD_ALLOC_PTR(ncf);