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 2008 Sun Microsystems, Inc. All rights reserved
24 * Use is subject to license terms.
26 * Copyright (c) 2012, 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 <lprocfs_status.h>
35 #include <obd_class.h>
36 #include <linux/seq_file.h>
37 #include "lod_internal.h"
38 #include <uapi/linux/lustre/lustre_param.h>
41 * Notice, all the functions below (except for lod_procfs_init() and
42 * lod_procfs_fini()) are not supposed to be used directly. They are
43 * called by Linux kernel's procfs.
49 * Show default stripe size.
51 * \param[in] m seq file
52 * \param[in] v unused for single entry
54 * \retval 0 on success
55 * \retval negative error code if failed
57 static int lod_dom_stripesize_seq_show(struct seq_file *m, void *v)
59 struct obd_device *dev = m->private;
60 struct lod_device *lod;
63 lod = lu2lod_dev(dev->obd_lu_dev);
64 seq_printf(m, "%u\n", lod->lod_dom_max_stripesize);
69 * Set default stripe size.
71 * \param[in] file proc file
72 * \param[in] buffer string containing the maximum number of bytes stored in
73 * each object before moving to the next object in the
75 * \param[in] count @buffer length
76 * \param[in] off unused for single entry
78 * \retval @count on success
79 * \retval negative error code if failed
82 lod_dom_stripesize_seq_write(struct file *file, const char __user *buffer,
83 size_t count, loff_t *off)
85 struct seq_file *m = file->private_data;
86 struct obd_device *dev = m->private;
87 struct lod_device *lod;
92 lod = lu2lod_dev(dev->obd_lu_dev);
93 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
99 /* 1GB is the limit */
100 if (val > (1ULL << 30))
103 if (val < LOV_MIN_STRIPE_SIZE) {
104 LCONSOLE_INFO("Increasing provided stripe size to "
105 "a minimum value %u\n",
106 LOV_MIN_STRIPE_SIZE);
107 val = LOV_MIN_STRIPE_SIZE;
108 } else if (val & (LOV_MIN_STRIPE_SIZE - 1)) {
109 val &= ~(LOV_MIN_STRIPE_SIZE - 1);
110 LCONSOLE_WARN("Changing provided stripe size to %llu "
111 "(a multiple of minimum %u)\n",
112 val, LOV_MIN_STRIPE_SIZE);
116 lod->lod_dom_max_stripesize = val;
120 LPROC_SEQ_FOPS(lod_dom_stripesize);
123 * Show default stripe size.
125 * \param[in] m seq file
126 * \param[in] v unused for single entry
128 * \retval 0 on success
129 * \retval negative error code if failed
131 static int lod_stripesize_seq_show(struct seq_file *m, void *v)
133 struct obd_device *dev = m->private;
134 struct lod_device *lod;
136 LASSERT(dev != NULL);
137 lod = lu2lod_dev(dev->obd_lu_dev);
138 seq_printf(m, "%llu\n",
139 lod->lod_ost_descs.ltd_lov_desc.ld_default_stripe_size);
144 * Set default stripe size.
146 * \param[in] file proc file
147 * \param[in] buffer string containing the maximum number of bytes stored in
148 * each object before moving to the next object in the
150 * \param[in] count @buffer length
151 * \param[in] off unused for single entry
153 * \retval @count on success
154 * \retval negative error code if failed
157 lod_stripesize_seq_write(struct file *file, const char __user *buffer,
158 size_t count, loff_t *off)
160 struct seq_file *m = file->private_data;
161 struct obd_device *dev = m->private;
162 struct lod_device *lod;
166 LASSERT(dev != NULL);
167 lod = lu2lod_dev(dev->obd_lu_dev);
168 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
174 lod_fix_desc_stripe_size(&val);
175 lod->lod_ost_descs.ltd_lov_desc.ld_default_stripe_size = val;
179 LPROC_SEQ_FOPS(lod_stripesize);
182 * Show default stripe offset.
184 * \param[in] m seq file
185 * \param[in] v unused for single entry
187 * \retval 0 on success
188 * \retval negative error code if failed
190 static ssize_t stripeoffset_show(struct kobject *kobj, struct attribute *attr,
193 struct dt_device *dt = container_of(kobj, struct dt_device,
195 struct lod_device *lod = dt2lod_dev(dt);
197 return sprintf(buf, "%lld\n",
198 lod->lod_ost_descs.ltd_lov_desc.ld_default_stripe_offset);
202 * Set default stripe offset.
204 * Usually contains -1 allowing Lustre to balance objects among OST
205 * otherwise may cause severe OST imbalance.
207 * \param[in] file proc file
208 * \param[in] buffer string describing starting OST index for new files
209 * \param[in] count @buffer length
210 * \param[in] off unused for single entry
212 * \retval @count on success
213 * \retval negative error code if failed
215 static ssize_t stripeoffset_store(struct kobject *kobj, struct attribute *attr,
216 const char *buffer, size_t count)
218 struct dt_device *dt = container_of(kobj, struct dt_device,
220 struct lod_device *lod = dt2lod_dev(dt);
224 rc = kstrtol(buffer, 0, &val);
228 if (val < -1 || val > LOV_MAX_STRIPE_COUNT)
231 lod->lod_ost_descs.ltd_lov_desc.ld_default_stripe_offset = val;
235 LUSTRE_RW_ATTR(stripeoffset);
238 * Show default striping pattern (LOV_PATTERN_*).
240 * \param[in] m seq file
241 * \param[in] v unused for single entry
243 * \retval 0 on success
244 * \retval negative error code if failed
246 static ssize_t stripetype_show(struct kobject *kobj, struct attribute *attr,
249 struct dt_device *dt = container_of(kobj, struct dt_device,
251 struct lod_device *lod = dt2lod_dev(dt);
253 return sprintf(buf, "%u\n", lod->lod_ost_descs.ltd_lov_desc.ld_pattern);
257 * Set default striping pattern (a number, not a human-readable string).
259 * \param[in] file proc file
260 * \param[in] buffer string containing the default striping pattern for new
261 * files. This is an integer LOV_PATTERN_* value
262 * \param[in] count @buffer length
263 * \param[in] off unused for single entry
265 * \retval @count on success
266 * \retval negative error code if failed
268 static ssize_t stripetype_store(struct kobject *kobj, struct attribute *attr,
269 const char *buffer, size_t count)
271 struct dt_device *dt = container_of(kobj, struct dt_device,
273 struct lod_device *lod = dt2lod_dev(dt);
277 rc = kstrtouint(buffer, 0, &pattern);
281 lod_fix_desc_pattern(&pattern);
282 lod->lod_ost_descs.ltd_lov_desc.ld_pattern = pattern;
286 LUSTRE_RW_ATTR(stripetype);
289 * Show default number of stripes.
291 * \param[in] m seq file
292 * \param[in] v unused for single entry
294 * \retval 0 on success,
295 * \retval negative error code if failed
297 static ssize_t stripecount_show(struct kobject *kobj, struct attribute *attr,
300 struct dt_device *dt = container_of(kobj, struct dt_device,
302 struct lod_device *lod = dt2lod_dev(dt);
303 struct lov_desc *desc = &lod->lod_ost_descs.ltd_lov_desc;
305 return sprintf(buf, "%d\n",
306 (s16)(desc->ld_default_stripe_count + 1) - 1);
310 * Set default number of stripes.
312 * \param[in] file proc file
313 * \param[in] buffer string containing the default number of stripes
315 * \param[in] count @buffer length
316 * \param[in] off unused for single entry
318 * \retval @count on success
319 * \retval negative error code otherwise
321 static ssize_t stripecount_store(struct kobject *kobj, struct attribute *attr,
322 const char *buffer, size_t count)
324 struct dt_device *dt = container_of(kobj, struct dt_device,
326 struct lod_device *lod = dt2lod_dev(dt);
330 rc = kstrtoint(buffer, 0, &stripe_count);
334 if (stripe_count < -1)
337 lod_fix_desc_stripe_count(&stripe_count);
338 lod->lod_ost_descs.ltd_lov_desc.ld_default_stripe_count = stripe_count;
342 LUSTRE_RW_ATTR(stripecount);
345 * Show number of targets.
347 * \param[in] m seq file
348 * \param[in] v unused for single entry
350 * \retval 0 on success
351 * \retval negative error code if failed
353 static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr,
356 struct dt_device *dt = container_of(kobj, struct dt_device,
358 struct lod_device *lod = dt2lod_dev(dt);
360 return sprintf(buf, "%u\n", lod->lod_ost_count);
362 LUSTRE_RO_ATTR(numobd);
365 * Show number of active targets.
367 * \param[in] m seq file
368 * \param[in] v unused for single entry
370 * \retval 0 on success
371 * \retval negative error code if failed
373 static ssize_t activeobd_show(struct kobject *kobj, struct attribute *attr,
376 struct dt_device *dt = container_of(kobj, struct dt_device,
378 struct lod_device *lod = dt2lod_dev(dt);
380 return sprintf(buf, "%u\n",
381 lod->lod_ost_descs.ltd_lov_desc.ld_active_tgt_count);
383 LUSTRE_RO_ATTR(activeobd);
386 * Show UUID of LOD device.
388 * \param[in] m seq file
389 * \param[in] v unused for single entry
391 * \retval 0 on success
392 * \retval negative error code if failed
394 static ssize_t desc_uuid_show(struct kobject *kobj, struct attribute *attr,
397 struct dt_device *dt = container_of(kobj, struct dt_device,
399 struct lod_device *lod = dt2lod_dev(dt);
401 return sprintf(buf, "%s\n",
402 lod->lod_ost_descs.ltd_lov_desc.ld_uuid.uuid);
404 LUSTRE_RO_ATTR(desc_uuid);
407 * Show QoS priority parameter.
409 * The printed value is a percentage value (0-100%) indicating the priority
410 * of free space compared to performance. 0% means select OSTs equally
411 * regardless of their free space, 100% means select OSTs only by their free
412 * space even if it results in very imbalanced load on the OSTs.
414 * \param[in] m seq file
415 * \param[in] v unused for single entry
417 * \retval 0 on success
418 * \retval negative error code if failed
420 static ssize_t qos_prio_free_show(struct kobject *kobj, struct attribute *attr,
423 struct dt_device *dt = container_of(kobj, struct dt_device,
425 struct lod_device *lod = dt2lod_dev(dt);
427 return sprintf(buf, "%d%%\n",
428 (lod->lod_ost_descs.ltd_qos.lq_prio_free * 100 + 255) >>
433 * Set QoS free space priority parameter.
435 * Set the relative priority of free OST space compared to OST load when OSTs
436 * are space imbalanced. See lod_qos_priofree_seq_show() for description of
437 * this parameter. See lod_qos_thresholdrr_seq_write() and lq_threshold_rr to
438 * determine what constitutes "space imbalanced" OSTs.
440 * \param[in] file proc file
441 * \param[in] buffer string which contains the free space priority (0-100)
442 * \param[in] count @buffer length
443 * \param[in] off unused for single entry
445 * \retval @count on success
446 * \retval negative error code if failed
448 static ssize_t qos_prio_free_store(struct kobject *kobj, struct attribute *attr,
449 const char *buffer, size_t count)
451 struct dt_device *dt = container_of(kobj, struct dt_device,
453 struct lod_device *lod = dt2lod_dev(dt);
457 rc = kstrtouint(buffer, 0, &val);
463 lod->lod_ost_descs.ltd_qos.lq_prio_free = (val << 8) / 100;
464 lod->lod_ost_descs.ltd_qos.lq_dirty = 1;
465 lod->lod_ost_descs.ltd_qos.lq_reset = 1;
469 LUSTRE_RW_ATTR(qos_prio_free);
472 * Show threshold for "same space on all OSTs" rule.
474 * \param[in] m seq file
475 * \param[in] v unused for single entry
477 * \retval 0 on success
478 * \retval negative error code if failed
480 static int lod_qos_thresholdrr_seq_show(struct seq_file *m, void *v)
482 struct obd_device *dev = m->private;
483 struct lod_device *lod;
485 LASSERT(dev != NULL);
486 lod = lu2lod_dev(dev->obd_lu_dev);
487 seq_printf(m, "%d%%\n",
488 (lod->lod_ost_descs.ltd_qos.lq_threshold_rr * 100 + 255) >>
494 * Set threshold for "same space on all OSTs" rule.
496 * This sets the maximum percentage difference of free space between the most
497 * full and most empty OST in the currently available OSTs. If this percentage
498 * is exceeded, use the QoS allocator to select OSTs based on their available
499 * space so that more full OSTs are chosen less often, otherwise use the
500 * round-robin allocator for efficiency and performance.
502 * \param[in] file proc file
503 * \param[in] buffer string containing percentage difference of free space
504 * \param[in] count @buffer length
505 * \param[in] off unused for single entry
507 * \retval @count on success
508 * \retval negative error code if failed
511 lod_qos_thresholdrr_seq_write(struct file *file, const char __user *buffer,
512 size_t count, loff_t *off)
514 struct seq_file *m = file->private_data;
515 struct obd_device *dev = m->private;
516 struct lod_device *lod;
520 LASSERT(dev != NULL);
521 lod = lu2lod_dev(dev->obd_lu_dev);
523 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '%');
527 if (val > 100 || val < 0)
530 lod->lod_ost_descs.ltd_qos.lq_threshold_rr = (val << 8) / 100;
531 lod->lod_ost_descs.ltd_qos.lq_dirty = 1;
535 LPROC_SEQ_FOPS(lod_qos_thresholdrr);
538 * Show expiration period used to refresh cached statfs data, which
539 * is used to implement QoS/RR striping allocation algorithm.
541 * \param[in] m seq file
542 * \param[in] v unused for single entry
544 * \retval 0 on success
545 * \retval negative error code if failed
547 static ssize_t qos_maxage_show(struct kobject *kobj, struct attribute *attr,
550 struct dt_device *dt = container_of(kobj, struct dt_device,
552 struct lod_device *lod = dt2lod_dev(dt);
554 return sprintf(buf, "%u Sec\n",
555 lod->lod_ost_descs.ltd_lov_desc.ld_qos_maxage);
559 * Set expiration period used to refresh cached statfs data.
561 * \param[in] file proc file
562 * \param[in] buffer string contains maximum age of statfs data in seconds
563 * \param[in] count @buffer length
564 * \param[in] off unused for single entry
566 * \retval @count on success
567 * \retval negative error code if failed
569 static ssize_t qos_maxage_store(struct kobject *kobj, struct attribute *attr,
570 const char *buffer, size_t count)
572 struct dt_device *dt = container_of(kobj, struct dt_device,
574 struct lod_device *lod = dt2lod_dev(dt);
575 struct lustre_cfg_bufs bufs;
576 struct lu_device *next;
577 struct lustre_cfg *lcfg;
579 struct lu_tgt_desc *tgt;
583 rc = kstrtouint(buffer, 0, &val);
589 lod->lod_ost_descs.ltd_lov_desc.ld_qos_maxage = val;
592 * propogate the value down to OSPs
594 lustre_cfg_bufs_reset(&bufs, NULL);
595 snprintf(str, 32, "%smaxage=%u", PARAM_OSP, val);
596 lustre_cfg_bufs_set_string(&bufs, 1, str);
597 OBD_ALLOC(lcfg, lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen));
600 lustre_cfg_init(lcfg, LCFG_PARAM, &bufs);
602 lod_getref(&lod->lod_ost_descs);
603 lod_foreach_ost(lod, tgt) {
604 next = &tgt->ltd_tgt->dd_lu_dev;
605 rc = next->ld_ops->ldo_process_config(NULL, next, lcfg);
607 CERROR("can't set maxage on #%d: %d\n",
610 lod_putref(lod, &lod->lod_ost_descs);
611 OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
615 LUSTRE_RW_ATTR(qos_maxage);
617 static void *lod_osts_seq_start(struct seq_file *p, loff_t *pos)
619 struct obd_device *dev = p->private;
620 struct lod_device *lod;
622 LASSERT(dev != NULL);
623 lod = lu2lod_dev(dev->obd_lu_dev);
625 lod_getref(&lod->lod_ost_descs); /* released in lod_osts_seq_stop */
626 if (*pos >= lod->lod_ost_bitmap->size)
629 *pos = find_next_bit(lod->lod_ost_bitmap->data,
630 lod->lod_ost_bitmap->size, *pos);
631 if (*pos < lod->lod_ost_bitmap->size)
632 return OST_TGT(lod,*pos);
637 static void lod_osts_seq_stop(struct seq_file *p, void *v)
639 struct obd_device *dev = p->private;
640 struct lod_device *lod;
642 LASSERT(dev != NULL);
643 lod = lu2lod_dev(dev->obd_lu_dev);
644 lod_putref(lod, &lod->lod_ost_descs);
647 static void *lod_osts_seq_next(struct seq_file *p, void *v, loff_t *pos)
649 struct obd_device *dev = p->private;
650 struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev);
652 if (*pos >= lod->lod_ost_bitmap->size - 1)
655 *pos = find_next_bit(lod->lod_ost_bitmap->data,
656 lod->lod_ost_bitmap->size, *pos + 1);
657 if (*pos < lod->lod_ost_bitmap->size)
658 return OST_TGT(lod,*pos);
664 * Show active/inactive status for OST found by lod_osts_seq_next().
666 * \param[in] m seq file
667 * \param[in] v unused for single entry
669 * \retval 0 on success
670 * \retval negative error code if failed
672 static int lod_osts_seq_show(struct seq_file *p, void *v)
674 struct obd_device *obd = p->private;
675 struct lu_tgt_desc *ost_desc = v;
676 struct lod_device *lod;
678 struct dt_device *next;
679 struct obd_statfs sfs;
681 LASSERT(obd->obd_lu_dev);
682 lod = lu2lod_dev(obd->obd_lu_dev);
684 idx = ost_desc->ltd_index;
685 next = OST_TGT(lod, idx)->ltd_tgt;
689 /* XXX: should be non-NULL env, but it's very expensive */
691 rc = dt_statfs(NULL, next, &sfs);
692 if (rc == -ENOTCONN) {
698 seq_printf(p, "%d: %s %sACTIVE\n", idx,
699 obd_uuid2str(&ost_desc->ltd_uuid),
704 static const struct seq_operations lod_osts_sops = {
705 .start = lod_osts_seq_start,
706 .stop = lod_osts_seq_stop,
707 .next = lod_osts_seq_next,
708 .show = lod_osts_seq_show,
711 static int lod_osts_seq_open(struct inode *inode, struct file *file)
713 struct seq_file *seq;
716 rc = seq_open(file, &lod_osts_sops);
720 seq = file->private_data;
721 seq->private = PDE_DATA(inode);
726 * Show whether special failout mode for testing is enabled or not.
728 * \param[in] m seq file
729 * \param[in] v unused for single entry
731 * \retval 0 on success
732 * \retval negative error code if failed
734 static ssize_t lmv_failout_show(struct kobject *kobj, struct attribute *attr,
737 struct dt_device *dt = container_of(kobj, struct dt_device,
739 struct lod_device *lod = dt2lod_dev(dt);
741 return sprintf(buf, "%d\n", lod->lod_lmv_failout ? 1 : 0);
745 * Enable/disable a special failout mode for testing.
747 * This determines whether the LMV will try to continue processing a striped
748 * directory even if it has a (partly) corrupted entry in the master directory,
749 * or if it will abort upon finding a corrupted slave directory entry.
751 * \param[in] file proc file
752 * \param[in] buffer string: 0 or non-zero to disable or enable LMV failout
753 * \param[in] count @buffer length
754 * \param[in] off unused for single entry
756 * \retval @count on success
757 * \retval negative error code if failed
759 static ssize_t lmv_failout_store(struct kobject *kobj, struct attribute *attr,
760 const char *buffer, size_t count)
762 struct dt_device *dt = container_of(kobj, struct dt_device,
764 struct lod_device *lod = dt2lod_dev(dt);
768 rc = kstrtobool(buffer, &val);
772 lod->lod_lmv_failout = val;
776 LUSTRE_RW_ATTR(lmv_failout);
778 static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
779 { .name = "stripesize",
780 .fops = &lod_stripesize_fops },
781 { .name = "qos_threshold_rr",
782 .fops = &lod_qos_thresholdrr_fops },
783 { .name = "dom_stripesize",
784 .fops = &lod_dom_stripesize_fops },
788 static const struct file_operations lod_proc_target_fops = {
789 .owner = THIS_MODULE,
790 .open = lod_osts_seq_open,
793 .release = lprocfs_seq_release,
796 static struct attribute *lod_attrs[] = {
797 &lustre_attr_stripeoffset.attr,
798 &lustre_attr_stripecount.attr,
799 &lustre_attr_stripetype.attr,
800 &lustre_attr_activeobd.attr,
801 &lustre_attr_desc_uuid.attr,
802 &lustre_attr_lmv_failout.attr,
803 &lustre_attr_numobd.attr,
804 &lustre_attr_qos_maxage.attr,
805 &lustre_attr_qos_prio_free.attr,
810 * Initialize procfs entries for LOD.
812 * \param[in] lod LOD device
814 * \retval 0 on success
815 * \retval negative error code if failed
817 int lod_procfs_init(struct lod_device *lod)
819 struct lprocfs_vars ldebugfs_obd_vars[] = { { NULL } };
820 struct obd_device *obd = lod2obd(lod);
821 struct obd_type *type;
825 lod->lod_dt_dev.dd_ktype.default_attrs = lod_attrs;
826 rc = dt_tunables_init(&lod->lod_dt_dev, obd->obd_type, obd->obd_name,
829 CERROR("%s: failed to setup DT tunables: %d\n",
834 obd->obd_vars = lprocfs_lod_obd_vars;
835 obd->obd_proc_entry = lprocfs_register(obd->obd_name,
836 obd->obd_type->typ_procroot,
838 if (IS_ERR(obd->obd_proc_entry)) {
839 rc = PTR_ERR(obd->obd_proc_entry);
840 CERROR("%s: error %d setting up lprocfs\n",
845 rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
846 0444, &lod_proc_target_fops, obd);
848 CWARN("%s: Error adding the target_obd file %d\n",
853 lod->lod_pool_proc_entry = lprocfs_register("pools",
856 if (IS_ERR(lod->lod_pool_proc_entry)) {
857 rc = PTR_ERR(lod->lod_pool_proc_entry);
858 lod->lod_pool_proc_entry = NULL;
859 CWARN("%s: Failed to create pool proc file: %d\n",
864 lov = kset_find_obj(lustre_kset, "lov");
866 CERROR("%s: lov subsystem not found\n", obd->obd_name);
867 GOTO(out, rc = -ENODEV);
870 rc = sysfs_create_link(lov, &lod->lod_dt_dev.dd_kobj,
873 CERROR("%s: failed to create LOV sysfs symlink\n",
877 lod->lod_debugfs = ldebugfs_add_symlink(obd->obd_name, "lov",
878 "../lod/%s", obd->obd_name);
879 if (!lod->lod_debugfs)
880 CERROR("%s: failed to create LOV debugfs symlink\n",
883 type = container_of(lov, struct obd_type, typ_kobj);
884 if (!type->typ_procroot)
887 /* for compatibility we link old procfs's LOV entries to lod ones */
888 lod->lod_symlink = lprocfs_add_symlink(obd->obd_name,
890 "../lod/%s", obd->obd_name);
891 if (lod->lod_symlink == NULL)
892 CERROR("cannot create LOV symlink for /proc/fs/lustre/lod/%s\n",
897 dt_tunables_fini(&lod->lod_dt_dev);
903 * Cleanup procfs entries registred for LOD.
905 * \param[in] lod LOD device
907 void lod_procfs_fini(struct lod_device *lod)
909 struct obd_device *obd = lod2obd(lod);
912 if (lod->lod_symlink != NULL) {
913 lprocfs_remove(&lod->lod_symlink);
914 lod->lod_symlink = NULL;
917 lov = kset_find_obj(lustre_kset, "lov");
919 sysfs_remove_link(lov, obd->obd_name);
923 if (!IS_ERR_OR_NULL(lod->lod_debugfs))
924 ldebugfs_remove(&lod->lod_debugfs);
926 if (obd->obd_proc_entry) {
927 lprocfs_remove(&obd->obd_proc_entry);
928 obd->obd_proc_entry = NULL;
931 dt_tunables_fini(&lod->lod_dt_dev);
934 #endif /* CONFIG_PROC_FS */