diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/lproc_llite.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/lproc_llite.c | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index 77f68b507fea..3b3df9f03422 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -410,7 +410,8 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, /* easy - add more LRU slots. */ if (diff >= 0) { atomic_add(diff, &cache->ccc_lru_left); - GOTO(out, rc = 0); + rc = 0; + goto out; } diff = -diff; @@ -997,8 +998,10 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, /* File operations stats */ sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES, LPROCFS_STATS_FLAG_NONE); - if (sbi->ll_stats == NULL) - GOTO(out, err = -ENOMEM); + if (sbi->ll_stats == NULL) { + err = -ENOMEM; + goto out; + } /* do counter init */ for (id = 0; id < LPROC_LL_FILE_OPCODES; id++) { __u32 type = llite_opcode_table[id].type; @@ -1016,12 +1019,14 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, } err = lprocfs_register_stats(sbi->ll_proc_root, "stats", sbi->ll_stats); if (err) - GOTO(out, err); + goto out; sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string), LPROCFS_STATS_FLAG_NONE); - if (sbi->ll_ra_stats == NULL) - GOTO(out, err = -ENOMEM); + if (sbi->ll_ra_stats == NULL) { + err = -ENOMEM; + goto out; + } for (id = 0; id < ARRAY_SIZE(ra_stat_string); id++) lprocfs_counter_init(sbi->ll_ra_stats, id, 0, @@ -1029,12 +1034,12 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, err = lprocfs_register_stats(sbi->ll_proc_root, "read_ahead_stats", sbi->ll_ra_stats); if (err) - GOTO(out, err); + goto out; err = lprocfs_add_vars(sbi->ll_proc_root, lprocfs_llite_obd_vars, sb); if (err) - GOTO(out, err); + goto out; /* MDC info */ obd = class_name2obd(mdc); @@ -1044,20 +1049,22 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, LASSERT(obd->obd_type->typ_name != NULL); dir = proc_mkdir(obd->obd_type->typ_name, sbi->ll_proc_root); - if (dir == NULL) - GOTO(out, err = -ENOMEM); + if (dir == NULL) { + err = -ENOMEM; + goto out; + } snprintf(name, MAX_STRING_SIZE, "common_name"); lvars[0].fops = &llite_name_fops; err = lprocfs_add_vars(dir, lvars, obd); if (err) - GOTO(out, err); + goto out; snprintf(name, MAX_STRING_SIZE, "uuid"); lvars[0].fops = &llite_uuid_fops; err = lprocfs_add_vars(dir, lvars, obd); if (err) - GOTO(out, err); + goto out; /* OSC */ obd = class_name2obd(osc); @@ -1067,14 +1074,16 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, LASSERT(obd->obd_type->typ_name != NULL); dir = proc_mkdir(obd->obd_type->typ_name, sbi->ll_proc_root); - if (dir == NULL) - GOTO(out, err = -ENOMEM); + if (dir == NULL) { + err = -ENOMEM; + goto out; + } snprintf(name, MAX_STRING_SIZE, "common_name"); lvars[0].fops = &llite_name_fops; err = lprocfs_add_vars(dir, lvars, obd); if (err) - GOTO(out, err); + goto out; snprintf(name, MAX_STRING_SIZE, "uuid"); lvars[0].fops = &llite_uuid_fops; @@ -1098,7 +1107,7 @@ void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) } #undef MAX_STRING_SIZE -#define pct(a,b) (b ? a * 100 / b : 0) +#define pct(a, b) (b ? a * 100 / b : 0) static void ll_display_extents_info(struct ll_rw_extents_info *io_extents, struct seq_file *seq, int which) @@ -1113,12 +1122,12 @@ static void ll_display_extents_info(struct ll_rw_extents_info *io_extents, write_cum = 0; start = 0; - for(i = 0; i < LL_HIST_MAX; i++) { + for (i = 0; i < LL_HIST_MAX; i++) { read_tot += pp_info->pp_r_hist.oh_buckets[i]; write_tot += pp_info->pp_w_hist.oh_buckets[i]; } - for(i = 0; i < LL_HIST_MAX; i++) { + for (i = 0; i < LL_HIST_MAX; i++) { r = pp_info->pp_r_hist.oh_buckets[i]; w = pp_info->pp_w_hist.oh_buckets[i]; read_cum += r; @@ -1305,15 +1314,15 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid, int *process_count = &sbi->ll_offset_process_count; struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info; - if(!sbi->ll_rw_stats_on) + if (!sbi->ll_rw_stats_on) return; process = sbi->ll_rw_process_info; offset = sbi->ll_rw_offset_info; spin_lock(&sbi->ll_pp_extent_lock); /* Extent statistics */ - for(i = 0; i < LL_PROCESS_HIST_MAX; i++) { - if(io_extents->pp_extents[i].pid == pid) { + for (i = 0; i < LL_PROCESS_HIST_MAX; i++) { + if (io_extents->pp_extents[i].pid == pid) { cur = i; break; } @@ -1376,9 +1385,9 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid, process[i].rw_offset = pos - process[i].rw_last_file_pos; } - if(process[i].rw_smallest_extent > count) + if (process[i].rw_smallest_extent > count) process[i].rw_smallest_extent = count; - if(process[i].rw_largest_extent < count) + if (process[i].rw_largest_extent < count) process[i].rw_largest_extent = count; process[i].rw_last_file_pos = pos + count; spin_unlock(&sbi->ll_process_lock); @@ -1421,7 +1430,7 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v) "R/W", "PID", "RANGE START", "RANGE END", "SMALLEST EXTENT", "LARGEST EXTENT", "OFFSET"); /* We stored the discontiguous offsets here; print them first */ - for(i = 0; i < LL_OFFSET_HIST_MAX; i++) { + for (i = 0; i < LL_OFFSET_HIST_MAX; i++) { if (offset[i].rw_pid != 0) seq_printf(seq, "%3c %10d %14Lu %14Lu %17lu %17lu %14Lu", @@ -1434,7 +1443,7 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v) offset[i].rw_offset); } /* Then print the current offsets for each process */ - for(i = 0; i < LL_PROCESS_HIST_MAX; i++) { + for (i = 0; i < LL_PROCESS_HIST_MAX; i++) { if (process[i].rw_pid != 0) seq_printf(seq, "%3c %10d %14Lu %14Lu %17lu %17lu %14Lu", |