Whamcloud - gitweb
Branch b1_8_gate
authoradilger <adilger>
Fri, 1 Aug 2008 19:05:02 +0000 (19:05 +0000)
committeradilger <adilger>
Fri, 1 Aug 2008 19:05:02 +0000 (19:05 +0000)
Cleanup compiler warnings, whitespace.
b=11817

lustre/llite/lproc_llite.c

index a0e427a..a85d1b1 100644 (file)
@@ -318,7 +318,7 @@ static int ll_wr_max_cached_mb(struct file *file, const char *buffer,
         spin_lock(&sbi->ll_lock);
         sbi->ll_async_page_max = pages_number ;
         spin_unlock(&sbi->ll_lock);
-        
+
         if (!sbi->ll_osc_exp)
                 /* Not set up yet, don't call llap_shrink_cache */
                 return count;
@@ -335,8 +335,8 @@ static int ll_wr_max_cached_mb(struct file *file, const char *buffer,
         return count;
 }
 
-static int ll_rd_pgcache_bnlc(char *page, char **start, off_t off,
-                          int count, int *eof, void *data)
+static int ll_rd_pgcache_balance(char *page, char **start, off_t off,
+                                 int count, int *eof, void *data)
 {
         struct super_block *sb = data;
         struct ll_sb_info *sbi = ll_s2sbi(sb);
@@ -344,21 +344,21 @@ static int ll_rd_pgcache_bnlc(char *page, char **start, off_t off,
         unsigned long total_budget = 0;
         int n = 0, cpu;
 
-        n += snprintf(page +n, count - n, 
-                "cpu\tpage count\tbudget\t\treblnc count\tgen\thit\tmiss\tcross\n");
+        n += snprintf(page +n, count - n, "cpu\tpage count\tbudget"
+                      "\t\treblnc count\tgen\thit\tmiss\tcross\n");
         for_each_online_cpu(cpu) {
                 pd = LL_PGLIST_DATA_CPU(sbi, cpu);
-                n += snprintf(page + n, count - n, 
-                              "%d\t%-8lu\t%-8lu\t%-8lu\t%lu\t%u\t%u\t%u\n", 
+                n += snprintf(page + n, count - n,
+                              "%d\t%-8lu\t%-8lu\t%-8lu\t%lu\t%lu\t%lu\t%lu\n",
                               cpu, pd->llpd_count, pd->llpd_budget,
-                              pd->llpd_reblnc_count, pd->llpd_gen, 
+                              pd->llpd_reblnc_count, pd->llpd_gen,
                               pd->llpd_hit, pd->llpd_miss, pd->llpd_cross);
                 total_budget += pd->llpd_budget;
         }
-        n += snprintf(page + n, count - n, 
-                "Total budget: %lu, page max: %lu, rebalance cnt: %lu\n", 
-                total_budget, sbi->ll_async_page_max, 
-                sbi->ll_async_page_reblnc_count);
+        n += snprintf(page + n, count - n,
+                      "Total budget: %lu, page max: %lu, rebalance cnt: %lu\n",
+                      total_budget, sbi->ll_async_page_max,
+                      sbi->ll_async_page_reblnc_count);
         *eof = 1;
         return n;
 }
@@ -421,7 +421,7 @@ static int ll_wr_max_rw_chunk(struct file *file, const char *buffer,
         return count;
 }
 
-static int ll_rd_track_id(char *page, int count, void *data, 
+static int ll_rd_track_id(char *page, int count, void *data,
                           enum stats_track_type type)
 {
         struct super_block *sb = data;
@@ -429,7 +429,7 @@ static int ll_rd_track_id(char *page, int count, void *data,
         if (ll_s2sbi(sb)->ll_stats_track_type == type) {
                 return snprintf(page, count, "%d\n",
                                 ll_s2sbi(sb)->ll_stats_track_id);
-        
+
         } else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL) {
                 return snprintf(page, count, "0 (all)\n");
         } else {
@@ -487,7 +487,7 @@ static int ll_rd_track_gid(char *page, char **start, off_t off,
 
 static int ll_wr_track_gid(struct file *file, const char *buffer,
                           unsigned long count, void *data)
-{                                                                 
+{
         return (ll_wr_track_id(buffer, count, data, STATS_TRACK_GID));
 }
 
@@ -598,7 +598,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
         { "max_read_ahead_whole_mb", ll_rd_max_read_ahead_whole_mb,
                                      ll_wr_max_read_ahead_whole_mb, 0 },
         { "max_cached_mb",  ll_rd_max_cached_mb, ll_wr_max_cached_mb, 0 },
-        { "pgcache_balance",ll_rd_pgcache_bnlc, 0, 0 },
+        { "pgcache_balance",ll_rd_pgcache_balance, 0, 0 },
         { "checksum_pages", ll_rd_checksum, ll_wr_checksum, 0 },
         { "max_rw_chunk",   ll_rd_max_rw_chunk, ll_wr_max_rw_chunk, 0 },
         { "stats_track_pid",  ll_rd_track_pid, ll_wr_track_pid, 0 },
@@ -719,12 +719,12 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
         len = strlen(lsi->lsi_lmd->lmd_profile);
         ptr = strrchr(lsi->lsi_lmd->lmd_profile, '-');
         if (ptr && (strcmp(ptr, "-client") == 0))
-                len -= 7; 
-        
+                len -= 7;
+
         /* Mount info */
         snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
                  lsi->lsi_lmd->lmd_profile, sb);
-        
+
         sbi->ll_proc_root = lprocfs_register(name, parent, NULL, NULL);
         if (IS_ERR(sbi->ll_proc_root)) {
                 err = PTR_ERR(sbi->ll_proc_root);
@@ -741,9 +741,9 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
         sbi->ll_ra_stats = lprocfs_alloc_stats(LL_RA_STAT,
                                                LPROCFS_STATS_FLAG_PERCPU);
         for (id = 0; id < LL_RA_STAT; id++)
-                lprocfs_counter_init(sbi->ll_ra_stats, id, 0, 
+                lprocfs_counter_init(sbi->ll_ra_stats, id, 0,
                         ra_stats_string[id], "pages");
-        lprocfs_register_stats(sbi->ll_proc_root, "read_ahead_stats", 
+        lprocfs_register_stats(sbi->ll_proc_root, "read_ahead_stats",
                 sbi->ll_ra_stats);
 
         entry = create_proc_entry("extents_stats", 0644, sbi->ll_proc_root);
@@ -766,7 +766,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
         entry->data = sbi;
 
         /* File operations stats */
-        sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES, 
+        sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
                                             LPROCFS_STATS_FLAG_PERCPU);
         if (sbi->ll_stats == NULL)
                 GOTO(out, err = -ENOMEM);
@@ -928,7 +928,7 @@ static int llite_dump_pgcache_seq_show(struct seq_file *seq, void *v)
         return 0;
 }
 
-static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v, 
+static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
                                          loff_t *pos)
 {
         struct ll_async_page *llap, *dummy_llap = seq->private;
@@ -946,7 +946,7 @@ static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
          * we advance to a position beyond it, returning null if there
          * isn't another llap in the list beyond that new position. */
         pd = ll_pglist_cpu_lock(sbi, cpu);
-        llap = llite_pglist_next_llap(&pd->llpd_list, 
+        llap = llite_pglist_next_llap(&pd->llpd_list,
                         &dummy_llap->llap_pglist_item);
         list_del_init(&dummy_llap->llap_pglist_item);
         if (llap) {
@@ -963,7 +963,7 @@ static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
                         ll_pglist_cpu_unlock(sbi, i);
                 }
                 if (next != NULL) {
-                        list_move(&dummy_llap->llap_pglist_item, 
+                        list_move(&dummy_llap->llap_pglist_item,
                                   &next->llpd_list);
                         dummy_llap->llap_pglist_cpu = i;
                         ll_pglist_cpu_unlock(sbi, cpu);
@@ -1126,7 +1126,7 @@ static int ll_rw_extents_stats_pp_seq_show(struct seq_file *seq, void *v)
         seq_printf(seq, "snapshot_time:         %lu.%lu (secs.usecs)\n",
                    now.tv_sec, now.tv_usec);
         seq_printf(seq, "%15s %19s       | %20s\n", " ", "read", "write");
-        seq_printf(seq, "%13s   %14s %4s %4s  | %14s %4s %4s\n", 
+        seq_printf(seq, "%13s   %14s %4s %4s  | %14s %4s %4s\n",
                    "extents", "calls", "%", "cum%",
                    "calls", "%", "cum%");
         spin_lock(&sbi->ll_pp_extent_lock);
@@ -1180,7 +1180,7 @@ static int ll_rw_extents_stats_seq_show(struct seq_file *seq, void *v)
                    now.tv_sec, now.tv_usec);
 
         seq_printf(seq, "%15s %19s       | %20s\n", " ", "read", "write");
-        seq_printf(seq, "%13s   %14s %4s %4s  | %14s %4s %4s\n", 
+        seq_printf(seq, "%13s   %14s %4s %4s  | %14s %4s %4s\n",
                    "extents", "calls", "%", "cum%",
                    "calls", "%", "cum%");
         spin_lock(&sbi->ll_lock);
@@ -1239,15 +1239,15 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid, struct file
 
         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 =
+                        (sbi->ll_extent_process_count+1) % LL_PROCESS_HIST_MAX;
                 cur = sbi->ll_extent_process_count;
                 io_extents->pp_extents[cur].pid = pid;
                 lprocfs_oh_clear(&io_extents->pp_extents[cur].pp_r_hist);
                 lprocfs_oh_clear(&io_extents->pp_extents[cur].pp_w_hist);
         }
 
-        for(i = 0; (count >= (1 << LL_HIST_START << i)) && 
+        for(i = 0; (count >= (1 << LL_HIST_START << i)) &&
              (i < (LL_HIST_MAX - 1)); i++);
         if (rw == 0) {
                 io_extents->pp_extents[cur].pp_r_hist.oh_buckets[i]++;