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"
46 static int osc_active_seq_show(struct seq_file *m, void *v)
48 struct obd_device *dev = m->private;
51 LPROCFS_CLIMP_CHECK(dev);
52 rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
53 LPROCFS_CLIMP_EXIT(dev);
57 static ssize_t osc_active_seq_write(struct file *file, const char *buffer,
58 size_t count, loff_t *off)
60 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
63 rc = lprocfs_write_helper(buffer, count, &val);
66 if (val < 0 || val > 1)
70 if (dev->u.cli.cl_import->imp_deactive == val)
71 rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
73 CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n", val);
77 LPROC_SEQ_FOPS(osc_active);
79 static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
81 struct obd_device *dev = m->private;
82 struct client_obd *cli = &dev->u.cli;
85 client_obd_list_lock(&cli->cl_loi_list_lock);
86 rc = seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
87 client_obd_list_unlock(&cli->cl_loi_list_lock);
91 static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
92 const char *buffer, size_t count, loff_t *off)
94 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
95 struct client_obd *cli = &dev->u.cli;
96 struct ptlrpc_request_pool *pool = cli->cl_import->imp_rq_pool;
99 rc = lprocfs_write_helper(buffer, count, &val);
103 if (val < 1 || val > OSC_MAX_RIF_MAX)
106 LPROCFS_CLIMP_CHECK(dev);
107 if (pool && val > cli->cl_max_rpcs_in_flight)
108 pool->prp_populate(pool, val-cli->cl_max_rpcs_in_flight);
110 client_obd_list_lock(&cli->cl_loi_list_lock);
111 cli->cl_max_rpcs_in_flight = val;
112 client_obd_list_unlock(&cli->cl_loi_list_lock);
114 LPROCFS_CLIMP_EXIT(dev);
117 LPROC_SEQ_FOPS(osc_max_rpcs_in_flight);
119 static int osc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
121 struct obd_device *dev = m->private;
122 struct client_obd *cli = &dev->u.cli;
126 client_obd_list_lock(&cli->cl_loi_list_lock);
127 val = cli->cl_dirty_max;
128 client_obd_list_unlock(&cli->cl_loi_list_lock);
131 return lprocfs_seq_read_frac_helper(m, val, mult);
134 static ssize_t osc_max_dirty_mb_seq_write(struct file *file, const char *buffer,
135 size_t count, loff_t *off)
137 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
138 struct client_obd *cli = &dev->u.cli;
139 int pages_number, mult, rc;
141 mult = 1 << (20 - PAGE_CACHE_SHIFT);
142 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
146 if (pages_number <= 0 ||
147 pages_number > OSC_MAX_DIRTY_MB_MAX << (20 - PAGE_CACHE_SHIFT) ||
148 pages_number > totalram_pages / 4) /* 1/4 of RAM */
151 client_obd_list_lock(&cli->cl_loi_list_lock);
152 cli->cl_dirty_max = (obd_count)(pages_number << PAGE_CACHE_SHIFT);
153 osc_wake_cache_waiters(cli);
154 client_obd_list_unlock(&cli->cl_loi_list_lock);
158 LPROC_SEQ_FOPS(osc_max_dirty_mb);
160 static int osc_cached_mb_seq_show(struct seq_file *m, void *v)
162 struct obd_device *dev = m->private;
163 struct client_obd *cli = &dev->u.cli;
164 int shift = 20 - PAGE_CACHE_SHIFT;
170 (atomic_read(&cli->cl_lru_in_list) +
171 atomic_read(&cli->cl_lru_busy)) >> shift,
172 atomic_read(&cli->cl_lru_busy));
177 /* shrink the number of caching pages to a specific number */
178 static ssize_t osc_cached_mb_seq_write(struct file *file, const char *buffer,
179 size_t count, loff_t *off)
181 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
182 struct client_obd *cli = &dev->u.cli;
183 int pages_number, mult, rc;
185 mult = 1 << (20 - PAGE_CACHE_SHIFT);
186 buffer = lprocfs_find_named_value(buffer, "used_mb:", &count);
187 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
191 if (pages_number < 0)
194 rc = atomic_read(&cli->cl_lru_in_list) - pages_number;
196 (void)osc_lru_shrink(cli, rc);
200 LPROC_SEQ_FOPS(osc_cached_mb);
202 static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v)
204 struct obd_device *dev = m->private;
205 struct client_obd *cli = &dev->u.cli;
208 client_obd_list_lock(&cli->cl_loi_list_lock);
209 rc = seq_printf(m, "%lu\n", cli->cl_dirty);
210 client_obd_list_unlock(&cli->cl_loi_list_lock);
213 LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes);
215 static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
217 struct obd_device *dev = m->private;
218 struct client_obd *cli = &dev->u.cli;
221 client_obd_list_lock(&cli->cl_loi_list_lock);
222 rc = seq_printf(m, "%lu\n", cli->cl_avail_grant);
223 client_obd_list_unlock(&cli->cl_loi_list_lock);
227 static ssize_t osc_cur_grant_bytes_seq_write(struct file *file, const char *buffer,
228 size_t count, loff_t *off)
230 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
231 struct client_obd *cli = &obd->u.cli;
238 rc = lprocfs_write_u64_helper(buffer, count, &val);
242 /* this is only for shrinking grant */
243 client_obd_list_lock(&cli->cl_loi_list_lock);
244 if (val >= cli->cl_avail_grant) {
245 client_obd_list_unlock(&cli->cl_loi_list_lock);
248 client_obd_list_unlock(&cli->cl_loi_list_lock);
250 LPROCFS_CLIMP_CHECK(obd);
251 if (cli->cl_import->imp_state == LUSTRE_IMP_FULL)
252 rc = osc_shrink_grant_to_target(cli, val);
253 LPROCFS_CLIMP_EXIT(obd);
258 LPROC_SEQ_FOPS(osc_cur_grant_bytes);
260 static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v)
262 struct obd_device *dev = m->private;
263 struct client_obd *cli = &dev->u.cli;
266 client_obd_list_lock(&cli->cl_loi_list_lock);
267 rc = seq_printf(m, "%lu\n", cli->cl_lost_grant);
268 client_obd_list_unlock(&cli->cl_loi_list_lock);
271 LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes);
273 static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
275 struct obd_device *obd = m->private;
279 return seq_printf(m, "%d\n",
280 obd->u.cli.cl_grant_shrink_interval);
283 static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
284 const char *buffer, size_t count, loff_t *off)
286 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
292 rc = lprocfs_write_helper(buffer, count, &val);
299 obd->u.cli.cl_grant_shrink_interval = val;
303 LPROC_SEQ_FOPS(osc_grant_shrink_interval);
305 static int osc_checksum_seq_show(struct seq_file *m, void *v)
307 struct obd_device *obd = m->private;
312 return seq_printf(m, "%d\n",
313 obd->u.cli.cl_checksum ? 1 : 0);
316 static ssize_t osc_checksum_seq_write(struct file *file, const char *buffer,
317 size_t count, loff_t *off)
319 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
325 rc = lprocfs_write_helper(buffer, count, &val);
329 obd->u.cli.cl_checksum = (val ? 1 : 0);
333 LPROC_SEQ_FOPS(osc_checksum);
335 static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
337 struct obd_device *obd = m->private;
344 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
345 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
347 if (obd->u.cli.cl_cksum_type == (1 << i))
348 seq_printf(m, "[%s] ", cksum_name[i]);
350 seq_printf(m, "%s ", cksum_name[i]);
356 static ssize_t osc_checksum_type_seq_write(struct file *file, const char *buffer,
357 size_t count, loff_t *off)
359 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
367 if (count > sizeof(kernbuf) - 1)
369 if (copy_from_user(kernbuf, buffer, count))
371 if (count > 0 && kernbuf[count - 1] == '\n')
372 kernbuf[count - 1] = '\0';
374 kernbuf[count] = '\0';
376 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
377 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
379 if (!strcmp(kernbuf, cksum_name[i])) {
380 obd->u.cli.cl_cksum_type = 1 << i;
386 LPROC_SEQ_FOPS(osc_checksum_type);
388 static int osc_resend_count_seq_show(struct seq_file *m, void *v)
390 struct obd_device *obd = m->private;
392 return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
395 static ssize_t osc_resend_count_seq_write(struct file *file, const char *buffer,
396 size_t count, loff_t *off)
398 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
401 rc = lprocfs_write_helper(buffer, count, &val);
408 atomic_set(&obd->u.cli.cl_resends, val);
412 LPROC_SEQ_FOPS(osc_resend_count);
414 static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
416 struct obd_device *obd = m->private;
417 struct osc_device *od = obd2osc_dev(obd);
419 return seq_printf(m, "%u\n", od->od_contention_time);
422 static ssize_t osc_contention_seconds_seq_write(struct file *file, const char *buffer,
423 size_t count, loff_t *off)
425 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
426 struct osc_device *od = obd2osc_dev(obd);
428 return lprocfs_write_helper(buffer, count, &od->od_contention_time) ?:
431 LPROC_SEQ_FOPS(osc_contention_seconds);
433 static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
435 struct obd_device *obd = m->private;
436 struct osc_device *od = obd2osc_dev(obd);
438 return seq_printf(m, "%u\n", od->od_lockless_truncate);
441 static ssize_t osc_lockless_truncate_seq_write(struct file *file, const char *buffer,
442 size_t count, loff_t *off)
444 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
445 struct osc_device *od = obd2osc_dev(obd);
447 return lprocfs_write_helper(buffer, count, &od->od_lockless_truncate) ?:
450 LPROC_SEQ_FOPS(osc_lockless_truncate);
452 static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
454 struct obd_device *obd = m->private;
455 return seq_printf(m, "%u\n",
456 atomic_read(&obd->u.cli.cl_destroy_in_flight));
458 LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
460 static int osc_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
462 return lprocfs_obd_rd_max_pages_per_rpc(m, m->private);
465 static ssize_t osc_obd_max_pages_per_rpc_seq_write(struct file *file,
466 const char *buffer, size_t count, loff_t *off)
468 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
469 struct client_obd *cli = &dev->u.cli;
470 struct obd_connect_data *ocd = &cli->cl_import->imp_connect_data;
474 rc = lprocfs_write_u64_helper(buffer, count, &val);
478 /* if the max_pages is specified in bytes, convert to pages */
479 if (val >= ONE_MB_BRW_SIZE)
480 val >>= PAGE_CACHE_SHIFT;
482 LPROCFS_CLIMP_CHECK(dev);
484 chunk_mask = ~((1 << (cli->cl_chunkbits - PAGE_CACHE_SHIFT)) - 1);
485 /* max_pages_per_rpc must be chunk aligned */
486 val = (val + ~chunk_mask) & chunk_mask;
487 if (val == 0 || val > ocd->ocd_brw_size >> PAGE_CACHE_SHIFT) {
488 LPROCFS_CLIMP_EXIT(dev);
491 client_obd_list_lock(&cli->cl_loi_list_lock);
492 cli->cl_max_pages_per_rpc = val;
493 client_obd_list_unlock(&cli->cl_loi_list_lock);
495 LPROCFS_CLIMP_EXIT(dev);
498 LPROC_SEQ_FOPS(osc_obd_max_pages_per_rpc);
500 LPROC_SEQ_FOPS_RO_TYPE(osc, uuid);
501 LPROC_SEQ_FOPS_RO_TYPE(osc, connect_flags);
502 LPROC_SEQ_FOPS_RO_TYPE(osc, blksize);
503 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytestotal);
504 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytesfree);
505 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytesavail);
506 LPROC_SEQ_FOPS_RO_TYPE(osc, filestotal);
507 LPROC_SEQ_FOPS_RO_TYPE(osc, filesfree);
508 LPROC_SEQ_FOPS_RO_TYPE(osc, server_uuid);
509 LPROC_SEQ_FOPS_RO_TYPE(osc, conn_uuid);
510 LPROC_SEQ_FOPS_RO_TYPE(osc, timeouts);
511 LPROC_SEQ_FOPS_RO_TYPE(osc, state);
513 LPROC_SEQ_FOPS_WR_ONLY(osc, ping);
515 LPROC_SEQ_FOPS_RW_TYPE(osc, import);
516 LPROC_SEQ_FOPS_RW_TYPE(osc, pinger_recov);
518 static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
519 { "uuid", &osc_uuid_fops, 0, 0 },
520 { "ping", &osc_ping_fops, 0, 0222 },
521 { "connect_flags", &osc_connect_flags_fops, 0, 0 },
522 { "blocksize", &osc_blksize_fops, 0, 0 },
523 { "kbytestotal", &osc_kbytestotal_fops, 0, 0 },
524 { "kbytesfree", &osc_kbytesfree_fops, 0, 0 },
525 { "kbytesavail", &osc_kbytesavail_fops, 0, 0 },
526 { "filestotal", &osc_filestotal_fops, 0, 0 },
527 { "filesfree", &osc_filesfree_fops, 0, 0 },
528 //{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
529 { "ost_server_uuid", &osc_server_uuid_fops, 0, 0 },
530 { "ost_conn_uuid", &osc_conn_uuid_fops, 0, 0 },
531 { "active", &osc_active_fops, 0 },
532 { "max_pages_per_rpc", &osc_obd_max_pages_per_rpc_fops, 0 },
533 { "max_rpcs_in_flight", &osc_max_rpcs_in_flight_fops, 0 },
534 { "destroys_in_flight", &osc_destroys_in_flight_fops, 0, 0 },
535 { "max_dirty_mb", &osc_max_dirty_mb_fops, 0 },
536 { "osc_cached_mb", &osc_cached_mb_fops, 0 },
537 { "cur_dirty_bytes", &osc_cur_dirty_bytes_fops, 0, 0 },
538 { "cur_grant_bytes", &osc_cur_grant_bytes_fops, 0 },
539 { "cur_lost_grant_bytes", &osc_cur_lost_grant_bytes_fops, 0, 0},
540 { "grant_shrink_interval", &osc_grant_shrink_interval_fops, 0 },
541 { "checksums", &osc_checksum_fops, 0 },
542 { "checksum_type", &osc_checksum_type_fops, 0 },
543 { "resend_count", &osc_resend_count_fops, 0},
544 { "timeouts", &osc_timeouts_fops, 0, 0 },
545 { "contention_seconds", &osc_contention_seconds_fops, 0 },
546 { "lockless_truncate", &osc_lockless_truncate_fops, 0 },
547 { "import", &osc_import_fops, 0 },
548 { "state", &osc_state_fops, 0, 0 },
549 { "pinger_recov", &osc_pinger_recov_fops, 0 },
553 LPROC_SEQ_FOPS_RO_TYPE(osc, numrefs);
554 static struct lprocfs_vars lprocfs_osc_module_vars[] = {
555 { "num_refs", &osc_numrefs_fops, 0, 0 },
559 #define pct(a,b) (b ? a * 100 / b : 0)
561 static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
564 struct obd_device *dev = seq->private;
565 struct client_obd *cli = &dev->u.cli;
566 unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
569 do_gettimeofday(&now);
571 client_obd_list_lock(&cli->cl_loi_list_lock);
573 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
574 now.tv_sec, now.tv_usec);
575 seq_printf(seq, "read RPCs in flight: %d\n",
576 cli->cl_r_in_flight);
577 seq_printf(seq, "write RPCs in flight: %d\n",
578 cli->cl_w_in_flight);
579 seq_printf(seq, "pending write pages: %d\n",
580 atomic_read(&cli->cl_pending_w_pages));
581 seq_printf(seq, "pending read pages: %d\n",
582 atomic_read(&cli->cl_pending_r_pages));
584 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
585 seq_printf(seq, "pages per rpc rpcs %% cum %% |");
586 seq_printf(seq, " rpcs %% cum %%\n");
588 read_tot = lprocfs_oh_sum(&cli->cl_read_page_hist);
589 write_tot = lprocfs_oh_sum(&cli->cl_write_page_hist);
593 for (i = 0; i < OBD_HIST_MAX; i++) {
594 unsigned long r = cli->cl_read_page_hist.oh_buckets[i];
595 unsigned long w = cli->cl_write_page_hist.oh_buckets[i];
598 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
599 1 << i, r, pct(r, read_tot),
600 pct(read_cum, read_tot), w,
602 pct(write_cum, write_tot));
603 if (read_cum == read_tot && write_cum == write_tot)
607 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
608 seq_printf(seq, "rpcs in flight rpcs %% cum %% |");
609 seq_printf(seq, " rpcs %% cum %%\n");
611 read_tot = lprocfs_oh_sum(&cli->cl_read_rpc_hist);
612 write_tot = lprocfs_oh_sum(&cli->cl_write_rpc_hist);
616 for (i = 0; i < OBD_HIST_MAX; i++) {
617 unsigned long r = cli->cl_read_rpc_hist.oh_buckets[i];
618 unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
621 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
622 i, r, pct(r, read_tot),
623 pct(read_cum, read_tot), w,
625 pct(write_cum, write_tot));
626 if (read_cum == read_tot && write_cum == write_tot)
630 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
631 seq_printf(seq, "offset rpcs %% cum %% |");
632 seq_printf(seq, " rpcs %% cum %%\n");
634 read_tot = lprocfs_oh_sum(&cli->cl_read_offset_hist);
635 write_tot = lprocfs_oh_sum(&cli->cl_write_offset_hist);
639 for (i = 0; i < OBD_HIST_MAX; i++) {
640 unsigned long r = cli->cl_read_offset_hist.oh_buckets[i];
641 unsigned long w = cli->cl_write_offset_hist.oh_buckets[i];
644 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
645 (i == 0) ? 0 : 1 << (i - 1),
646 r, pct(r, read_tot), pct(read_cum, read_tot),
647 w, pct(w, write_tot), pct(write_cum, write_tot));
648 if (read_cum == read_tot && write_cum == write_tot)
652 client_obd_list_unlock(&cli->cl_loi_list_lock);
658 static ssize_t osc_rpc_stats_seq_write(struct file *file, const char *buf,
659 size_t len, loff_t *off)
661 struct seq_file *seq = file->private_data;
662 struct obd_device *dev = seq->private;
663 struct client_obd *cli = &dev->u.cli;
665 lprocfs_oh_clear(&cli->cl_read_rpc_hist);
666 lprocfs_oh_clear(&cli->cl_write_rpc_hist);
667 lprocfs_oh_clear(&cli->cl_read_page_hist);
668 lprocfs_oh_clear(&cli->cl_write_page_hist);
669 lprocfs_oh_clear(&cli->cl_read_offset_hist);
670 lprocfs_oh_clear(&cli->cl_write_offset_hist);
675 LPROC_SEQ_FOPS(osc_rpc_stats);
677 static int osc_stats_seq_show(struct seq_file *seq, void *v)
680 struct obd_device *dev = seq->private;
681 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
683 do_gettimeofday(&now);
685 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
686 now.tv_sec, now.tv_usec);
687 seq_printf(seq, "lockless_write_bytes\t\t"LPU64"\n",
688 stats->os_lockless_writes);
689 seq_printf(seq, "lockless_read_bytes\t\t"LPU64"\n",
690 stats->os_lockless_reads);
691 seq_printf(seq, "lockless_truncate\t\t"LPU64"\n",
692 stats->os_lockless_truncates);
696 static ssize_t osc_stats_seq_write(struct file *file, const char *buf,
697 size_t len, loff_t *off)
699 struct seq_file *seq = file->private_data;
700 struct obd_device *dev = seq->private;
701 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
703 memset(stats, 0, sizeof(*stats));
707 LPROC_SEQ_FOPS(osc_stats);
709 int lproc_osc_attach_seqstat(struct obd_device *dev)
713 rc = lprocfs_seq_create(dev->obd_proc_entry, "osc_stats", 0644,
714 &osc_stats_fops, dev);
716 rc = lprocfs_obd_seq_create(dev, "rpc_stats", 0644,
717 &osc_rpc_stats_fops, dev);
722 void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars)
724 lvars->module_vars = lprocfs_osc_module_vars;
725 lvars->obd_vars = lprocfs_osc_obd_vars;