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) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2011, 2015, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
32 * lustre/osd/osd_lproc.c
34 * Author: Mikhail Pershin <tappro@sun.com>
37 #define DEBUG_SUBSYSTEM S_OSD
39 #include <lprocfs_status.h>
41 #include "osd_internal.h"
45 void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf)
47 struct brw_stats *s = &osd->od_brw_stats;
48 sector_t *last_block = NULL;
49 struct page **pages = iobuf->dr_pages;
50 struct page *last_page = NULL;
51 unsigned long discont_pages = 0;
52 unsigned long discont_blocks = 0;
53 sector_t *blocks = iobuf->dr_blocks;
54 int i, nr_pages = iobuf->dr_npages;
56 int rw = iobuf->dr_rw;
58 if (unlikely(nr_pages == 0))
61 blocks_per_page = PAGE_SIZE >> osd_sb(osd)->s_blocksize_bits;
63 lprocfs_oh_tally_log2(&s->hist[BRW_R_PAGES+rw], nr_pages);
65 while (nr_pages-- > 0) {
66 if (last_page && (*pages)->index != (last_page->index + 1))
70 for (i = 0; i < blocks_per_page; i++) {
71 if (last_block && *blocks != (*last_block + 1))
73 last_block = blocks++;
77 lprocfs_oh_tally(&s->hist[BRW_R_DISCONT_PAGES+rw], discont_pages);
78 lprocfs_oh_tally(&s->hist[BRW_R_DISCONT_BLOCKS+rw], discont_blocks);
81 static void display_brw_stats(struct seq_file *seq, char *name, char *units,
82 struct obd_histogram *read, struct obd_histogram *write, int scale)
84 unsigned long read_tot, write_tot, r, w, read_cum = 0, write_cum = 0;
87 seq_printf(seq, "\n%26s read | write\n", " ");
88 seq_printf(seq, "%-22s %-5s %% cum %% | %-11s %% cum %%\n",
91 read_tot = lprocfs_oh_sum(read);
92 write_tot = lprocfs_oh_sum(write);
93 for (i = 0; i < OBD_HIST_MAX; i++) {
94 r = read->oh_buckets[i];
95 w = write->oh_buckets[i];
98 if (read_cum == 0 && write_cum == 0)
102 seq_printf(seq, "%u", i);
104 seq_printf(seq, "%u", scale << i);
106 seq_printf(seq, "%uK", scale << (i-10));
108 seq_printf(seq, "%uM", scale << (i-20));
110 seq_printf(seq, ":\t\t%10lu %3u %3u | %4lu %3u %3u\n",
111 r, pct(r, read_tot), pct(read_cum, read_tot),
112 w, pct(w, write_tot), pct(write_cum, write_tot));
114 if (read_cum == read_tot && write_cum == write_tot)
119 static void brw_stats_show(struct seq_file *seq, struct brw_stats *brw_stats)
121 struct timespec64 now;
123 /* this sampling races with updates */
124 ktime_get_real_ts64(&now);
126 seq_printf(seq, "snapshot_time: %lld.%09ld (secs.nsecs)\n",
127 (s64)now.tv_sec, now.tv_nsec);
129 display_brw_stats(seq, "pages per bulk r/w", "rpcs",
130 &brw_stats->hist[BRW_R_PAGES],
131 &brw_stats->hist[BRW_W_PAGES], 1);
133 display_brw_stats(seq, "discontiguous pages", "rpcs",
134 &brw_stats->hist[BRW_R_DISCONT_PAGES],
135 &brw_stats->hist[BRW_W_DISCONT_PAGES], 0);
137 display_brw_stats(seq, "discontiguous blocks", "rpcs",
138 &brw_stats->hist[BRW_R_DISCONT_BLOCKS],
139 &brw_stats->hist[BRW_W_DISCONT_BLOCKS], 0);
141 display_brw_stats(seq, "disk fragmented I/Os", "ios",
142 &brw_stats->hist[BRW_R_DIO_FRAGS],
143 &brw_stats->hist[BRW_W_DIO_FRAGS], 0);
145 display_brw_stats(seq, "disk I/Os in flight", "ios",
146 &brw_stats->hist[BRW_R_RPC_HIST],
147 &brw_stats->hist[BRW_W_RPC_HIST], 0);
149 display_brw_stats(seq, "I/O time (1/1000s)", "ios",
150 &brw_stats->hist[BRW_R_IO_TIME],
151 &brw_stats->hist[BRW_W_IO_TIME], 1);
153 display_brw_stats(seq, "disk I/O size", "ios",
154 &brw_stats->hist[BRW_R_DISK_IOSIZE],
155 &brw_stats->hist[BRW_W_DISK_IOSIZE], 1);
158 static int osd_brw_stats_seq_show(struct seq_file *seq, void *v)
160 struct osd_device *osd = seq->private;
162 brw_stats_show(seq, &osd->od_brw_stats);
167 static ssize_t osd_brw_stats_seq_write(struct file *file,
168 const char __user *buf,
169 size_t len, loff_t *off)
171 struct seq_file *seq = file->private_data;
172 struct osd_device *osd = seq->private;
175 for (i = 0; i < BRW_LAST; i++)
176 lprocfs_oh_clear(&osd->od_brw_stats.hist[i]);
181 LPROC_SEQ_FOPS(osd_brw_stats);
183 static int osd_stats_init(struct osd_device *osd)
188 for (i = 0; i < BRW_LAST; i++)
189 spin_lock_init(&osd->od_brw_stats.hist[i].oh_lock);
191 osd->od_stats = lprocfs_alloc_stats(LPROC_OSD_LAST, 0);
192 if (osd->od_stats != NULL) {
193 result = lprocfs_register_stats(osd->od_proc_entry, "stats",
198 lprocfs_counter_init(osd->od_stats, LPROC_OSD_GET_PAGE,
199 LPROCFS_CNTR_AVGMINMAX|LPROCFS_CNTR_STDDEV,
201 lprocfs_counter_init(osd->od_stats, LPROC_OSD_NO_PAGE,
202 LPROCFS_CNTR_AVGMINMAX,
203 "get_page_failures", "num");
204 lprocfs_counter_init(osd->od_stats, LPROC_OSD_CACHE_ACCESS,
205 LPROCFS_CNTR_AVGMINMAX,
206 "cache_access", "pages");
207 lprocfs_counter_init(osd->od_stats, LPROC_OSD_CACHE_HIT,
208 LPROCFS_CNTR_AVGMINMAX,
209 "cache_hit", "pages");
210 lprocfs_counter_init(osd->od_stats, LPROC_OSD_CACHE_MISS,
211 LPROCFS_CNTR_AVGMINMAX,
212 "cache_miss", "pages");
213 #if OSD_THANDLE_STATS
214 lprocfs_counter_init(osd->od_stats, LPROC_OSD_THANDLE_STARTING,
215 LPROCFS_CNTR_AVGMINMAX,
216 "thandle starting", "usec");
217 lprocfs_counter_init(osd->od_stats, LPROC_OSD_THANDLE_OPEN,
218 LPROCFS_CNTR_AVGMINMAX,
219 "thandle open", "usec");
220 lprocfs_counter_init(osd->od_stats, LPROC_OSD_THANDLE_CLOSING,
221 LPROCFS_CNTR_AVGMINMAX,
222 "thandle closing", "usec");
224 result = lprocfs_seq_create(osd->od_proc_entry, "brw_stats",
225 0644, &osd_brw_stats_fops, osd);
233 static ssize_t fstype_show(struct kobject *kobj, struct attribute *attr,
236 return sprintf(buf, "ldiskfs\n");
238 LUSTRE_RO_ATTR(fstype);
240 static ssize_t mntdev_show(struct kobject *kobj, struct attribute *attr,
243 struct dt_device *dt = container_of(kobj, struct dt_device,
245 struct osd_device *osd = osd_dt_dev(dt);
248 if (unlikely(!osd->od_mnt))
251 return sprintf(buf, "%s\n", osd->od_mntdev);
253 LUSTRE_RO_ATTR(mntdev);
255 static ssize_t read_cache_enable_show(struct kobject *kobj,
256 struct attribute *attr,
259 struct dt_device *dt = container_of(kobj, struct dt_device,
261 struct osd_device *osd = osd_dt_dev(dt);
264 if (unlikely(!osd->od_mnt))
267 return sprintf(buf, "%u\n", osd->od_read_cache);
270 static ssize_t read_cache_enable_store(struct kobject *kobj,
271 struct attribute *attr,
272 const char *buffer, size_t count)
274 struct dt_device *dt = container_of(kobj, struct dt_device,
276 struct osd_device *osd = osd_dt_dev(dt);
281 if (unlikely(!osd->od_mnt))
284 rc = kstrtobool(buffer, &val);
288 osd->od_read_cache = !!val;
291 LUSTRE_RW_ATTR(read_cache_enable);
293 static ssize_t writethrough_cache_enable_show(struct kobject *kobj,
294 struct attribute *attr,
297 struct dt_device *dt = container_of(kobj, struct dt_device,
299 struct osd_device *osd = osd_dt_dev(dt);
302 if (unlikely(!osd->od_mnt))
305 return sprintf(buf, "%u\n", osd->od_writethrough_cache);
308 static ssize_t writethrough_cache_enable_store(struct kobject *kobj,
309 struct attribute *attr,
313 struct dt_device *dt = container_of(kobj, struct dt_device,
315 struct osd_device *osd = osd_dt_dev(dt);
320 if (unlikely(!osd->od_mnt))
323 rc = kstrtobool(buffer, &val);
327 osd->od_writethrough_cache = !!val;
330 LUSTRE_RW_ATTR(writethrough_cache_enable);
332 static ssize_t fallocate_zero_blocks_show(struct kobject *kobj,
333 struct attribute *attr,
336 struct dt_device *dt = container_of(kobj, struct dt_device,
338 struct osd_device *osd = osd_dt_dev(dt);
341 if (unlikely(!osd->od_mnt))
344 return scnprintf(buf, PAGE_SIZE, "%d\n", osd->od_fallocate_zero_blocks);
348 * Set how fallocate() interacts with the backing filesystem:
349 * -1: fallocate is disabled and returns -EOPNOTSUPP
350 * 0: fallocate allocates unwritten extents (like ext4)
351 * 1: fallocate zeroes allocated extents on disk
353 static ssize_t fallocate_zero_blocks_store(struct kobject *kobj,
354 struct attribute *attr,
355 const char *buffer, size_t count)
357 struct dt_device *dt = container_of(kobj, struct dt_device,
359 struct osd_device *osd = osd_dt_dev(dt);
364 if (unlikely(!osd->od_mnt))
367 rc = kstrtol(buffer, 0, &val);
371 if (val < -1 || val > 1)
374 osd->od_fallocate_zero_blocks = val;
377 LUSTRE_RW_ATTR(fallocate_zero_blocks);
379 ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr,
380 const char *buffer, size_t count)
382 struct dt_device *dt = container_of(kobj, struct dt_device,
384 struct osd_device *osd = osd_dt_dev(dt);
389 if (unlikely(!osd->od_mnt))
392 rc = lu_env_init(&env, LCT_LOCAL);
396 rc = dt_sync(&env, dt);
399 return rc == 0 ? count : rc;
401 LUSTRE_WO_ATTR(force_sync);
403 static ssize_t nonrotational_show(struct kobject *kobj, struct attribute *attr,
406 struct dt_device *dt = container_of(kobj, struct dt_device,
408 struct osd_device *osd = osd_dt_dev(dt);
411 if (unlikely(!osd->od_mnt))
414 return sprintf(buf, "%u\n", osd->od_nonrotational);
417 static ssize_t nonrotational_store(struct kobject *kobj,
418 struct attribute *attr, const char *buffer,
421 struct dt_device *dt = container_of(kobj, struct dt_device,
423 struct osd_device *osd = osd_dt_dev(dt);
428 if (unlikely(!osd->od_mnt))
431 rc = kstrtobool(buffer, &val);
435 osd->od_nonrotational = val;
438 LUSTRE_RW_ATTR(nonrotational);
440 static ssize_t pdo_show(struct kobject *kobj, struct attribute *attr,
443 return sprintf(buf, "%s\n", ldiskfs_pdo ? "ON" : "OFF");
446 static ssize_t pdo_store(struct kobject *kobj, struct attribute *attr,
447 const char *buffer, size_t count)
452 rc = kstrtobool(buffer, &pdo);
462 static ssize_t auto_scrub_show(struct kobject *kobj, struct attribute *attr,
465 struct dt_device *dt = container_of(kobj, struct dt_device,
467 struct osd_device *dev = osd_dt_dev(dt);
470 if (unlikely(!dev->od_mnt))
473 return sprintf(buf, "%lld\n", dev->od_auto_scrub_interval);
476 static ssize_t auto_scrub_store(struct kobject *kobj, struct attribute *attr,
477 const char *buffer, size_t count)
479 struct dt_device *dt = container_of(kobj, struct dt_device,
481 struct osd_device *dev = osd_dt_dev(dt);
486 if (unlikely(!dev->od_mnt))
489 rc = kstrtoll(buffer, 0, &val);
493 dev->od_auto_scrub_interval = val;
496 LUSTRE_RW_ATTR(auto_scrub);
498 static ssize_t full_scrub_ratio_show(struct kobject *kobj,
499 struct attribute *attr,
502 struct dt_device *dt = container_of(kobj, struct dt_device,
504 struct osd_device *dev = osd_dt_dev(dt);
507 if (unlikely(!dev->od_mnt))
510 return sprintf(buf, "%llu\n", dev->od_full_scrub_ratio);
513 static ssize_t full_scrub_ratio_store(struct kobject *kobj,
514 struct attribute *attr,
515 const char *buffer, size_t count)
517 struct dt_device *dt = container_of(kobj, struct dt_device,
519 struct osd_device *dev = osd_dt_dev(dt);
524 if (unlikely(!dev->od_mnt))
527 rc = kstrtoll(buffer, 0, &val);
534 dev->od_full_scrub_ratio = val;
537 LUSTRE_RW_ATTR(full_scrub_ratio);
539 static ssize_t full_scrub_threshold_rate_show(struct kobject *kobj,
540 struct attribute *attr,
543 struct dt_device *dt = container_of(kobj, struct dt_device,
545 struct osd_device *dev = osd_dt_dev(dt);
548 if (unlikely(!dev->od_mnt))
551 return sprintf(buf, "%llu (bad OI mappings/minute)\n",
552 dev->od_full_scrub_threshold_rate);
555 static ssize_t full_scrub_threshold_rate_store(struct kobject *kobj,
556 struct attribute *attr,
557 const char *buffer, size_t count)
559 struct dt_device *dt = container_of(kobj, struct dt_device,
561 struct osd_device *dev = osd_dt_dev(dt);
566 if (unlikely(!dev->od_mnt))
569 rc = kstrtoull(buffer, 0, &val);
573 dev->od_full_scrub_threshold_rate = val;
576 LUSTRE_RW_ATTR(full_scrub_threshold_rate);
578 static int ldiskfs_osd_oi_scrub_seq_show(struct seq_file *m, void *data)
580 struct osd_device *dev = osd_dt_dev((struct dt_device *)m->private);
582 LASSERT(dev != NULL);
583 if (unlikely(dev->od_mnt == NULL))
586 osd_scrub_dump(m, dev);
590 LDEBUGFS_SEQ_FOPS_RO(ldiskfs_osd_oi_scrub);
592 static int ldiskfs_osd_readcache_seq_show(struct seq_file *m, void *data)
594 struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
596 LASSERT(osd != NULL);
597 if (unlikely(osd->od_mnt == NULL))
600 seq_printf(m, "%llu\n", osd->od_readcache_max_filesize);
605 ldiskfs_osd_readcache_seq_write(struct file *file, const char __user *buffer,
606 size_t count, loff_t *off)
608 struct seq_file *m = file->private_data;
609 struct dt_device *dt = m->private;
610 struct osd_device *osd = osd_dt_dev(dt);
611 char kernbuf[22] = "";
615 LASSERT(osd != NULL);
616 if (unlikely(osd->od_mnt == NULL))
619 if (count >= sizeof(kernbuf))
622 if (copy_from_user(kernbuf, buffer, count))
626 rc = sysfs_memparse(kernbuf, count, &val, "B");
630 osd->od_readcache_max_filesize = val > OSD_MAX_CACHE_SIZE ?
631 OSD_MAX_CACHE_SIZE : val;
635 LDEBUGFS_SEQ_FOPS(ldiskfs_osd_readcache);
637 static int ldiskfs_osd_readcache_max_io_seq_show(struct seq_file *m, void *data)
639 struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
641 LASSERT(osd != NULL);
642 if (unlikely(osd->od_mnt == NULL))
645 seq_printf(m, "%lu\n", osd->od_readcache_max_iosize >> 20);
650 ldiskfs_osd_readcache_max_io_seq_write(struct file *file,
651 const char __user *buffer,
652 size_t count, loff_t *off)
654 struct seq_file *m = file->private_data;
655 struct dt_device *dt = m->private;
656 struct osd_device *osd = osd_dt_dev(dt);
657 char kernbuf[22] = "";
661 LASSERT(osd != NULL);
662 if (unlikely(osd->od_mnt == NULL))
665 if (count >= sizeof(kernbuf))
668 if (copy_from_user(kernbuf, buffer, count))
672 rc = sysfs_memparse(kernbuf, count, &val, "MiB");
676 if (val > PTLRPC_MAX_BRW_SIZE)
678 osd->od_readcache_max_iosize = val;
682 LDEBUGFS_SEQ_FOPS(ldiskfs_osd_readcache_max_io);
684 static int ldiskfs_osd_writethrough_max_io_seq_show(struct seq_file *m,
687 struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
689 LASSERT(osd != NULL);
690 if (unlikely(osd->od_mnt == NULL))
693 seq_printf(m, "%lu\n", osd->od_writethrough_max_iosize >> 20);
698 ldiskfs_osd_writethrough_max_io_seq_write(struct file *file,
699 const char __user *buffer,
700 size_t count, loff_t *off)
702 struct seq_file *m = file->private_data;
703 struct dt_device *dt = m->private;
704 struct osd_device *osd = osd_dt_dev(dt);
705 char kernbuf[22] = "";
709 LASSERT(osd != NULL);
710 if (unlikely(osd->od_mnt == NULL))
713 if (count >= sizeof(kernbuf))
716 if (copy_from_user(kernbuf, buffer, count))
720 rc = sysfs_memparse(kernbuf, count, &val, "MiB");
724 if (val > PTLRPC_MAX_BRW_SIZE)
726 osd->od_writethrough_max_iosize = val;
730 LDEBUGFS_SEQ_FOPS(ldiskfs_osd_writethrough_max_io);
732 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 52, 0)
733 static ssize_t index_in_idif_show(struct kobject *kobj, struct attribute *attr,
736 struct dt_device *dt = container_of(kobj, struct dt_device,
738 struct osd_device *dev = osd_dt_dev(dt);
741 if (unlikely(!dev->od_mnt))
744 return sprintf(buf, "%d\n", (int)(dev->od_index_in_idif));
747 static ssize_t index_in_idif_store(struct kobject *kobj,
748 struct attribute *attr,
749 const char *buffer, size_t count)
751 struct dt_device *dt = container_of(kobj, struct dt_device,
753 struct osd_device *dev = osd_dt_dev(dt);
754 struct lu_target *tgt;
760 if (unlikely(!dev->od_mnt))
763 rc = kstrtobool(buffer, &val);
767 if (dev->od_index_in_idif) {
771 LCONSOLE_WARN("%s: OST-index in IDIF has been enabled, "
772 "it cannot be reverted back.\n", osd_name(dev));
779 rc = lu_env_init(&env, LCT_DT_THREAD);
783 tgt = dev->od_dt_dev.dd_lu_dev.ld_site->ls_tgt;
784 tgt->lut_lsd.lsd_feature_rocompat |= OBD_ROCOMPAT_IDX_IN_IDIF;
785 rc = tgt_server_data_update(&env, tgt, 1);
790 LCONSOLE_INFO("%s: enable OST-index in IDIF successfully, "
791 "it cannot be reverted back.\n", osd_name(dev));
793 dev->od_index_in_idif = 1;
796 LUSTRE_RW_ATTR(index_in_idif);
798 int osd_register_proc_index_in_idif(struct osd_device *osd)
800 struct dt_device *dt = &osd->od_dt_dev;
802 return sysfs_create_file(&dt->dd_kobj, &lustre_attr_index_in_idif.attr);
806 static ssize_t index_backup_show(struct kobject *kobj, struct attribute *attr,
809 struct dt_device *dt = container_of(kobj, struct dt_device,
811 struct osd_device *dev = osd_dt_dev(dt);
814 if (unlikely(!dev->od_mnt))
817 return sprintf(buf, "%d\n", dev->od_index_backup_policy);
820 ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr,
821 const char *buffer, size_t count)
823 struct dt_device *dt = container_of(kobj, struct dt_device,
825 struct osd_device *dev = osd_dt_dev(dt);
830 if (unlikely(!dev->od_mnt))
833 rc = kstrtoint(buffer, 0, &val);
837 dev->od_index_backup_policy = val;
840 LUSTRE_RW_ATTR(index_backup);
842 struct ldebugfs_vars ldebugfs_osd_obd_vars[] = {
843 { .name = "oi_scrub",
844 .fops = &ldiskfs_osd_oi_scrub_fops },
845 { .name = "readcache_max_filesize",
846 .fops = &ldiskfs_osd_readcache_fops },
847 { .name = "readcache_max_io_mb",
848 .fops = &ldiskfs_osd_readcache_max_io_fops },
849 { .name = "writethrough_max_io_mb",
850 .fops = &ldiskfs_osd_writethrough_max_io_fops },
854 static struct attribute *ldiskfs_attrs[] = {
855 &lustre_attr_read_cache_enable.attr,
856 &lustre_attr_writethrough_cache_enable.attr,
857 &lustre_attr_fstype.attr,
858 &lustre_attr_mntdev.attr,
859 &lustre_attr_fallocate_zero_blocks.attr,
860 &lustre_attr_force_sync.attr,
861 &lustre_attr_nonrotational.attr,
862 &lustre_attr_index_backup.attr,
863 &lustre_attr_auto_scrub.attr,
864 &lustre_attr_pdo.attr,
865 &lustre_attr_full_scrub_ratio.attr,
866 &lustre_attr_full_scrub_threshold_rate.attr,
870 int osd_procfs_init(struct osd_device *osd, const char *name)
872 struct obd_type *type;
877 /* at the moment there is no linkage between lu_type
878 * and obd_type, so we lookup obd_type this way
880 type = class_search_type(LUSTRE_OSD_LDISKFS_NAME);
885 CDEBUG(D_CONFIG, "%s: register osd-ldiskfs tunable parameters\n", name);
887 /* put reference taken by class_search_type */
888 kobject_put(&type->typ_kobj);
890 osd->od_dt_dev.dd_ktype.default_attrs = ldiskfs_attrs;
891 rc = dt_tunables_init(&osd->od_dt_dev, type, name,
892 ldebugfs_osd_obd_vars);
894 CERROR("%s: cannot setup sysfs / debugfs entry: %d\n",
899 if (osd->od_proc_entry)
902 /* Find the type procroot and add the proc entry for this device */
903 osd->od_proc_entry = lprocfs_register(name, type->typ_procroot,
904 NULL, &osd->od_dt_dev);
905 if (IS_ERR(osd->od_proc_entry)) {
906 rc = PTR_ERR(osd->od_proc_entry);
907 CERROR("Error %d setting up lprocfs for %s\n",
909 osd->od_proc_entry = NULL;
913 rc = osd_stats_init(osd);
918 osd_procfs_fini(osd);
922 int osd_procfs_fini(struct osd_device *osd)
925 lprocfs_free_stats(&osd->od_stats);
927 if (osd->od_proc_entry)
928 lprocfs_remove(&osd->od_proc_entry);
930 return dt_tunables_fini(&osd->od_dt_dev);