summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/heartbeat.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-17 10:55:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-17 10:55:51 -0700
commit5b664cb235e97afbf34db9c4d77f08ebd725335e (patch)
tree518540649c38342209790de8e0b575ac1a6fa722 /fs/ocfs2/cluster/heartbeat.c
parentf39548a6ad1dbdfaab552419386ec5bb1d76fa0d (diff)
parentc0420ad2ca514551ca086510b0e7d17a05c70492 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: [PATCH] ocfs2: fix oops in mmap_truncate testing configfs: call drop_link() to cleanup after create_link() failure configfs: Allow ->make_item() and ->make_group() to return detailed errors. configfs: Fix failing mkdir() making racing rmdir() fail configfs: Fix deadlock with racing rmdir() and rename() configfs: Make configfs_new_dirent() return error code instead of NULL configfs: Protect configfs_dirent s_links list mutations configfs: Introduce configfs_dirent_lock ocfs2: Don't snprintf() without a format. ocfs2: Fix CONFIG_OCFS2_DEBUG_FS #ifdefs ocfs2/net: Silence build warnings on sparc64 ocfs2: Handle error during journal load ocfs2: Silence an error message in ocfs2_file_aio_read() ocfs2: use simple_read_from_buffer() ocfs2: fix printk format warnings with OCFS2_FS_STATS=n [PATCH 2/2] ocfs2: Instrument fs cluster locks [PATCH 1/2] ocfs2: Add CONFIG_OCFS2_FS_STATS config option
Diffstat (limited to 'fs/ocfs2/cluster/heartbeat.c')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index f02ccb34604..443d108211a 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1489,25 +1489,28 @@ static struct o2hb_heartbeat_group *to_o2hb_heartbeat_group(struct config_group
: NULL;
}
-static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *group,
- const char *name)
+static int o2hb_heartbeat_group_make_item(struct config_group *group,
+ const char *name,
+ struct config_item **new_item)
{
struct o2hb_region *reg = NULL;
- struct config_item *ret = NULL;
+ int ret = 0;
reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
- if (reg == NULL)
- goto out; /* ENOMEM */
+ if (reg == NULL) {
+ ret = -ENOMEM;
+ goto out;
+ }
config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
- ret = &reg->hr_item;
+ *new_item = &reg->hr_item;
spin_lock(&o2hb_live_lock);
list_add_tail(&reg->hr_all_item, &o2hb_all_regions);
spin_unlock(&o2hb_live_lock);
out:
- if (ret == NULL)
+ if (ret)
kfree(reg);
return ret;