@@ -98,10 +98,8 @@ void fld_cache_fini(struct fld_cache *cache)
fld_cache_flush(cache);
CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name);
- CDEBUG(D_INFO, " Total reqs: %llu\n", cache->fci_stat.fst_count);
CDEBUG(D_INFO, " Cache reqs: %llu\n", cache->fci_stat.fst_cache);
- CDEBUG(D_INFO, " Cache hits: %u%%\n",
- pct(cache->fci_stat.fst_cache, cache->fci_stat.fst_count));
+ CDEBUG(D_INFO, " Total reqs: %llu\n", cache->fci_stat.fst_count);
kfree(cache);
}
@@ -58,7 +58,7 @@ struct lprocfs_vars {
umode_t proc_mode;
};
-static inline u32 pct(s64 a, s64 b)
+static inline unsigned int pct(unsigned long a, unsigned long b)
{
return b ? a * 100 / b : 0;
}
@@ -437,11 +437,10 @@ struct lmv_obd {
int connected;
int max_easize;
int max_def_easize;
+ u32 lmv_statfs_start;
u32 tgts_size; /* size of tgts array */
struct lmv_tgt_desc **tgts;
- int lmv_statfs_start;
-
struct obd_connect_data conn_data;
struct kobject *lmv_tgts_kobj;
};
@@ -1366,8 +1366,11 @@ static int lmv_select_statfs_mdt(struct lmv_obd *lmv, u32 flags)
break;
if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND) {
+ /* We dont need a full 64-bit modulus, just enough
+ * to distribute the requests across MDTs evenly.
+ */
lmv->lmv_statfs_start =
- lnet_id.nid % lmv->desc.ld_tgt_count;
+ (u32)lnet_id.nid % lmv->desc.ld_tgt_count;
break;
}
}
@@ -328,7 +328,6 @@ static ssize_t mdc_rpc_stats_seq_write(struct file *file,
return len;
}
-#define pct(a, b) (b ? a * 100 / b : 0)
static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
{
struct obd_device *dev = seq->private;
@@ -364,7 +363,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
read_cum += r;
write_cum += w;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u | %10lu %3u %3u\n",
1 << i, r, pct(r, read_tot),
pct(read_cum, read_tot), w,
pct(w, write_tot),
@@ -388,7 +387,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
read_cum += r;
write_cum += w;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u | %10lu %3u %3u\n",
i, r, pct(r, read_tot), pct(read_cum, read_tot), w,
pct(w, write_tot), pct(write_cum, write_tot));
if (read_cum == read_tot && write_cum == write_tot)
@@ -410,7 +409,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
read_cum += r;
write_cum += w;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u | %10lu %3u %3u\n",
(i == 0) ? 0 : 1 << (i - 1),
r, pct(r, read_tot), pct(read_cum, read_tot),
w, pct(w, write_tot), pct(write_cum, write_tot));
@@ -421,7 +420,6 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
return 0;
}
-#undef pct
LPROC_SEQ_FOPS(mdc_rpc_stats);
static int mdc_stats_seq_show(struct seq_file *seq, void *v)