aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/heartbeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/heartbeat.c')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 443d108211ab..7dce1612553e 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1489,31 +1489,22 @@ static struct o2hb_heartbeat_group *to_o2hb_heartbeat_group(struct config_group
1489 : NULL; 1489 : NULL;
1490} 1490}
1491 1491
1492static int o2hb_heartbeat_group_make_item(struct config_group *group, 1492static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *group,
1493 const char *name, 1493 const char *name)
1494 struct config_item **new_item)
1495{ 1494{
1496 struct o2hb_region *reg = NULL; 1495 struct o2hb_region *reg = NULL;
1497 int ret = 0;
1498 1496
1499 reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL); 1497 reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
1500 if (reg == NULL) { 1498 if (reg == NULL)
1501 ret = -ENOMEM; 1499 return ERR_PTR(-ENOMEM);
1502 goto out;
1503 }
1504 1500
1505 config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type); 1501 config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
1506 1502
1507 *new_item = &reg->hr_item;
1508
1509 spin_lock(&o2hb_live_lock); 1503 spin_lock(&o2hb_live_lock);
1510 list_add_tail(&reg->hr_all_item, &o2hb_all_regions); 1504 list_add_tail(&reg->hr_all_item, &o2hb_all_regions);
1511 spin_unlock(&o2hb_live_lock); 1505 spin_unlock(&o2hb_live_lock);
1512out:
1513 if (ret)
1514 kfree(reg);
1515 1506
1516 return ret; 1507 return &reg->hr_item;
1517} 1508}
1518 1509
1519static void o2hb_heartbeat_group_drop_item(struct config_group *group, 1510static void o2hb_heartbeat_group_drop_item(struct config_group *group,