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.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2011, 2017, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
32 #define DEBUG_SUBSYSTEM S_CLASS
34 #include <linux/version.h>
35 #include <asm/statfs.h>
36 #include <obd_cksum.h>
37 #include <obd_class.h>
38 #include <lprocfs_status.h>
39 #include <linux/seq_file.h>
40 #include <lustre_osc.h>
42 #include "osc_internal.h"
45 static int osc_active_seq_show(struct seq_file *m, void *v)
47 struct obd_device *dev = m->private;
49 LPROCFS_CLIMP_CHECK(dev);
50 seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
51 LPROCFS_CLIMP_EXIT(dev);
55 static ssize_t osc_active_seq_write(struct file *file,
56 const char __user *buffer,
57 size_t count, loff_t *off)
59 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
63 rc = kstrtobool_from_user(buffer, count, &val);
68 if (dev->u.cli.cl_import->imp_deactive == val)
69 rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
71 CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n",
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;
83 spin_lock(&cli->cl_loi_list_lock);
84 seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
85 spin_unlock(&cli->cl_loi_list_lock);
89 static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
90 const char __user *buffer,
91 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 int adding, added, req_count;
99 rc = kstrtouint_from_user(buffer, count, 0, &val);
103 if (val == 0 || val > OSC_MAX_RIF_MAX)
106 LPROCFS_CLIMP_CHECK(dev);
108 adding = (int)val - cli->cl_max_rpcs_in_flight;
109 req_count = atomic_read(&osc_pool_req_count);
110 if (adding > 0 && req_count < osc_reqpool_maxreqcount) {
112 * There might be some race which will cause over-limit
113 * allocation, but it is fine.
115 if (req_count + adding > osc_reqpool_maxreqcount)
116 adding = osc_reqpool_maxreqcount - req_count;
118 added = osc_rq_pool->prp_populate(osc_rq_pool, adding);
119 atomic_add(added, &osc_pool_req_count);
122 spin_lock(&cli->cl_loi_list_lock);
123 cli->cl_max_rpcs_in_flight = val;
124 client_adjust_max_dirty(cli);
125 spin_unlock(&cli->cl_loi_list_lock);
127 LPROCFS_CLIMP_EXIT(dev);
130 LPROC_SEQ_FOPS(osc_max_rpcs_in_flight);
132 static int osc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
134 struct obd_device *dev = m->private;
135 struct client_obd *cli = &dev->u.cli;
139 spin_lock(&cli->cl_loi_list_lock);
140 val = cli->cl_dirty_max_pages;
141 spin_unlock(&cli->cl_loi_list_lock);
143 mult = 1 << (20 - PAGE_SHIFT);
144 return lprocfs_seq_read_frac_helper(m, val, mult);
147 static ssize_t osc_max_dirty_mb_seq_write(struct file *file,
148 const char __user *buffer,
149 size_t count, loff_t *off)
151 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
152 struct client_obd *cli = &dev->u.cli;
156 rc = lprocfs_str_with_units_to_s64(buffer, count, &pages_number, 'M');
160 pages_number >>= PAGE_SHIFT;
162 if (pages_number <= 0 ||
163 pages_number >= OSC_MAX_DIRTY_MB_MAX << (20 - PAGE_SHIFT) ||
164 pages_number > totalram_pages / 4) /* 1/4 of RAM */
167 spin_lock(&cli->cl_loi_list_lock);
168 cli->cl_dirty_max_pages = pages_number;
169 osc_wake_cache_waiters(cli);
170 spin_unlock(&cli->cl_loi_list_lock);
174 LPROC_SEQ_FOPS(osc_max_dirty_mb);
176 static int osc_cached_mb_seq_show(struct seq_file *m, void *v)
178 struct obd_device *dev = m->private;
179 struct client_obd *cli = &dev->u.cli;
180 int shift = 20 - PAGE_SHIFT;
182 seq_printf(m, "used_mb: %ld\n"
185 (atomic_long_read(&cli->cl_lru_in_list) +
186 atomic_long_read(&cli->cl_lru_busy)) >> shift,
187 atomic_long_read(&cli->cl_lru_busy),
188 cli->cl_lru_reclaim);
193 /* shrink the number of caching pages to a specific number */
195 osc_cached_mb_seq_write(struct file *file, const char __user *buffer,
196 size_t count, loff_t *off)
198 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
199 struct client_obd *cli = &dev->u.cli;
204 if (count >= sizeof(kernbuf))
207 if (copy_from_user(kernbuf, buffer, count))
211 buffer += lprocfs_find_named_value(kernbuf, "used_mb:", &count) -
213 rc = lprocfs_str_with_units_to_s64(buffer, count, &pages_number, 'M');
217 pages_number >>= PAGE_SHIFT;
219 if (pages_number < 0)
222 rc = atomic_long_read(&cli->cl_lru_in_list) - pages_number;
227 env = cl_env_get(&refcheck);
229 (void)osc_lru_shrink(env, cli, rc, true);
230 cl_env_put(env, &refcheck);
236 LPROC_SEQ_FOPS(osc_cached_mb);
238 static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v)
240 struct obd_device *dev = m->private;
241 struct client_obd *cli = &dev->u.cli;
243 spin_lock(&cli->cl_loi_list_lock);
244 seq_printf(m, "%lu\n", cli->cl_dirty_pages << PAGE_SHIFT);
245 spin_unlock(&cli->cl_loi_list_lock);
248 LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes);
250 static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
252 struct obd_device *dev = m->private;
253 struct client_obd *cli = &dev->u.cli;
255 spin_lock(&cli->cl_loi_list_lock);
256 seq_printf(m, "%lu\n", cli->cl_avail_grant);
257 spin_unlock(&cli->cl_loi_list_lock);
261 static ssize_t osc_cur_grant_bytes_seq_write(struct file *file,
262 const char __user *buffer,
263 size_t count, loff_t *off)
265 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
266 struct client_obd *cli = &obd->u.cli;
273 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
279 /* this is only for shrinking grant */
280 spin_lock(&cli->cl_loi_list_lock);
281 if (val >= cli->cl_avail_grant) {
282 spin_unlock(&cli->cl_loi_list_lock);
286 spin_unlock(&cli->cl_loi_list_lock);
288 LPROCFS_CLIMP_CHECK(obd);
289 if (cli->cl_import->imp_state == LUSTRE_IMP_FULL)
290 rc = osc_shrink_grant_to_target(cli, val);
291 LPROCFS_CLIMP_EXIT(obd);
296 LPROC_SEQ_FOPS(osc_cur_grant_bytes);
298 static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v)
300 struct obd_device *dev = m->private;
301 struct client_obd *cli = &dev->u.cli;
303 spin_lock(&cli->cl_loi_list_lock);
304 seq_printf(m, "%lu\n", cli->cl_lost_grant);
305 spin_unlock(&cli->cl_loi_list_lock);
308 LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes);
310 static int osc_cur_dirty_grant_bytes_seq_show(struct seq_file *m, void *v)
312 struct obd_device *dev = m->private;
313 struct client_obd *cli = &dev->u.cli;
315 spin_lock(&cli->cl_loi_list_lock);
316 seq_printf(m, "%lu\n", cli->cl_dirty_grant);
317 spin_unlock(&cli->cl_loi_list_lock);
320 LPROC_SEQ_FOPS_RO(osc_cur_dirty_grant_bytes);
322 static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
324 struct obd_device *obd = m->private;
328 seq_printf(m, "%lld\n",
329 obd->u.cli.cl_grant_shrink_interval);
333 static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
334 const char __user *buffer,
335 size_t count, loff_t *off)
337 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
344 rc = kstrtouint_from_user(buffer, count, 0, &val);
351 obd->u.cli.cl_grant_shrink_interval = val;
355 LPROC_SEQ_FOPS(osc_grant_shrink_interval);
357 static int osc_checksum_seq_show(struct seq_file *m, void *v)
359 struct obd_device *obd = m->private;
364 seq_printf(m, "%d\n", obd->u.cli.cl_checksum ? 1 : 0);
368 static ssize_t osc_checksum_seq_write(struct file *file,
369 const char __user *buffer,
370 size_t count, loff_t *off)
372 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
379 rc = kstrtobool_from_user(buffer, count, &val);
383 obd->u.cli.cl_checksum = val;
387 LPROC_SEQ_FOPS(osc_checksum);
389 static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
391 struct obd_device *obd = m->private;
398 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
399 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
401 if (obd->u.cli.cl_cksum_type == (1 << i))
402 seq_printf(m, "[%s] ", cksum_name[i]);
404 seq_printf(m, "%s ", cksum_name[i]);
410 static ssize_t osc_checksum_type_seq_write(struct file *file,
411 const char __user *buffer,
412 size_t count, loff_t *off)
414 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
422 if (count > sizeof(kernbuf) - 1)
424 if (copy_from_user(kernbuf, buffer, count))
426 if (count > 0 && kernbuf[count - 1] == '\n')
427 kernbuf[count - 1] = '\0';
429 kernbuf[count] = '\0';
431 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
432 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
434 if (!strcmp(kernbuf, cksum_name[i])) {
435 obd->u.cli.cl_cksum_type = 1 << i;
441 LPROC_SEQ_FOPS(osc_checksum_type);
443 static int osc_resend_count_seq_show(struct seq_file *m, void *v)
445 struct obd_device *obd = m->private;
447 seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
451 static ssize_t osc_resend_count_seq_write(struct file *file,
452 const char __user *buffer,
453 size_t count, loff_t *off)
455 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
459 rc = kstrtouint_from_user(buffer, count, 0, &val);
463 atomic_set(&obd->u.cli.cl_resends, val);
467 LPROC_SEQ_FOPS(osc_resend_count);
469 static int osc_checksum_dump_seq_show(struct seq_file *m, void *v)
471 struct obd_device *obd = m->private;
476 seq_printf(m, "%d\n", obd->u.cli.cl_checksum_dump ? 1 : 0);
480 static ssize_t osc_checksum_dump_seq_write(struct file *file,
481 const char __user *buffer,
482 size_t count, loff_t *off)
484 struct obd_device *obd;
488 obd = ((struct seq_file *)file->private_data)->private;
492 rc = kstrtobool_from_user(buffer, count, &val);
496 obd->u.cli.cl_checksum_dump = val;
500 LPROC_SEQ_FOPS(osc_checksum_dump);
502 static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
504 struct obd_device *obd = m->private;
505 struct osc_device *od = obd2osc_dev(obd);
507 seq_printf(m, "%lld\n", od->od_contention_time);
511 static ssize_t osc_contention_seconds_seq_write(struct file *file,
512 const char __user *buffer,
513 size_t count, loff_t *off)
515 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
516 struct osc_device *od = obd2osc_dev(obd);
520 rc = kstrtouint_from_user(buffer, count, 0, &val);
523 if (val < 0 || val > INT_MAX)
526 od->od_contention_time = val;
530 LPROC_SEQ_FOPS(osc_contention_seconds);
532 static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
534 struct obd_device *obd = m->private;
535 struct osc_device *od = obd2osc_dev(obd);
537 seq_printf(m, "%u\n", od->od_lockless_truncate);
541 static ssize_t osc_lockless_truncate_seq_write(struct file *file,
542 const char __user *buffer,
543 size_t count, loff_t *off)
545 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
546 struct osc_device *od = obd2osc_dev(obd);
550 rc = kstrtobool_from_user(buffer, count, &val);
554 od->od_lockless_truncate = val;
558 LPROC_SEQ_FOPS(osc_lockless_truncate);
560 static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
562 struct obd_device *obd = m->private;
563 seq_printf(m, "%u\n",
564 atomic_read(&obd->u.cli.cl_destroy_in_flight));
567 LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
569 LPROC_SEQ_FOPS_RW_TYPE(osc, obd_max_pages_per_rpc);
571 LPROC_SEQ_FOPS_RW_TYPE(osc, obd_short_io_bytes);
573 static int osc_unstable_stats_seq_show(struct seq_file *m, void *v)
575 struct obd_device *dev = m->private;
576 struct client_obd *cli = &dev->u.cli;
580 pages = atomic_long_read(&cli->cl_unstable_count);
581 mb = (pages * PAGE_SIZE) >> 20;
583 seq_printf(m, "unstable_pages: %20ld\n"
584 "unstable_mb: %10d\n",
588 LPROC_SEQ_FOPS_RO(osc_unstable_stats);
590 LPROC_SEQ_FOPS_RO_TYPE(osc, connect_flags);
591 LPROC_SEQ_FOPS_RO_TYPE(osc, server_uuid);
592 LPROC_SEQ_FOPS_RO_TYPE(osc, conn_uuid);
593 LPROC_SEQ_FOPS_RO_TYPE(osc, timeouts);
594 LPROC_SEQ_FOPS_RO_TYPE(osc, state);
596 LPROC_SEQ_FOPS_WR_ONLY(osc, ping);
598 LPROC_SEQ_FOPS_RW_TYPE(osc, import);
599 LPROC_SEQ_FOPS_RW_TYPE(osc, pinger_recov);
601 struct lprocfs_vars lprocfs_osc_obd_vars[] = {
603 .fops = &osc_ping_fops,
605 { .name = "connect_flags",
606 .fops = &osc_connect_flags_fops },
607 { .name = "ost_server_uuid",
608 .fops = &osc_server_uuid_fops },
609 { .name = "ost_conn_uuid",
610 .fops = &osc_conn_uuid_fops },
612 .fops = &osc_active_fops },
613 { .name = "max_pages_per_rpc",
614 .fops = &osc_obd_max_pages_per_rpc_fops },
615 { .name = "short_io_bytes",
616 .fops = &osc_obd_short_io_bytes_fops },
617 { .name = "max_rpcs_in_flight",
618 .fops = &osc_max_rpcs_in_flight_fops },
619 { .name = "destroys_in_flight",
620 .fops = &osc_destroys_in_flight_fops },
621 { .name = "max_dirty_mb",
622 .fops = &osc_max_dirty_mb_fops },
623 { .name = "osc_cached_mb",
624 .fops = &osc_cached_mb_fops },
625 { .name = "cur_dirty_bytes",
626 .fops = &osc_cur_dirty_bytes_fops },
627 { .name = "cur_grant_bytes",
628 .fops = &osc_cur_grant_bytes_fops },
629 { .name = "cur_lost_grant_bytes",
630 .fops = &osc_cur_lost_grant_bytes_fops },
631 { .name = "cur_dirty_grant_bytes",
632 .fops = &osc_cur_dirty_grant_bytes_fops },
633 { .name = "grant_shrink_interval",
634 .fops = &osc_grant_shrink_interval_fops },
635 { .name = "checksums",
636 .fops = &osc_checksum_fops },
637 { .name = "checksum_type",
638 .fops = &osc_checksum_type_fops },
639 { .name = "checksum_dump",
640 .fops = &osc_checksum_dump_fops },
641 { .name = "resend_count",
642 .fops = &osc_resend_count_fops },
643 { .name = "timeouts",
644 .fops = &osc_timeouts_fops },
645 { .name = "contention_seconds",
646 .fops = &osc_contention_seconds_fops },
647 { .name = "lockless_truncate",
648 .fops = &osc_lockless_truncate_fops },
650 .fops = &osc_import_fops },
652 .fops = &osc_state_fops },
653 { .name = "pinger_recov",
654 .fops = &osc_pinger_recov_fops },
655 { .name = "unstable_stats",
656 .fops = &osc_unstable_stats_fops },
660 #define pct(a,b) (b ? a * 100 / b : 0)
662 static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
664 struct timespec64 now;
665 struct obd_device *dev = seq->private;
666 struct client_obd *cli = &dev->u.cli;
667 unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
670 ktime_get_real_ts64(&now);
672 spin_lock(&cli->cl_loi_list_lock);
674 seq_printf(seq, "snapshot_time: %lld.%09lu (secs.nsecs)\n",
675 (s64)now.tv_sec, now.tv_nsec);
676 seq_printf(seq, "read RPCs in flight: %d\n",
677 cli->cl_r_in_flight);
678 seq_printf(seq, "write RPCs in flight: %d\n",
679 cli->cl_w_in_flight);
680 seq_printf(seq, "pending write pages: %d\n",
681 atomic_read(&cli->cl_pending_w_pages));
682 seq_printf(seq, "pending read pages: %d\n",
683 atomic_read(&cli->cl_pending_r_pages));
685 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
686 seq_printf(seq, "pages per rpc rpcs %% cum %% |");
687 seq_printf(seq, " rpcs %% cum %%\n");
689 read_tot = lprocfs_oh_sum(&cli->cl_read_page_hist);
690 write_tot = lprocfs_oh_sum(&cli->cl_write_page_hist);
694 for (i = 0; i < OBD_HIST_MAX; i++) {
695 unsigned long r = cli->cl_read_page_hist.oh_buckets[i];
696 unsigned long w = cli->cl_write_page_hist.oh_buckets[i];
700 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
701 1 << i, r, pct(r, read_tot),
702 pct(read_cum, read_tot), w,
704 pct(write_cum, write_tot));
705 if (read_cum == read_tot && write_cum == write_tot)
709 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
710 seq_printf(seq, "rpcs in flight rpcs %% cum %% |");
711 seq_printf(seq, " rpcs %% cum %%\n");
713 read_tot = lprocfs_oh_sum(&cli->cl_read_rpc_hist);
714 write_tot = lprocfs_oh_sum(&cli->cl_write_rpc_hist);
718 for (i = 0; i < OBD_HIST_MAX; i++) {
719 unsigned long r = cli->cl_read_rpc_hist.oh_buckets[i];
720 unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
723 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
724 i, r, pct(r, read_tot),
725 pct(read_cum, read_tot), w,
727 pct(write_cum, write_tot));
728 if (read_cum == read_tot && write_cum == write_tot)
732 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
733 seq_printf(seq, "offset rpcs %% cum %% |");
734 seq_printf(seq, " rpcs %% cum %%\n");
736 read_tot = lprocfs_oh_sum(&cli->cl_read_offset_hist);
737 write_tot = lprocfs_oh_sum(&cli->cl_write_offset_hist);
741 for (i = 0; i < OBD_HIST_MAX; i++) {
742 unsigned long r = cli->cl_read_offset_hist.oh_buckets[i];
743 unsigned long w = cli->cl_write_offset_hist.oh_buckets[i];
746 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
747 (i == 0) ? 0 : 1 << (i - 1),
748 r, pct(r, read_tot), pct(read_cum, read_tot),
749 w, pct(w, write_tot), pct(write_cum, write_tot));
750 if (read_cum == read_tot && write_cum == write_tot)
754 spin_unlock(&cli->cl_loi_list_lock);
760 static ssize_t osc_rpc_stats_seq_write(struct file *file,
761 const char __user *buf,
762 size_t len, loff_t *off)
764 struct seq_file *seq = file->private_data;
765 struct obd_device *dev = seq->private;
766 struct client_obd *cli = &dev->u.cli;
768 lprocfs_oh_clear(&cli->cl_read_rpc_hist);
769 lprocfs_oh_clear(&cli->cl_write_rpc_hist);
770 lprocfs_oh_clear(&cli->cl_read_page_hist);
771 lprocfs_oh_clear(&cli->cl_write_page_hist);
772 lprocfs_oh_clear(&cli->cl_read_offset_hist);
773 lprocfs_oh_clear(&cli->cl_write_offset_hist);
777 LPROC_SEQ_FOPS(osc_rpc_stats);
779 static int osc_stats_seq_show(struct seq_file *seq, void *v)
781 struct timespec64 now;
782 struct obd_device *dev = seq->private;
783 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
785 ktime_get_real_ts64(&now);
787 seq_printf(seq, "snapshot_time: %lld.%09lu (secs.nsecs)\n",
788 (s64)now.tv_sec, now.tv_nsec);
789 seq_printf(seq, "lockless_write_bytes\t\t%llu\n",
790 stats->os_lockless_writes);
791 seq_printf(seq, "lockless_read_bytes\t\t%llu\n",
792 stats->os_lockless_reads);
793 seq_printf(seq, "lockless_truncate\t\t%llu\n",
794 stats->os_lockless_truncates);
798 static ssize_t osc_stats_seq_write(struct file *file,
799 const char __user *buf,
800 size_t len, loff_t *off)
802 struct seq_file *seq = file->private_data;
803 struct obd_device *dev = seq->private;
804 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
806 memset(stats, 0, sizeof(*stats));
810 LPROC_SEQ_FOPS(osc_stats);
812 int lproc_osc_attach_seqstat(struct obd_device *dev)
816 rc = lprocfs_seq_create(dev->obd_proc_entry, "osc_stats", 0644,
817 &osc_stats_fops, dev);
819 rc = lprocfs_obd_seq_create(dev, "rpc_stats", 0644,
820 &osc_rpc_stats_fops, dev);
824 #endif /* CONFIG_PROC_FS */