diff options
Diffstat (limited to 'fs/ocfs2/cluster/heartbeat.c')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 8e19b9d7aba8..16eff45727ee 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -1312,9 +1312,7 @@ static int o2hb_debug_init(void) int ret = -ENOMEM; o2hb_debug_dir = debugfs_create_dir(O2HB_DEBUG_DIR, NULL); - if (IS_ERR_OR_NULL(o2hb_debug_dir)) { - ret = o2hb_debug_dir ? - PTR_ERR(o2hb_debug_dir) : -ENOMEM; + if (!o2hb_debug_dir) { mlog_errno(ret); goto bail; } @@ -1327,9 +1325,7 @@ static int o2hb_debug_init(void) sizeof(o2hb_live_node_bitmap), O2NM_MAX_NODES, o2hb_live_node_bitmap); - if (IS_ERR_OR_NULL(o2hb_debug_livenodes)) { - ret = o2hb_debug_livenodes ? - PTR_ERR(o2hb_debug_livenodes) : -ENOMEM; + if (!o2hb_debug_livenodes) { mlog_errno(ret); goto bail; } @@ -1342,9 +1338,7 @@ static int o2hb_debug_init(void) sizeof(o2hb_live_region_bitmap), O2NM_MAX_REGIONS, o2hb_live_region_bitmap); - if (IS_ERR_OR_NULL(o2hb_debug_liveregions)) { - ret = o2hb_debug_liveregions ? - PTR_ERR(o2hb_debug_liveregions) : -ENOMEM; + if (!o2hb_debug_liveregions) { mlog_errno(ret); goto bail; } @@ -1358,9 +1352,7 @@ static int o2hb_debug_init(void) sizeof(o2hb_quorum_region_bitmap), O2NM_MAX_REGIONS, o2hb_quorum_region_bitmap); - if (IS_ERR_OR_NULL(o2hb_debug_quorumregions)) { - ret = o2hb_debug_quorumregions ? - PTR_ERR(o2hb_debug_quorumregions) : -ENOMEM; + if (!o2hb_debug_quorumregions) { mlog_errno(ret); goto bail; } @@ -1374,9 +1366,7 @@ static int o2hb_debug_init(void) sizeof(o2hb_failed_region_bitmap), O2NM_MAX_REGIONS, o2hb_failed_region_bitmap); - if (IS_ERR_OR_NULL(o2hb_debug_failedregions)) { - ret = o2hb_debug_failedregions ? - PTR_ERR(o2hb_debug_failedregions) : -ENOMEM; + if (!o2hb_debug_failedregions) { mlog_errno(ret); goto bail; } @@ -2010,8 +2000,7 @@ static int o2hb_debug_region_init(struct o2hb_region *reg, struct dentry *dir) reg->hr_debug_dir = debugfs_create_dir(config_item_name(®->hr_item), dir); - if (IS_ERR_OR_NULL(reg->hr_debug_dir)) { - ret = reg->hr_debug_dir ? PTR_ERR(reg->hr_debug_dir) : -ENOMEM; + if (!reg->hr_debug_dir) { mlog_errno(ret); goto bail; } @@ -2024,9 +2013,7 @@ static int o2hb_debug_region_init(struct o2hb_region *reg, struct dentry *dir) O2HB_DB_TYPE_REGION_LIVENODES, sizeof(reg->hr_live_node_bitmap), O2NM_MAX_NODES, reg); - if (IS_ERR_OR_NULL(reg->hr_debug_livenodes)) { - ret = reg->hr_debug_livenodes ? - PTR_ERR(reg->hr_debug_livenodes) : -ENOMEM; + if (!reg->hr_debug_livenodes) { mlog_errno(ret); goto bail; } @@ -2038,9 +2025,7 @@ static int o2hb_debug_region_init(struct o2hb_region *reg, struct dentry *dir) sizeof(*(reg->hr_db_regnum)), O2HB_DB_TYPE_REGION_NUMBER, 0, O2NM_MAX_NODES, reg); - if (IS_ERR_OR_NULL(reg->hr_debug_regnum)) { - ret = reg->hr_debug_regnum ? - PTR_ERR(reg->hr_debug_regnum) : -ENOMEM; + if (!reg->hr_debug_regnum) { mlog_errno(ret); goto bail; } @@ -2052,9 +2037,7 @@ static int o2hb_debug_region_init(struct o2hb_region *reg, struct dentry *dir) sizeof(*(reg->hr_db_elapsed_time)), O2HB_DB_TYPE_REGION_ELAPSED_TIME, 0, 0, reg); - if (IS_ERR_OR_NULL(reg->hr_debug_elapsed_time)) { - ret = reg->hr_debug_elapsed_time ? - PTR_ERR(reg->hr_debug_elapsed_time) : -ENOMEM; + if (!reg->hr_debug_elapsed_time) { mlog_errno(ret); goto bail; } @@ -2066,16 +2049,13 @@ static int o2hb_debug_region_init(struct o2hb_region *reg, struct dentry *dir) sizeof(*(reg->hr_db_pinned)), O2HB_DB_TYPE_REGION_PINNED, 0, 0, reg); - if (IS_ERR_OR_NULL(reg->hr_debug_pinned)) { - ret = reg->hr_debug_pinned ? - PTR_ERR(reg->hr_debug_pinned) : -ENOMEM; + if (!reg->hr_debug_pinned) { mlog_errno(ret); goto bail; } - return 0; + ret = 0; bail: - debugfs_remove_recursive(reg->hr_debug_dir); return ret; } |