aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm/config.c')
-rw-r--r--fs/dlm/config.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 024ace9973a8..87df9616415e 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -162,7 +162,7 @@ struct spaces {
162struct space { 162struct space {
163 struct config_group group; 163 struct config_group group;
164 struct list_head members; 164 struct list_head members;
165 struct semaphore members_lock; 165 struct mutex members_lock;
166 int members_count; 166 int members_count;
167}; 167};
168 168
@@ -374,7 +374,7 @@ static struct config_group *make_space(struct config_group *g, const char *name)
374 sp->group.default_groups[1] = NULL; 374 sp->group.default_groups[1] = NULL;
375 375
376 INIT_LIST_HEAD(&sp->members); 376 INIT_LIST_HEAD(&sp->members);
377 init_MUTEX(&sp->members_lock); 377 mutex_init(&sp->members_lock);
378 sp->members_count = 0; 378 sp->members_count = 0;
379 return &sp->group; 379 return &sp->group;
380 380
@@ -453,10 +453,10 @@ static struct config_item *make_node(struct config_group *g, const char *name)
453 nd->nodeid = -1; 453 nd->nodeid = -1;
454 nd->weight = 1; /* default weight of 1 if none is set */ 454 nd->weight = 1; /* default weight of 1 if none is set */
455 455
456 down(&sp->members_lock); 456 mutex_lock(&sp->members_lock);
457 list_add(&nd->list, &sp->members); 457 list_add(&nd->list, &sp->members);
458 sp->members_count++; 458 sp->members_count++;
459 up(&sp->members_lock); 459 mutex_unlock(&sp->members_lock);
460 460
461 return &nd->item; 461 return &nd->item;
462} 462}
@@ -466,10 +466,10 @@ static void drop_node(struct config_group *g, struct config_item *i)
466 struct space *sp = to_space(g->cg_item.ci_parent); 466 struct space *sp = to_space(g->cg_item.ci_parent);
467 struct node *nd = to_node(i); 467 struct node *nd = to_node(i);
468 468
469 down(&sp->members_lock); 469 mutex_lock(&sp->members_lock);
470 list_del(&nd->list); 470 list_del(&nd->list);
471 sp->members_count--; 471 sp->members_count--;
472 up(&sp->members_lock); 472 mutex_unlock(&sp->members_lock);
473 473
474 config_item_put(i); 474 config_item_put(i);
475} 475}
@@ -677,7 +677,7 @@ int dlm_nodeid_list(char *lsname, int **ids_out)
677 if (!sp) 677 if (!sp)
678 return -EEXIST; 678 return -EEXIST;
679 679
680 down(&sp->members_lock); 680 mutex_lock(&sp->members_lock);
681 if (!sp->members_count) { 681 if (!sp->members_count) {
682 rv = 0; 682 rv = 0;
683 goto out; 683 goto out;
@@ -698,7 +698,7 @@ int dlm_nodeid_list(char *lsname, int **ids_out)
698 698
699 *ids_out = ids; 699 *ids_out = ids;
700 out: 700 out:
701 up(&sp->members_lock); 701 mutex_unlock(&sp->members_lock);
702 put_space(sp); 702 put_space(sp);
703 return rv; 703 return rv;
704} 704}
@@ -713,14 +713,14 @@ int dlm_node_weight(char *lsname, int nodeid)
713 if (!sp) 713 if (!sp)
714 goto out; 714 goto out;
715 715
716 down(&sp->members_lock); 716 mutex_lock(&sp->members_lock);
717 list_for_each_entry(nd, &sp->members, list) { 717 list_for_each_entry(nd, &sp->members, list) {
718 if (nd->nodeid != nodeid) 718 if (nd->nodeid != nodeid)
719 continue; 719 continue;
720 w = nd->weight; 720 w = nd->weight;
721 break; 721 break;
722 } 722 }
723 up(&sp->members_lock); 723 mutex_unlock(&sp->members_lock);
724 put_space(sp); 724 put_space(sp);
725 out: 725 out:
726 return w; 726 return w;