4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2011, 2012, Intel Corporation.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 #define DEBUG_SUBSYSTEM S_CLASS
38 #include <asm/statfs.h>
39 #include <obd_cksum.h>
40 #include <obd_class.h>
41 #include <lprocfs_status.h>
42 #include <linux/seq_file.h>
43 #include "osc_internal.h"
45 static int osc_active_seq_show(struct seq_file *m, void *v)
47 struct obd_device *dev = m->private;
50 LPROCFS_CLIMP_CHECK(dev);
51 rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
52 LPROCFS_CLIMP_EXIT(dev);
56 static ssize_t osc_active_seq_write(struct file *file, const char *buffer,
57 size_t count, loff_t *off)
59 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
62 rc = lprocfs_write_helper(buffer, count, &val);
65 if (val < 0 || val > 1)
69 if (dev->u.cli.cl_import->imp_deactive == val)
70 rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
72 CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n", val);
76 LPROC_SEQ_FOPS(osc_active);
78 static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
80 struct obd_device *dev = m->private;
81 struct client_obd *cli = &dev->u.cli;
84 client_obd_list_lock(&cli->cl_loi_list_lock);
85 rc = seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
86 client_obd_list_unlock(&cli->cl_loi_list_lock);
90 static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
91 const char *buffer, size_t count, loff_t *off)
93 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
94 struct client_obd *cli = &dev->u.cli;
95 struct ptlrpc_request_pool *pool = cli->cl_import->imp_rq_pool;
98 rc = lprocfs_write_helper(buffer, count, &val);
102 if (val < 1 || val > OSC_MAX_RIF_MAX)
105 LPROCFS_CLIMP_CHECK(dev);
106 if (pool && val > cli->cl_max_rpcs_in_flight)
107 pool->prp_populate(pool, val-cli->cl_max_rpcs_in_flight);
109 client_obd_list_lock(&cli->cl_loi_list_lock);
110 cli->cl_max_rpcs_in_flight = val;
111 client_obd_list_unlock(&cli->cl_loi_list_lock);
113 LPROCFS_CLIMP_EXIT(dev);
116 LPROC_SEQ_FOPS(osc_max_rpcs_in_flight);
118 static int osc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
120 struct obd_device *dev = m->private;
121 struct client_obd *cli = &dev->u.cli;
125 client_obd_list_lock(&cli->cl_loi_list_lock);
126 val = cli->cl_dirty_max;
127 client_obd_list_unlock(&cli->cl_loi_list_lock);
130 return lprocfs_seq_read_frac_helper(m, val, mult);
133 static ssize_t osc_max_dirty_mb_seq_write(struct file *file, const char *buffer,
134 size_t count, loff_t *off)
136 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
137 struct client_obd *cli = &dev->u.cli;
138 int pages_number, mult, rc;
140 mult = 1 << (20 - PAGE_CACHE_SHIFT);
141 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
145 if (pages_number <= 0 ||
146 pages_number > OSC_MAX_DIRTY_MB_MAX << (20 - PAGE_CACHE_SHIFT) ||
147 pages_number > totalram_pages / 4) /* 1/4 of RAM */
150 client_obd_list_lock(&cli->cl_loi_list_lock);
151 cli->cl_dirty_max = (obd_count)(pages_number << PAGE_CACHE_SHIFT);
152 osc_wake_cache_waiters(cli);
153 client_obd_list_unlock(&cli->cl_loi_list_lock);
157 LPROC_SEQ_FOPS(osc_max_dirty_mb);
159 static int osc_cached_mb_seq_show(struct seq_file *m, void *v)
161 struct obd_device *dev = m->private;
162 struct client_obd *cli = &dev->u.cli;
163 int shift = 20 - PAGE_CACHE_SHIFT;
169 (atomic_read(&cli->cl_lru_in_list) +
170 atomic_read(&cli->cl_lru_busy)) >> shift,
171 atomic_read(&cli->cl_lru_busy));
176 /* shrink the number of caching pages to a specific number */
177 static ssize_t osc_cached_mb_seq_write(struct file *file, const char *buffer,
178 size_t count, loff_t *off)
180 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
181 struct client_obd *cli = &dev->u.cli;
182 int pages_number, mult, rc;
184 mult = 1 << (20 - PAGE_CACHE_SHIFT);
185 buffer = lprocfs_find_named_value(buffer, "used_mb:", &count);
186 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
190 if (pages_number < 0)
193 rc = atomic_read(&cli->cl_lru_in_list) - pages_number;
195 (void)osc_lru_shrink(cli, rc);
199 LPROC_SEQ_FOPS(osc_cached_mb);
201 static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v)
203 struct obd_device *dev = m->private;
204 struct client_obd *cli = &dev->u.cli;
207 client_obd_list_lock(&cli->cl_loi_list_lock);
208 rc = seq_printf(m, "%lu\n", cli->cl_dirty);
209 client_obd_list_unlock(&cli->cl_loi_list_lock);
212 LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes);
214 static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
216 struct obd_device *dev = m->private;
217 struct client_obd *cli = &dev->u.cli;
220 client_obd_list_lock(&cli->cl_loi_list_lock);
221 rc = seq_printf(m, "%lu\n", cli->cl_avail_grant);
222 client_obd_list_unlock(&cli->cl_loi_list_lock);
226 static ssize_t osc_cur_grant_bytes_seq_write(struct file *file, const char *buffer,
227 size_t count, loff_t *off)
229 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
230 struct client_obd *cli = &obd->u.cli;
237 rc = lprocfs_write_u64_helper(buffer, count, &val);
241 /* this is only for shrinking grant */
242 client_obd_list_lock(&cli->cl_loi_list_lock);
243 if (val >= cli->cl_avail_grant) {
244 client_obd_list_unlock(&cli->cl_loi_list_lock);
247 client_obd_list_unlock(&cli->cl_loi_list_lock);
249 LPROCFS_CLIMP_CHECK(obd);
250 if (cli->cl_import->imp_state == LUSTRE_IMP_FULL)
251 rc = osc_shrink_grant_to_target(cli, val);
252 LPROCFS_CLIMP_EXIT(obd);
257 LPROC_SEQ_FOPS(osc_cur_grant_bytes);
259 static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v)
261 struct obd_device *dev = m->private;
262 struct client_obd *cli = &dev->u.cli;
265 client_obd_list_lock(&cli->cl_loi_list_lock);
266 rc = seq_printf(m, "%lu\n", cli->cl_lost_grant);
267 client_obd_list_unlock(&cli->cl_loi_list_lock);
270 LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes);
272 static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
274 struct obd_device *obd = m->private;
278 return seq_printf(m, "%d\n",
279 obd->u.cli.cl_grant_shrink_interval);
282 static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
283 const char *buffer, size_t count, loff_t *off)
285 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
291 rc = lprocfs_write_helper(buffer, count, &val);
298 obd->u.cli.cl_grant_shrink_interval = val;
302 LPROC_SEQ_FOPS(osc_grant_shrink_interval);
304 static int osc_checksum_seq_show(struct seq_file *m, void *v)
306 struct obd_device *obd = m->private;
311 return seq_printf(m, "%d\n",
312 obd->u.cli.cl_checksum ? 1 : 0);
315 static ssize_t osc_checksum_seq_write(struct file *file, const char *buffer,
316 size_t count, loff_t *off)
318 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
324 rc = lprocfs_write_helper(buffer, count, &val);
328 obd->u.cli.cl_checksum = (val ? 1 : 0);
332 LPROC_SEQ_FOPS(osc_checksum);
334 static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
336 struct obd_device *obd = m->private;
343 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
344 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
346 if (obd->u.cli.cl_cksum_type == (1 << i))
347 seq_printf(m, "[%s] ", cksum_name[i]);
349 seq_printf(m, "%s ", cksum_name[i]);
355 static ssize_t osc_checksum_type_seq_write(struct file *file, const char *buffer,
356 size_t count, loff_t *off)
358 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
366 if (count > sizeof(kernbuf) - 1)
368 if (copy_from_user(kernbuf, buffer, count))
370 if (count > 0 && kernbuf[count - 1] == '\n')
371 kernbuf[count - 1] = '\0';
373 kernbuf[count] = '\0';
375 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
376 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
378 if (!strcmp(kernbuf, cksum_name[i])) {
379 obd->u.cli.cl_cksum_type = 1 << i;
385 LPROC_SEQ_FOPS(osc_checksum_type);
387 static int osc_resend_count_seq_show(struct seq_file *m, void *v)
389 struct obd_device *obd = m->private;
391 return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
394 static ssize_t osc_resend_count_seq_write(struct file *file, const char *buffer,
395 size_t count, loff_t *off)
397 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
400 rc = lprocfs_write_helper(buffer, count, &val);
407 atomic_set(&obd->u.cli.cl_resends, val);
411 LPROC_SEQ_FOPS(osc_resend_count);
413 static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
415 struct obd_device *obd = m->private;
416 struct osc_device *od = obd2osc_dev(obd);
418 return seq_printf(m, "%u\n", od->od_contention_time);
421 static ssize_t osc_contention_seconds_seq_write(struct file *file, const char *buffer,
422 size_t count, loff_t *off)
424 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
425 struct osc_device *od = obd2osc_dev(obd);
427 return lprocfs_write_helper(buffer, count, &od->od_contention_time) ?:
430 LPROC_SEQ_FOPS(osc_contention_seconds);
432 static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
434 struct obd_device *obd = m->private;
435 struct osc_device *od = obd2osc_dev(obd);
437 return seq_printf(m, "%u\n", od->od_lockless_truncate);
440 static ssize_t osc_lockless_truncate_seq_write(struct file *file, const char *buffer,
441 size_t count, loff_t *off)
443 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
444 struct osc_device *od = obd2osc_dev(obd);
446 return lprocfs_write_helper(buffer, count, &od->od_lockless_truncate) ?:
449 LPROC_SEQ_FOPS(osc_lockless_truncate);
451 static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
453 struct obd_device *obd = m->private;
454 return seq_printf(m, "%u\n",
455 atomic_read(&obd->u.cli.cl_destroy_in_flight));
457 LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
459 static int osc_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
461 return lprocfs_obd_rd_max_pages_per_rpc(m, m->private);
464 static ssize_t osc_obd_max_pages_per_rpc_seq_write(struct file *file,
465 const char *buffer, size_t count, loff_t *off)
467 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
468 struct client_obd *cli = &dev->u.cli;
469 struct obd_connect_data *ocd = &cli->cl_import->imp_connect_data;
473 rc = lprocfs_write_u64_helper(buffer, count, &val);
477 /* if the max_pages is specified in bytes, convert to pages */
478 if (val >= ONE_MB_BRW_SIZE)
479 val >>= PAGE_CACHE_SHIFT;
481 LPROCFS_CLIMP_CHECK(dev);
483 chunk_mask = ~((1 << (cli->cl_chunkbits - PAGE_CACHE_SHIFT)) - 1);
484 /* max_pages_per_rpc must be chunk aligned */
485 val = (val + ~chunk_mask) & chunk_mask;
486 if (val == 0 || val > ocd->ocd_brw_size >> PAGE_CACHE_SHIFT) {
487 LPROCFS_CLIMP_EXIT(dev);
490 client_obd_list_lock(&cli->cl_loi_list_lock);
491 cli->cl_max_pages_per_rpc = val;
492 client_obd_list_unlock(&cli->cl_loi_list_lock);
494 LPROCFS_CLIMP_EXIT(dev);
497 LPROC_SEQ_FOPS(osc_obd_max_pages_per_rpc);
499 LPROC_SEQ_FOPS_RO_TYPE(osc, uuid);
500 LPROC_SEQ_FOPS_RO_TYPE(osc, connect_flags);
501 LPROC_SEQ_FOPS_RO_TYPE(osc, blksize);
502 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytestotal);
503 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytesfree);
504 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytesavail);
505 LPROC_SEQ_FOPS_RO_TYPE(osc, filestotal);
506 LPROC_SEQ_FOPS_RO_TYPE(osc, filesfree);
507 LPROC_SEQ_FOPS_RO_TYPE(osc, server_uuid);
508 LPROC_SEQ_FOPS_RO_TYPE(osc, conn_uuid);
509 LPROC_SEQ_FOPS_RO_TYPE(osc, timeouts);
510 LPROC_SEQ_FOPS_RO_TYPE(osc, state);
512 LPROC_SEQ_FOPS_WR_ONLY(osc, ping);
514 LPROC_SEQ_FOPS_RW_TYPE(osc, import);
515 LPROC_SEQ_FOPS_RW_TYPE(osc, pinger_recov);
517 static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
518 { "uuid", &osc_uuid_fops, 0, 0 },
519 { "ping", &osc_ping_fops, 0, 0222 },
520 { "connect_flags", &osc_connect_flags_fops, 0, 0 },
521 { "blocksize", &osc_blksize_fops, 0, 0 },
522 { "kbytestotal", &osc_kbytestotal_fops, 0, 0 },
523 { "kbytesfree", &osc_kbytesfree_fops, 0, 0 },
524 { "kbytesavail", &osc_kbytesavail_fops, 0, 0 },
525 { "filestotal", &osc_filestotal_fops, 0, 0 },
526 { "filesfree", &osc_filesfree_fops, 0, 0 },
527 //{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
528 { "ost_server_uuid", &osc_server_uuid_fops, 0, 0 },
529 { "ost_conn_uuid", &osc_conn_uuid_fops, 0, 0 },
530 { "active", &osc_active_fops, 0 },
531 { "max_pages_per_rpc", &osc_obd_max_pages_per_rpc_fops, 0 },
532 { "max_rpcs_in_flight", &osc_max_rpcs_in_flight_fops, 0 },
533 { "destroys_in_flight", &osc_destroys_in_flight_fops, 0, 0 },
534 { "max_dirty_mb", &osc_max_dirty_mb_fops, 0 },
535 { "osc_cached_mb", &osc_cached_mb_fops, 0 },
536 { "cur_dirty_bytes", &osc_cur_dirty_bytes_fops, 0, 0 },
537 { "cur_grant_bytes", &osc_cur_grant_bytes_fops, 0 },
538 { "cur_lost_grant_bytes", &osc_cur_lost_grant_bytes_fops, 0, 0},
539 { "grant_shrink_interval", &osc_grant_shrink_interval_fops, 0 },
540 { "checksums", &osc_checksum_fops, 0 },
541 { "checksum_type", &osc_checksum_type_fops, 0 },
542 { "resend_count", &osc_resend_count_fops, 0},
543 { "timeouts", &osc_timeouts_fops, 0, 0 },
544 { "contention_seconds", &osc_contention_seconds_fops, 0 },
545 { "lockless_truncate", &osc_lockless_truncate_fops, 0 },
546 { "import", &osc_import_fops, 0 },
547 { "state", &osc_state_fops, 0, 0 },
548 { "pinger_recov", &osc_pinger_recov_fops, 0 },
552 LPROC_SEQ_FOPS_RO_TYPE(osc, numrefs);
553 static struct lprocfs_vars lprocfs_osc_module_vars[] = {
554 { "num_refs", &osc_numrefs_fops, 0, 0 },
558 #define pct(a,b) (b ? a * 100 / b : 0)
560 static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
563 struct obd_device *dev = seq->private;
564 struct client_obd *cli = &dev->u.cli;
565 unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
568 do_gettimeofday(&now);
570 client_obd_list_lock(&cli->cl_loi_list_lock);
572 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
573 now.tv_sec, (unsigned long)now.tv_usec);
574 seq_printf(seq, "read RPCs in flight: %d\n",
575 cli->cl_r_in_flight);
576 seq_printf(seq, "write RPCs in flight: %d\n",
577 cli->cl_w_in_flight);
578 seq_printf(seq, "pending write pages: %d\n",
579 atomic_read(&cli->cl_pending_w_pages));
580 seq_printf(seq, "pending read pages: %d\n",
581 atomic_read(&cli->cl_pending_r_pages));
583 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
584 seq_printf(seq, "pages per rpc rpcs %% cum %% |");
585 seq_printf(seq, " rpcs %% cum %%\n");
587 read_tot = lprocfs_oh_sum(&cli->cl_read_page_hist);
588 write_tot = lprocfs_oh_sum(&cli->cl_write_page_hist);
592 for (i = 0; i < OBD_HIST_MAX; i++) {
593 unsigned long r = cli->cl_read_page_hist.oh_buckets[i];
594 unsigned long w = cli->cl_write_page_hist.oh_buckets[i];
597 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
598 1 << i, r, pct(r, read_tot),
599 pct(read_cum, read_tot), w,
601 pct(write_cum, write_tot));
602 if (read_cum == read_tot && write_cum == write_tot)
606 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
607 seq_printf(seq, "rpcs in flight rpcs %% cum %% |");
608 seq_printf(seq, " rpcs %% cum %%\n");
610 read_tot = lprocfs_oh_sum(&cli->cl_read_rpc_hist);
611 write_tot = lprocfs_oh_sum(&cli->cl_write_rpc_hist);
615 for (i = 0; i < OBD_HIST_MAX; i++) {
616 unsigned long r = cli->cl_read_rpc_hist.oh_buckets[i];
617 unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
620 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
621 i, r, pct(r, read_tot),
622 pct(read_cum, read_tot), w,
624 pct(write_cum, write_tot));
625 if (read_cum == read_tot && write_cum == write_tot)
629 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
630 seq_printf(seq, "offset rpcs %% cum %% |");
631 seq_printf(seq, " rpcs %% cum %%\n");
633 read_tot = lprocfs_oh_sum(&cli->cl_read_offset_hist);
634 write_tot = lprocfs_oh_sum(&cli->cl_write_offset_hist);
638 for (i = 0; i < OBD_HIST_MAX; i++) {
639 unsigned long r = cli->cl_read_offset_hist.oh_buckets[i];
640 unsigned long w = cli->cl_write_offset_hist.oh_buckets[i];
643 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
644 (i == 0) ? 0 : 1 << (i - 1),
645 r, pct(r, read_tot), pct(read_cum, read_tot),
646 w, pct(w, write_tot), pct(write_cum, write_tot));
647 if (read_cum == read_tot && write_cum == write_tot)
651 client_obd_list_unlock(&cli->cl_loi_list_lock);
657 static ssize_t osc_rpc_stats_seq_write(struct file *file, const char *buf,
658 size_t len, loff_t *off)
660 struct seq_file *seq = file->private_data;
661 struct obd_device *dev = seq->private;
662 struct client_obd *cli = &dev->u.cli;
664 lprocfs_oh_clear(&cli->cl_read_rpc_hist);
665 lprocfs_oh_clear(&cli->cl_write_rpc_hist);
666 lprocfs_oh_clear(&cli->cl_read_page_hist);
667 lprocfs_oh_clear(&cli->cl_write_page_hist);
668 lprocfs_oh_clear(&cli->cl_read_offset_hist);
669 lprocfs_oh_clear(&cli->cl_write_offset_hist);
674 LPROC_SEQ_FOPS(osc_rpc_stats);
676 static int osc_stats_seq_show(struct seq_file *seq, void *v)
679 struct obd_device *dev = seq->private;
680 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
682 do_gettimeofday(&now);
684 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
685 now.tv_sec, (unsigned long)now.tv_usec);
686 seq_printf(seq, "lockless_write_bytes\t\t"LPU64"\n",
687 stats->os_lockless_writes);
688 seq_printf(seq, "lockless_read_bytes\t\t"LPU64"\n",
689 stats->os_lockless_reads);
690 seq_printf(seq, "lockless_truncate\t\t"LPU64"\n",
691 stats->os_lockless_truncates);
695 static ssize_t osc_stats_seq_write(struct file *file, const char *buf,
696 size_t len, loff_t *off)
698 struct seq_file *seq = file->private_data;
699 struct obd_device *dev = seq->private;
700 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
702 memset(stats, 0, sizeof(*stats));
706 LPROC_SEQ_FOPS(osc_stats);
708 int lproc_osc_attach_seqstat(struct obd_device *dev)
712 rc = lprocfs_seq_create(dev->obd_proc_entry, "osc_stats", 0644,
713 &osc_stats_fops, dev);
715 rc = lprocfs_obd_seq_create(dev, "rpc_stats", 0644,
716 &osc_rpc_stats_fops, dev);
721 void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars)
723 lvars->module_vars = lprocfs_osc_module_vars;
724 lvars->obd_vars = lprocfs_osc_obd_vars;