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, 2013, 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 <linux/version.h>
39 #include <asm/statfs.h>
40 #include <obd_cksum.h>
41 #include <obd_class.h>
42 #include <lprocfs_status.h>
43 #include <linux/seq_file.h>
44 #include "osc_internal.h"
47 static int osc_active_seq_show(struct seq_file *m, void *v)
49 struct obd_device *dev = m->private;
52 LPROCFS_CLIMP_CHECK(dev);
53 rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
54 LPROCFS_CLIMP_EXIT(dev);
58 static ssize_t osc_active_seq_write(struct file *file, const char *buffer,
59 size_t count, loff_t *off)
61 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
64 rc = lprocfs_write_helper(buffer, count, &val);
67 if (val < 0 || val > 1)
71 if (dev->u.cli.cl_import->imp_deactive == val)
72 rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
74 CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n", val);
78 LPROC_SEQ_FOPS(osc_active);
80 static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
82 struct obd_device *dev = m->private;
83 struct client_obd *cli = &dev->u.cli;
86 client_obd_list_lock(&cli->cl_loi_list_lock);
87 rc = seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
88 client_obd_list_unlock(&cli->cl_loi_list_lock);
92 static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
94 size_t count, loff_t *off)
96 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
97 struct client_obd *cli = &dev->u.cli;
98 struct ptlrpc_request_pool *pool = cli->cl_import->imp_rq_pool;
101 rc = lprocfs_write_helper(buffer, count, &val);
105 if (val < 1 || val > OSC_MAX_RIF_MAX)
108 LPROCFS_CLIMP_CHECK(dev);
109 if (pool && val > cli->cl_max_rpcs_in_flight)
110 pool->prp_populate(pool, val-cli->cl_max_rpcs_in_flight);
112 client_obd_list_lock(&cli->cl_loi_list_lock);
113 cli->cl_max_rpcs_in_flight = val;
114 client_obd_list_unlock(&cli->cl_loi_list_lock);
116 LPROCFS_CLIMP_EXIT(dev);
119 LPROC_SEQ_FOPS(osc_max_rpcs_in_flight);
121 static int osc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
123 struct obd_device *dev = m->private;
124 struct client_obd *cli = &dev->u.cli;
128 client_obd_list_lock(&cli->cl_loi_list_lock);
129 val = cli->cl_dirty_max;
130 client_obd_list_unlock(&cli->cl_loi_list_lock);
133 return lprocfs_seq_read_frac_helper(m, val, mult);
136 static ssize_t osc_max_dirty_mb_seq_write(struct file *file, const char *buffer,
137 size_t count, loff_t *off)
139 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
140 struct client_obd *cli = &dev->u.cli;
141 int pages_number, mult, rc;
143 mult = 1 << (20 - PAGE_CACHE_SHIFT);
144 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
148 if (pages_number <= 0 ||
149 pages_number > OSC_MAX_DIRTY_MB_MAX << (20 - PAGE_CACHE_SHIFT) ||
150 pages_number > totalram_pages / 4) /* 1/4 of RAM */
153 client_obd_list_lock(&cli->cl_loi_list_lock);
154 cli->cl_dirty_max = (obd_count)(pages_number << PAGE_CACHE_SHIFT);
155 osc_wake_cache_waiters(cli);
156 client_obd_list_unlock(&cli->cl_loi_list_lock);
160 LPROC_SEQ_FOPS(osc_max_dirty_mb);
162 static int osc_cached_mb_seq_show(struct seq_file *m, void *v)
164 struct obd_device *dev = m->private;
165 struct client_obd *cli = &dev->u.cli;
166 int shift = 20 - PAGE_CACHE_SHIFT;
172 (atomic_read(&cli->cl_lru_in_list) +
173 atomic_read(&cli->cl_lru_busy)) >> shift,
174 atomic_read(&cli->cl_lru_busy));
179 /* shrink the number of caching pages to a specific number */
181 osc_cached_mb_seq_write(struct file *file, const char *buffer,
182 size_t count, loff_t *off)
184 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
185 struct client_obd *cli = &dev->u.cli;
186 int pages_number, mult, rc;
188 mult = 1 << (20 - PAGE_CACHE_SHIFT);
189 buffer = lprocfs_find_named_value(buffer, "used_mb:", &count);
190 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
194 if (pages_number < 0)
197 rc = atomic_read(&cli->cl_lru_in_list) - pages_number;
202 env = cl_env_get(&refcheck);
204 (void)osc_lru_shrink(env, cli, rc, true);
205 cl_env_put(env, &refcheck);
211 LPROC_SEQ_FOPS(osc_cached_mb);
213 static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v)
215 struct obd_device *dev = m->private;
216 struct client_obd *cli = &dev->u.cli;
219 client_obd_list_lock(&cli->cl_loi_list_lock);
220 rc = seq_printf(m, "%lu\n", cli->cl_dirty);
221 client_obd_list_unlock(&cli->cl_loi_list_lock);
224 LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes);
226 static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
228 struct obd_device *dev = m->private;
229 struct client_obd *cli = &dev->u.cli;
232 client_obd_list_lock(&cli->cl_loi_list_lock);
233 rc = seq_printf(m, "%lu\n", cli->cl_avail_grant);
234 client_obd_list_unlock(&cli->cl_loi_list_lock);
238 static ssize_t osc_cur_grant_bytes_seq_write(struct file *file, const char *buffer,
239 size_t count, loff_t *off)
241 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
242 struct client_obd *cli = &obd->u.cli;
249 rc = lprocfs_write_u64_helper(buffer, count, &val);
253 /* this is only for shrinking grant */
254 client_obd_list_lock(&cli->cl_loi_list_lock);
255 if (val >= cli->cl_avail_grant) {
256 client_obd_list_unlock(&cli->cl_loi_list_lock);
259 client_obd_list_unlock(&cli->cl_loi_list_lock);
261 LPROCFS_CLIMP_CHECK(obd);
262 if (cli->cl_import->imp_state == LUSTRE_IMP_FULL)
263 rc = osc_shrink_grant_to_target(cli, val);
264 LPROCFS_CLIMP_EXIT(obd);
269 LPROC_SEQ_FOPS(osc_cur_grant_bytes);
271 static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v)
273 struct obd_device *dev = m->private;
274 struct client_obd *cli = &dev->u.cli;
277 client_obd_list_lock(&cli->cl_loi_list_lock);
278 rc = seq_printf(m, "%lu\n", cli->cl_lost_grant);
279 client_obd_list_unlock(&cli->cl_loi_list_lock);
282 LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes);
284 static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
286 struct obd_device *obd = m->private;
290 return seq_printf(m, "%d\n",
291 obd->u.cli.cl_grant_shrink_interval);
294 static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
296 size_t count, loff_t *off)
298 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
304 rc = lprocfs_write_helper(buffer, count, &val);
311 obd->u.cli.cl_grant_shrink_interval = val;
315 LPROC_SEQ_FOPS(osc_grant_shrink_interval);
317 static int osc_checksum_seq_show(struct seq_file *m, void *v)
319 struct obd_device *obd = m->private;
324 return seq_printf(m, "%d\n",
325 obd->u.cli.cl_checksum ? 1 : 0);
328 static ssize_t osc_checksum_seq_write(struct file *file, const char *buffer,
329 size_t count, loff_t *off)
331 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
337 rc = lprocfs_write_helper(buffer, count, &val);
341 obd->u.cli.cl_checksum = (val ? 1 : 0);
345 LPROC_SEQ_FOPS(osc_checksum);
347 static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
349 struct obd_device *obd = m->private;
356 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
357 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
359 if (obd->u.cli.cl_cksum_type == (1 << i))
360 seq_printf(m, "[%s] ", cksum_name[i]);
362 seq_printf(m, "%s ", cksum_name[i]);
368 static ssize_t osc_checksum_type_seq_write(struct file *file, const char *buffer,
369 size_t count, loff_t *off)
371 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
379 if (count > sizeof(kernbuf) - 1)
381 if (copy_from_user(kernbuf, buffer, count))
383 if (count > 0 && kernbuf[count - 1] == '\n')
384 kernbuf[count - 1] = '\0';
386 kernbuf[count] = '\0';
388 for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
389 if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
391 if (!strcmp(kernbuf, cksum_name[i])) {
392 obd->u.cli.cl_cksum_type = 1 << i;
398 LPROC_SEQ_FOPS(osc_checksum_type);
400 static int osc_resend_count_seq_show(struct seq_file *m, void *v)
402 struct obd_device *obd = m->private;
404 return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
407 static ssize_t osc_resend_count_seq_write(struct file *file, const char *buffer,
408 size_t count, loff_t *off)
410 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
413 rc = lprocfs_write_helper(buffer, count, &val);
420 atomic_set(&obd->u.cli.cl_resends, val);
424 LPROC_SEQ_FOPS(osc_resend_count);
426 static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
428 struct obd_device *obd = m->private;
429 struct osc_device *od = obd2osc_dev(obd);
431 return seq_printf(m, "%u\n", od->od_contention_time);
434 static ssize_t osc_contention_seconds_seq_write(struct file *file, const char *buffer,
435 size_t count, loff_t *off)
437 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
438 struct osc_device *od = obd2osc_dev(obd);
440 return lprocfs_write_helper(buffer, count, &od->od_contention_time) ?: count;
442 LPROC_SEQ_FOPS(osc_contention_seconds);
444 static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
446 struct obd_device *obd = m->private;
447 struct osc_device *od = obd2osc_dev(obd);
449 return seq_printf(m, "%u\n", od->od_lockless_truncate);
452 static ssize_t osc_lockless_truncate_seq_write(struct file *file, const char *buffer,
453 size_t count, loff_t *off)
455 struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
456 struct osc_device *od = obd2osc_dev(obd);
458 return lprocfs_write_helper(buffer, count, &od->od_lockless_truncate) ?:
461 LPROC_SEQ_FOPS(osc_lockless_truncate);
463 static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
465 struct obd_device *obd = m->private;
466 return seq_printf(m, "%u\n",
467 atomic_read(&obd->u.cli.cl_destroy_in_flight));
469 LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
471 static int osc_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
473 return lprocfs_obd_max_pages_per_rpc_seq_show(m, m->private);
476 static ssize_t osc_obd_max_pages_per_rpc_seq_write(struct file *file,
478 size_t count, loff_t *off)
480 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
481 struct client_obd *cli = &dev->u.cli;
482 struct obd_connect_data *ocd = &cli->cl_import->imp_connect_data;
486 rc = lprocfs_write_u64_helper(buffer, count, &val);
490 /* if the max_pages is specified in bytes, convert to pages */
491 if (val >= ONE_MB_BRW_SIZE)
492 val >>= PAGE_CACHE_SHIFT;
494 LPROCFS_CLIMP_CHECK(dev);
496 chunk_mask = ~((1 << (cli->cl_chunkbits - PAGE_CACHE_SHIFT)) - 1);
497 /* max_pages_per_rpc must be chunk aligned */
498 val = (val + ~chunk_mask) & chunk_mask;
499 if (val == 0 || val > ocd->ocd_brw_size >> PAGE_CACHE_SHIFT) {
500 LPROCFS_CLIMP_EXIT(dev);
503 client_obd_list_lock(&cli->cl_loi_list_lock);
504 cli->cl_max_pages_per_rpc = val;
505 client_obd_list_unlock(&cli->cl_loi_list_lock);
507 LPROCFS_CLIMP_EXIT(dev);
510 LPROC_SEQ_FOPS(osc_obd_max_pages_per_rpc);
512 static int osc_unstable_stats_seq_show(struct seq_file *m, void *v)
514 struct obd_device *dev = m->private;
515 struct client_obd *cli = &dev->u.cli;
518 pages = atomic_read(&cli->cl_unstable_count);
519 mb = (pages * PAGE_CACHE_SIZE) >> 20;
521 return seq_printf(m, "unstable_pages: %8d\n"
522 "unstable_mb: %8d\n",
525 LPROC_SEQ_FOPS_RO(osc_unstable_stats);
527 LPROC_SEQ_FOPS_RO_TYPE(osc, uuid);
528 LPROC_SEQ_FOPS_RO_TYPE(osc, connect_flags);
529 LPROC_SEQ_FOPS_RO_TYPE(osc, blksize);
530 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytestotal);
531 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytesfree);
532 LPROC_SEQ_FOPS_RO_TYPE(osc, kbytesavail);
533 LPROC_SEQ_FOPS_RO_TYPE(osc, filestotal);
534 LPROC_SEQ_FOPS_RO_TYPE(osc, filesfree);
535 LPROC_SEQ_FOPS_RO_TYPE(osc, server_uuid);
536 LPROC_SEQ_FOPS_RO_TYPE(osc, conn_uuid);
537 LPROC_SEQ_FOPS_RO_TYPE(osc, timeouts);
538 LPROC_SEQ_FOPS_RO_TYPE(osc, state);
540 LPROC_SEQ_FOPS_WO_TYPE(osc, ping);
542 LPROC_SEQ_FOPS_RW_TYPE(osc, import);
543 LPROC_SEQ_FOPS_RW_TYPE(osc, pinger_recov);
545 struct lprocfs_seq_vars lprocfs_osc_obd_vars[] = {
546 { "uuid", &osc_uuid_fops },
547 { "ping", &osc_ping_fops, 0, 0222 },
548 { "connect_flags", &osc_connect_flags_fops },
549 { "blocksize", &osc_blksize_fops },
550 { "kbytestotal", &osc_kbytestotal_fops },
551 { "kbytesfree", &osc_kbytesfree_fops },
552 { "kbytesavail", &osc_kbytesavail_fops },
553 { "filestotal", &osc_filestotal_fops },
554 { "filesfree", &osc_filesfree_fops },
555 { "ost_server_uuid", &osc_server_uuid_fops },
556 { "ost_conn_uuid", &osc_conn_uuid_fops },
557 { "active", &osc_active_fops },
558 { "max_pages_per_rpc", &osc_obd_max_pages_per_rpc_fops },
559 { "max_rpcs_in_flight", &osc_max_rpcs_in_flight_fops },
560 { "destroys_in_flight", &osc_destroys_in_flight_fops },
561 { "max_dirty_mb", &osc_max_dirty_mb_fops },
562 { "osc_cached_mb", &osc_cached_mb_fops },
563 { "cur_dirty_bytes", &osc_cur_dirty_bytes_fops },
564 { "cur_grant_bytes", &osc_cur_grant_bytes_fops },
565 { "cur_lost_grant_bytes", &osc_cur_lost_grant_bytes_fops },
566 { "grant_shrink_interval", &osc_grant_shrink_interval_fops },
567 { "checksums", &osc_checksum_fops },
568 { "checksum_type", &osc_checksum_type_fops },
569 { "resend_count", &osc_resend_count_fops },
570 { "timeouts", &osc_timeouts_fops },
571 { "contention_seconds", &osc_contention_seconds_fops },
572 { "lockless_truncate", &osc_lockless_truncate_fops },
573 { "import", &osc_import_fops },
574 { "state", &osc_state_fops },
575 { "pinger_recov", &osc_pinger_recov_fops },
576 { "unstable_stats", &osc_unstable_stats_fops },
580 #define pct(a,b) (b ? a * 100 / b : 0)
582 static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
585 struct obd_device *dev = seq->private;
586 struct client_obd *cli = &dev->u.cli;
587 unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
590 do_gettimeofday(&now);
592 client_obd_list_lock(&cli->cl_loi_list_lock);
594 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
595 now.tv_sec, now.tv_usec);
596 seq_printf(seq, "read RPCs in flight: %d\n",
597 cli->cl_r_in_flight);
598 seq_printf(seq, "write RPCs in flight: %d\n",
599 cli->cl_w_in_flight);
600 seq_printf(seq, "pending write pages: %d\n",
601 atomic_read(&cli->cl_pending_w_pages));
602 seq_printf(seq, "pending read pages: %d\n",
603 atomic_read(&cli->cl_pending_r_pages));
605 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
606 seq_printf(seq, "pages per rpc rpcs %% cum %% |");
607 seq_printf(seq, " rpcs %% cum %%\n");
609 read_tot = lprocfs_oh_sum(&cli->cl_read_page_hist);
610 write_tot = lprocfs_oh_sum(&cli->cl_write_page_hist);
614 for (i = 0; i < OBD_HIST_MAX; i++) {
615 unsigned long r = cli->cl_read_page_hist.oh_buckets[i];
616 unsigned long w = cli->cl_write_page_hist.oh_buckets[i];
620 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
621 1 << 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, "rpcs in flight rpcs %% cum %% |");
631 seq_printf(seq, " rpcs %% cum %%\n");
633 read_tot = lprocfs_oh_sum(&cli->cl_read_rpc_hist);
634 write_tot = lprocfs_oh_sum(&cli->cl_write_rpc_hist);
638 for (i = 0; i < OBD_HIST_MAX; i++) {
639 unsigned long r = cli->cl_read_rpc_hist.oh_buckets[i];
640 unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
643 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
644 i, r, pct(r, read_tot),
645 pct(read_cum, read_tot), w,
647 pct(write_cum, write_tot));
648 if (read_cum == read_tot && write_cum == write_tot)
652 seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
653 seq_printf(seq, "offset rpcs %% cum %% |");
654 seq_printf(seq, " rpcs %% cum %%\n");
656 read_tot = lprocfs_oh_sum(&cli->cl_read_offset_hist);
657 write_tot = lprocfs_oh_sum(&cli->cl_write_offset_hist);
661 for (i = 0; i < OBD_HIST_MAX; i++) {
662 unsigned long r = cli->cl_read_offset_hist.oh_buckets[i];
663 unsigned long w = cli->cl_write_offset_hist.oh_buckets[i];
666 seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
667 (i == 0) ? 0 : 1 << (i - 1),
668 r, pct(r, read_tot), pct(read_cum, read_tot),
669 w, pct(w, write_tot), pct(write_cum, write_tot));
670 if (read_cum == read_tot && write_cum == write_tot)
674 client_obd_list_unlock(&cli->cl_loi_list_lock);
680 static ssize_t osc_rpc_stats_seq_write(struct file *file, const char *buf,
681 size_t len, loff_t *off)
683 struct seq_file *seq = file->private_data;
684 struct obd_device *dev = seq->private;
685 struct client_obd *cli = &dev->u.cli;
687 lprocfs_oh_clear(&cli->cl_read_rpc_hist);
688 lprocfs_oh_clear(&cli->cl_write_rpc_hist);
689 lprocfs_oh_clear(&cli->cl_read_page_hist);
690 lprocfs_oh_clear(&cli->cl_write_page_hist);
691 lprocfs_oh_clear(&cli->cl_read_offset_hist);
692 lprocfs_oh_clear(&cli->cl_write_offset_hist);
696 LPROC_SEQ_FOPS(osc_rpc_stats);
698 static int osc_stats_seq_show(struct seq_file *seq, void *v)
701 struct obd_device *dev = seq->private;
702 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
704 do_gettimeofday(&now);
706 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
707 now.tv_sec, now.tv_usec);
708 seq_printf(seq, "lockless_write_bytes\t\t"LPU64"\n",
709 stats->os_lockless_writes);
710 seq_printf(seq, "lockless_read_bytes\t\t"LPU64"\n",
711 stats->os_lockless_reads);
712 seq_printf(seq, "lockless_truncate\t\t"LPU64"\n",
713 stats->os_lockless_truncates);
717 static ssize_t osc_stats_seq_write(struct file *file, const char *buf,
718 size_t len, loff_t *off)
720 struct seq_file *seq = file->private_data;
721 struct obd_device *dev = seq->private;
722 struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
724 memset(stats, 0, sizeof(*stats));
728 LPROC_SEQ_FOPS(osc_stats);
730 int lproc_osc_attach_seqstat(struct obd_device *dev)
734 rc = lprocfs_seq_create(dev->obd_proc_entry, "osc_stats", 0644,
735 &osc_stats_fops, dev);
737 rc = lprocfs_obd_seq_create(dev, "rpc_stats", 0644,
738 &osc_rpc_stats_fops, dev);