Whamcloud - gitweb
LU-6142 llite: Fix style issues for lproc_llite.c 06/54006/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Mon, 12 Feb 2024 10:44:00 +0000 (16:14 +0530)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Feb 2024 07:06:18 +0000 (07:06 +0000)
This patch fixes issues reported by checkpatch
for file lustre/llite/lproc_llite.c

Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Id4c96fa903323b73b4e1416835d8a8bb25043781
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54006
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/lproc_llite.c

index d7821a2..ca54967 100644 (file)
@@ -525,11 +525,10 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file,
        if (rc)
                RETURN(rc);
 
-       if (percent) {
+       if (percent)
                pages_number = cfs_totalram_pages() * value / 100;
-       } else {
+       else
                pages_number = value >> PAGE_SHIFT;
-       }
 
        if (pages_number < 0 || pages_number > cfs_totalram_pages()) {
                CERROR("%s: can't set max cache more than %lu MB\n",
@@ -1468,7 +1467,7 @@ read_ahead_async_file_threshold_mb_store(struct kobject *kobj,
 LUSTRE_RW_ATTR(read_ahead_async_file_threshold_mb);
 
 static ssize_t read_ahead_range_kb_show(struct kobject *kobj,
-                                       struct attribute *attr,char *buf)
+                                       struct attribute *attr, char *buf)
 {
        struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
                                              ll_kset.kobj);
@@ -2155,7 +2154,7 @@ static const struct llite_file_opcode {
        { LPROC_LL_READDIR,     LPROCFS_TYPE_LATENCY,   "readdir" },
        { LPROC_LL_INODE_OCOUNT, LPROCFS_TYPE_REQS | LPROCFS_CNTR_AVGMINMAX |
                                LPROCFS_CNTR_STDDEV,    "opencount" },
-       { LPROC_LL_INODE_OPCLTM,LPROCFS_TYPE_LATENCY,   "openclosetime" },
+       { LPROC_LL_INODE_OPCLTM, LPROCFS_TYPE_LATENCY,  "openclosetime" },
        /* inode operation */
        { LPROC_LL_SETATTR,     LPROCFS_TYPE_LATENCY,   "setattr" },
        { LPROC_LL_TRUNC,       LPROCFS_TYPE_LATENCY,   "truncate" },
@@ -2623,7 +2622,8 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
        if (cur == -1) {
                /* new process */
                sbi->ll_extent_process_count =
-                       (sbi->ll_extent_process_count + 1) % LL_PROCESS_HIST_MAX;
+                       (sbi->ll_extent_process_count + 1) %
+                        LL_PROCESS_HIST_MAX;
                cur = sbi->ll_extent_process_count;
                rw_extents->pp_extents[cur].pid = pid;
                lprocfs_oh_clear(&rw_extents->pp_extents[cur].pp_r_hist);
@@ -2659,28 +2659,28 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
                                process[i].rw_last_file = file;
                                goto out_unlock;
                        }
-                        if (process[i].rw_last_file_pos != pos) {
-                                *off_count =
-                                    (*off_count + 1) % LL_OFFSET_HIST_MAX;
-                                offset[*off_count].rw_op = process[i].rw_op;
-                                offset[*off_count].rw_pid = pid;
-                                offset[*off_count].rw_range_start =
-                                        process[i].rw_range_start;
-                                offset[*off_count].rw_range_end =
-                                        process[i].rw_last_file_pos;
-                                offset[*off_count].rw_smallest_extent =
-                                        process[i].rw_smallest_extent;
-                                offset[*off_count].rw_largest_extent =
-                                        process[i].rw_largest_extent;
-                                offset[*off_count].rw_offset =
-                                        process[i].rw_offset;
-                                process[i].rw_op = rw;
-                                process[i].rw_range_start = pos;
-                                process[i].rw_smallest_extent = count;
-                                process[i].rw_largest_extent = count;
-                                process[i].rw_offset = pos -
-                                        process[i].rw_last_file_pos;
-                        }
+                       if (process[i].rw_last_file_pos != pos) {
+                               *off_count =
+                                       (*off_count + 1) % LL_OFFSET_HIST_MAX;
+                               offset[*off_count].rw_op = process[i].rw_op;
+                               offset[*off_count].rw_pid = pid;
+                               offset[*off_count].rw_range_start =
+                                       process[i].rw_range_start;
+                               offset[*off_count].rw_range_end =
+                                       process[i].rw_last_file_pos;
+                               offset[*off_count].rw_smallest_extent =
+                                       process[i].rw_smallest_extent;
+                               offset[*off_count].rw_largest_extent =
+                                       process[i].rw_largest_extent;
+                               offset[*off_count].rw_offset =
+                                       process[i].rw_offset;
+                               process[i].rw_op = rw;
+                               process[i].rw_range_start = pos;
+                               process[i].rw_smallest_extent = count;
+                               process[i].rw_largest_extent = count;
+                               process[i].rw_offset = pos -
+                                       process[i].rw_last_file_pos;
+                       }
                        if (process[i].rw_smallest_extent > count)
                                process[i].rw_smallest_extent = count;
                        if (process[i].rw_largest_extent < count)
@@ -2711,7 +2711,8 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
        int i;
 
        if (!sbi->ll_rw_stats_on) {
-               seq_puts(seq, "disabled\n write anything to this file to activate, then '0' or 'disable' to deactivate\n");
+               seq_puts(seq,
+                        "disabled\n write anything to this file to activate, then '0' or 'disable' to deactivate\n");
                return 0;
        }