Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-12616 obclass: fix MDS start/stop race
[fs/lustre-release.git]
/
lustre
/
mdc
/
lproc_mdc.c
diff --git
a/lustre/mdc/lproc_mdc.c
b/lustre/mdc/lproc_mdc.c
index
e2efa79
..
0c2e79a
100644
(file)
--- a/
lustre/mdc/lproc_mdc.c
+++ b/
lustre/mdc/lproc_mdc.c
@@
-149,15
+149,14
@@
static int mdc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
{
struct obd_device *dev = m->private;
struct client_obd *cli = &dev->u.cli;
- long val;
- int mult;
+ unsigned long val;
spin_lock(&cli->cl_loi_list_lock);
- val =
cli->cl_dirty_max_pages
;
+ val =
PAGES_TO_MiB(cli->cl_dirty_max_pages)
;
spin_unlock(&cli->cl_loi_list_lock);
-
mult = 1 << (20 - PAGE_SHIFT
);
- return
lprocfs_seq_read_frac_helper(m, val, mult)
;
+
seq_printf(m, "%lu\n", val
);
+ return
0
;
}
static ssize_t mdc_max_dirty_mb_seq_write(struct file *file,
@@
-174,11
+173,11
@@
static ssize_t mdc_max_dirty_mb_seq_write(struct file *file,
if (rc)
return rc;
- pages_number >>= PAGE_SHIFT;
-
+ /* MB -> pages */
+ pages_number = round_up(pages_number, 1024 * 1024) >> PAGE_SHIFT;
if (pages_number <= 0 ||
- pages_number >=
OSC_MAX_DIRTY_MB_MAX << (20 - PAGE_SHIFT
) ||
- pages_number >
totalram_pages
/ 4) /* 1/4 of RAM */
+ pages_number >=
MiB_TO_PAGES(OSC_MAX_DIRTY_MB_MAX
) ||
+ pages_number >
cfs_totalram_pages()
/ 4) /* 1/4 of RAM */
return -ERANGE;
spin_lock(&cli->cl_loi_list_lock);
@@
-222,9
+221,10
@@
static ssize_t contention_seconds_store(struct kobject *kobj,
}
LUSTRE_RW_ATTR(contention_seconds);
+LUSTRE_ATTR(mds_conn_uuid, 0444, conn_uuid_show, NULL);
LUSTRE_RO_ATTR(conn_uuid);
-LUSTRE_
WO
_ATTR(ping);
+LUSTRE_
RW
_ATTR(ping);
static int mdc_cached_mb_seq_show(struct seq_file *m, void *v)
{
@@
-325,7
+325,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;
@@
-361,7
+360,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 %3
lu %3lu | %10lu %3lu %3l
u\n",
+ seq_printf(seq, "%d:\t\t%10lu %3
u %3u | %10lu %3u %3
u\n",
1 << i, r, pct(r, read_tot),
pct(read_cum, read_tot), w,
pct(w, write_tot),
@@
-385,7
+384,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 %3
lu %3lu | %10lu %3lu %3l
u\n",
+ seq_printf(seq, "%d:\t\t%10lu %3
u %3u | %10lu %3u %3
u\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)
@@
-407,7
+406,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 %3
lu %3lu | %10lu %3lu %3l
u\n",
+ seq_printf(seq, "%d:\t\t%10lu %3
u %3u | %10lu %3u %3
u\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));
@@
-418,7
+417,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)
@@
-526,6
+524,7
@@
static struct attribute *mdc_attrs[] = {
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_max_mod_rpcs_in_flight.attr,
&lustre_attr_contention_seconds.attr,
+ &lustre_attr_mds_conn_uuid.attr,
&lustre_attr_conn_uuid.attr,
&lustre_attr_ping.attr,
NULL,