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, 2016, 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');
100 if (val > (1ULL << 30))
103 lod_fix_desc_stripe_size(&val);
105 lod->lod_dom_max_stripesize = val;
109 LPROC_SEQ_FOPS(lod_dom_stripesize);
112 * Show default stripe size.
114 * \param[in] m seq file
115 * \param[in] v unused for single entry
117 * \retval 0 on success
118 * \retval negative error code if failed
120 static int lod_stripesize_seq_show(struct seq_file *m, void *v)
122 struct obd_device *dev = m->private;
123 struct lod_device *lod;
125 LASSERT(dev != NULL);
126 lod = lu2lod_dev(dev->obd_lu_dev);
127 seq_printf(m, "%llu\n",
128 lod->lod_desc.ld_default_stripe_size);
133 * Set default stripe size.
135 * \param[in] file proc file
136 * \param[in] buffer string containing the maximum number of bytes stored in
137 * each object before moving to the next object in the
139 * \param[in] count @buffer length
140 * \param[in] off unused for single entry
142 * \retval @count on success
143 * \retval negative error code if failed
146 lod_stripesize_seq_write(struct file *file, const char __user *buffer,
147 size_t count, loff_t *off)
149 struct seq_file *m = file->private_data;
150 struct obd_device *dev = m->private;
151 struct lod_device *lod;
155 LASSERT(dev != NULL);
156 lod = lu2lod_dev(dev->obd_lu_dev);
157 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
163 lod_fix_desc_stripe_size(&val);
164 lod->lod_desc.ld_default_stripe_size = val;
168 LPROC_SEQ_FOPS(lod_stripesize);
171 * Show default stripe offset.
173 * \param[in] m seq file
174 * \param[in] v unused for single entry
176 * \retval 0 on success
177 * \retval negative error code if failed
179 static int lod_stripeoffset_seq_show(struct seq_file *m, void *v)
181 struct obd_device *dev = m->private;
182 struct lod_device *lod;
184 LASSERT(dev != NULL);
185 lod = lu2lod_dev(dev->obd_lu_dev);
186 seq_printf(m, "%llu\n",
187 lod->lod_desc.ld_default_stripe_offset);
192 * Set default stripe offset.
194 * Usually contains -1 allowing Lustre to balance objects among OST
195 * otherwise may cause severe OST imbalance.
197 * \param[in] file proc file
198 * \param[in] buffer string describing starting OST index for new files
199 * \param[in] count @buffer length
200 * \param[in] off unused for single entry
202 * \retval @count on success
203 * \retval negative error code if failed
206 lod_stripeoffset_seq_write(struct file *file, const char __user *buffer,
207 size_t count, loff_t *off)
209 struct seq_file *m = file->private_data;
210 struct obd_device *dev = m->private;
211 struct lod_device *lod;
215 LASSERT(dev != NULL);
216 lod = lu2lod_dev(dev->obd_lu_dev);
217 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
223 lod->lod_desc.ld_default_stripe_offset = val;
227 LPROC_SEQ_FOPS(lod_stripeoffset);
230 * Show default striping pattern (LOV_PATTERN_*).
232 * \param[in] m seq file
233 * \param[in] v unused for single entry
235 * \retval 0 on success
236 * \retval negative error code if failed
238 static int lod_stripetype_seq_show(struct seq_file *m, void *v)
240 struct obd_device *dev = m->private;
241 struct lod_device *lod;
243 LASSERT(dev != NULL);
244 lod = lu2lod_dev(dev->obd_lu_dev);
245 seq_printf(m, "%u\n", lod->lod_desc.ld_pattern);
250 * Set default striping pattern (a number, not a human-readable string).
252 * \param[in] file proc file
253 * \param[in] buffer string containing the default striping pattern for new
254 * files. This is an integer LOV_PATTERN_* value
255 * \param[in] count @buffer length
256 * \param[in] off unused for single entry
258 * \retval @count on success
259 * \retval negative error code if failed
262 lod_stripetype_seq_write(struct file *file, const char __user *buffer,
263 size_t count, loff_t *off)
265 struct seq_file *m = file->private_data;
266 struct obd_device *dev = m->private;
267 struct lod_device *lod;
272 LASSERT(dev != NULL);
273 lod = lu2lod_dev(dev->obd_lu_dev);
274 rc = lprocfs_str_to_s64(buffer, count, &val);
281 lod_fix_desc_pattern(&pattern);
282 lod->lod_desc.ld_pattern = pattern;
286 LPROC_SEQ_FOPS(lod_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 int lod_stripecount_seq_show(struct seq_file *m, void *v)
299 struct obd_device *dev = m->private;
300 struct lod_device *lod;
302 LASSERT(dev != NULL);
303 lod = lu2lod_dev(dev->obd_lu_dev);
304 seq_printf(m, "%d\n",
305 (__s16)(lod->lod_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
322 lod_stripecount_seq_write(struct file *file, const char __user *buffer,
323 size_t count, loff_t *off)
325 struct seq_file *m = file->private_data;
326 struct obd_device *dev = m->private;
327 struct lod_device *lod;
332 LASSERT(dev != NULL);
333 lod = lu2lod_dev(dev->obd_lu_dev);
334 rc = lprocfs_str_to_s64(buffer, count, &val);
341 lod_fix_desc_stripe_count(&stripe_count);
342 lod->lod_desc.ld_default_stripe_count = stripe_count;
346 LPROC_SEQ_FOPS(lod_stripecount);
349 * Show number of targets.
351 * \param[in] m seq file
352 * \param[in] v unused for single entry
354 * \retval 0 on success
355 * \retval negative error code if failed
357 static int lod_numobd_seq_show(struct seq_file *m, void *v)
359 struct obd_device *dev = m->private;
360 struct lod_device *lod;
362 LASSERT(dev != NULL);
363 lod = lu2lod_dev(dev->obd_lu_dev);
364 seq_printf(m, "%u\n", lod->lod_desc.ld_tgt_count);
367 LPROC_SEQ_FOPS_RO(lod_numobd);
370 * Show number of active targets.
372 * \param[in] m seq file
373 * \param[in] v unused for single entry
375 * \retval 0 on success
376 * \retval negative error code if failed
378 static int lod_activeobd_seq_show(struct seq_file *m, void *v)
380 struct obd_device *dev = m->private;
381 struct lod_device *lod;
383 LASSERT(dev != NULL);
384 lod = lu2lod_dev(dev->obd_lu_dev);
385 seq_printf(m, "%u\n", lod->lod_desc.ld_active_tgt_count);
388 LPROC_SEQ_FOPS_RO(lod_activeobd);
391 * Show UUID of LOD device.
393 * \param[in] m seq file
394 * \param[in] v unused for single entry
396 * \retval 0 on success
397 * \retval negative error code if failed
399 static int lod_desc_uuid_seq_show(struct seq_file *m, void *v)
401 struct obd_device *dev = m->private;
402 struct lod_device *lod;
404 LASSERT(dev != NULL);
405 lod = lu2lod_dev(dev->obd_lu_dev);
406 seq_printf(m, "%s\n", lod->lod_desc.ld_uuid.uuid);
409 LPROC_SEQ_FOPS_RO(lod_desc_uuid);
412 * Show QoS priority parameter.
414 * The printed value is a percentage value (0-100%) indicating the priority
415 * of free space compared to performance. 0% means select OSTs equally
416 * regardless of their free space, 100% means select OSTs only by their free
417 * space even if it results in very imbalanced load on the OSTs.
419 * \param[in] m seq file
420 * \param[in] v unused for single entry
422 * \retval 0 on success
423 * \retval negative error code if failed
425 static int lod_qos_priofree_seq_show(struct seq_file *m, void *v)
427 struct obd_device *dev = m->private;
428 struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev);
430 LASSERT(lod != NULL);
431 seq_printf(m, "%d%%\n",
432 (lod->lod_qos.lq_prio_free * 100 + 255) >> 8);
437 * Set QoS free space priority parameter.
439 * Set the relative priority of free OST space compared to OST load when OSTs
440 * are space imbalanced. See lod_qos_priofree_seq_show() for description of
441 * this parameter. See lod_qos_thresholdrr_seq_write() and lq_threshold_rr to
442 * determine what constitutes "space imbalanced" OSTs.
444 * \param[in] file proc file
445 * \param[in] buffer string which contains the free space priority (0-100)
446 * \param[in] count @buffer length
447 * \param[in] off unused for single entry
449 * \retval @count on success
450 * \retval negative error code if failed
453 lod_qos_priofree_seq_write(struct file *file, const char __user *buffer,
454 size_t count, loff_t *off)
456 struct seq_file *m = file->private_data;
457 struct obd_device *dev = m->private;
458 struct lod_device *lod;
462 LASSERT(dev != NULL);
463 lod = lu2lod_dev(dev->obd_lu_dev);
465 rc = lprocfs_str_to_s64(buffer, count, &val);
469 if (val < 0 || val > 100)
471 lod->lod_qos.lq_prio_free = (val << 8) / 100;
472 lod->lod_qos.lq_dirty = 1;
473 lod->lod_qos.lq_reset = 1;
477 LPROC_SEQ_FOPS(lod_qos_priofree);
480 * Show threshold for "same space on all OSTs" rule.
482 * \param[in] m seq file
483 * \param[in] v unused for single entry
485 * \retval 0 on success
486 * \retval negative error code if failed
488 static int lod_qos_thresholdrr_seq_show(struct seq_file *m, void *v)
490 struct obd_device *dev = m->private;
491 struct lod_device *lod;
493 LASSERT(dev != NULL);
494 lod = lu2lod_dev(dev->obd_lu_dev);
495 seq_printf(m, "%d%%\n",
496 (lod->lod_qos.lq_threshold_rr * 100 + 255) >> 8);
501 * Set threshold for "same space on all OSTs" rule.
503 * This sets the maximum percentage difference of free space between the most
504 * full and most empty OST in the currently available OSTs. If this percentage
505 * is exceeded, use the QoS allocator to select OSTs based on their available
506 * space so that more full OSTs are chosen less often, otherwise use the
507 * round-robin allocator for efficiency and performance.
509 * \param[in] file proc file
510 * \param[in] buffer string containing percentage difference of free space
511 * \param[in] count @buffer length
512 * \param[in] off unused for single entry
514 * \retval @count on success
515 * \retval negative error code if failed
518 lod_qos_thresholdrr_seq_write(struct file *file, const char __user *buffer,
519 size_t count, loff_t *off)
521 struct seq_file *m = file->private_data;
522 struct obd_device *dev = m->private;
523 struct lod_device *lod;
527 LASSERT(dev != NULL);
528 lod = lu2lod_dev(dev->obd_lu_dev);
530 rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '%');
534 if (val > 100 || val < 0)
537 lod->lod_qos.lq_threshold_rr = (val << 8) / 100;
538 lod->lod_qos.lq_dirty = 1;
542 LPROC_SEQ_FOPS(lod_qos_thresholdrr);
545 * Show expiration period used to refresh cached statfs data, which
546 * is used to implement QoS/RR striping allocation algorithm.
548 * \param[in] m seq file
549 * \param[in] v unused for single entry
551 * \retval 0 on success
552 * \retval negative error code if failed
554 static int lod_qos_maxage_seq_show(struct seq_file *m, void *v)
556 struct obd_device *dev = m->private;
557 struct lod_device *lod;
559 LASSERT(dev != NULL);
560 lod = lu2lod_dev(dev->obd_lu_dev);
561 seq_printf(m, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
566 * Set expiration period used to refresh cached statfs data.
568 * \param[in] file proc file
569 * \param[in] buffer string contains maximum age of statfs data in seconds
570 * \param[in] count @buffer length
571 * \param[in] off unused for single entry
573 * \retval @count on success
574 * \retval negative error code if failed
577 lod_qos_maxage_seq_write(struct file *file, const char __user *buffer,
578 size_t count, loff_t *off)
580 struct seq_file *m = file->private_data;
581 struct obd_device *dev = m->private;
582 struct lustre_cfg_bufs bufs;
583 struct lod_device *lod;
584 struct lu_device *next;
585 struct lustre_cfg *lcfg;
591 LASSERT(dev != NULL);
592 lod = lu2lod_dev(dev->obd_lu_dev);
594 rc = lprocfs_str_to_s64(buffer, count, &val);
600 lod->lod_desc.ld_qos_maxage = val;
603 * propogate the value down to OSPs
605 lustre_cfg_bufs_reset(&bufs, NULL);
606 snprintf(str, 32, "%smaxage=%u", PARAM_OSP, (__u32)val);
607 lustre_cfg_bufs_set_string(&bufs, 1, str);
608 OBD_ALLOC(lcfg, lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen));
611 lustre_cfg_init(lcfg, LCFG_PARAM, &bufs);
613 lod_getref(&lod->lod_ost_descs);
614 lod_foreach_ost(lod, i) {
615 next = &OST_TGT(lod,i)->ltd_ost->dd_lu_dev;
616 rc = next->ld_ops->ldo_process_config(NULL, next, lcfg);
618 CERROR("can't set maxage on #%d: %d\n", i, rc);
620 lod_putref(lod, &lod->lod_ost_descs);
621 OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
625 LPROC_SEQ_FOPS(lod_qos_maxage);
627 static void *lod_osts_seq_start(struct seq_file *p, loff_t *pos)
629 struct obd_device *dev = p->private;
630 struct lod_device *lod;
632 LASSERT(dev != NULL);
633 lod = lu2lod_dev(dev->obd_lu_dev);
635 lod_getref(&lod->lod_ost_descs); /* released in lod_osts_seq_stop */
636 if (*pos >= lod->lod_ost_bitmap->size)
639 *pos = find_next_bit(lod->lod_ost_bitmap->data,
640 lod->lod_ost_bitmap->size, *pos);
641 if (*pos < lod->lod_ost_bitmap->size)
642 return OST_TGT(lod,*pos);
647 static void lod_osts_seq_stop(struct seq_file *p, void *v)
649 struct obd_device *dev = p->private;
650 struct lod_device *lod;
652 LASSERT(dev != NULL);
653 lod = lu2lod_dev(dev->obd_lu_dev);
654 lod_putref(lod, &lod->lod_ost_descs);
657 static void *lod_osts_seq_next(struct seq_file *p, void *v, loff_t *pos)
659 struct obd_device *dev = p->private;
660 struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev);
662 if (*pos >= lod->lod_ost_bitmap->size - 1)
665 *pos = find_next_bit(lod->lod_ost_bitmap->data,
666 lod->lod_ost_bitmap->size, *pos + 1);
667 if (*pos < lod->lod_ost_bitmap->size)
668 return OST_TGT(lod,*pos);
674 * Show active/inactive status for OST found by lod_osts_seq_next().
676 * \param[in] m seq file
677 * \param[in] v unused for single entry
679 * \retval 0 on success
680 * \retval negative error code if failed
682 static int lod_osts_seq_show(struct seq_file *p, void *v)
684 struct obd_device *obd = p->private;
685 struct lod_ost_desc *ost_desc = v;
686 struct lod_device *lod;
688 struct dt_device *next;
689 struct obd_statfs sfs;
691 LASSERT(obd->obd_lu_dev);
692 lod = lu2lod_dev(obd->obd_lu_dev);
694 idx = ost_desc->ltd_index;
695 next = OST_TGT(lod,idx)->ltd_ost;
699 /* XXX: should be non-NULL env, but it's very expensive */
701 rc = dt_statfs(NULL, next, &sfs);
702 if (rc == -ENOTCONN) {
708 seq_printf(p, "%d: %s %sACTIVE\n", idx,
709 obd_uuid2str(&ost_desc->ltd_uuid),
714 static const struct seq_operations lod_osts_sops = {
715 .start = lod_osts_seq_start,
716 .stop = lod_osts_seq_stop,
717 .next = lod_osts_seq_next,
718 .show = lod_osts_seq_show,
721 static int lod_osts_seq_open(struct inode *inode, struct file *file)
723 struct seq_file *seq;
726 rc = seq_open(file, &lod_osts_sops);
730 seq = file->private_data;
731 seq->private = PDE_DATA(inode);
735 LPROC_SEQ_FOPS_RO_TYPE(lod, dt_blksize);
736 LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytestotal);
737 LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytesfree);
738 LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytesavail);
739 LPROC_SEQ_FOPS_RO_TYPE(lod, dt_filestotal);
740 LPROC_SEQ_FOPS_RO_TYPE(lod, dt_filesfree);
743 * Show whether special failout mode for testing is enabled or not.
745 * \param[in] m seq file
746 * \param[in] v unused for single entry
748 * \retval 0 on success
749 * \retval negative error code if failed
751 static int lod_lmv_failout_seq_show(struct seq_file *m, void *v)
753 struct obd_device *dev = m->private;
754 struct lod_device *lod;
756 LASSERT(dev != NULL);
757 lod = lu2lod_dev(dev->obd_lu_dev);
759 seq_printf(m, "%d\n", lod->lod_lmv_failout ? 1 : 0);
764 * Enable/disable a special failout mode for testing.
766 * This determines whether the LMV will try to continue processing a striped
767 * directory even if it has a (partly) corrupted entry in the master directory,
768 * or if it will abort upon finding a corrupted slave directory entry.
770 * \param[in] file proc file
771 * \param[in] buffer string: 0 or non-zero to disable or enable LMV failout
772 * \param[in] count @buffer length
773 * \param[in] off unused for single entry
775 * \retval @count on success
776 * \retval negative error code if failed
779 lod_lmv_failout_seq_write(struct file *file, const char __user *buffer,
780 size_t count, loff_t *off)
782 struct seq_file *m = file->private_data;
783 struct obd_device *dev = m->private;
784 struct lod_device *lod;
788 LASSERT(dev != NULL);
789 lod = lu2lod_dev(dev->obd_lu_dev);
791 rc = lprocfs_str_to_s64(buffer, count, &val);
795 lod->lod_lmv_failout = !!val;
799 LPROC_SEQ_FOPS(lod_lmv_failout);
801 static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
802 { .name = "stripesize",
803 .fops = &lod_stripesize_fops },
804 { .name = "stripeoffset",
805 .fops = &lod_stripeoffset_fops },
806 { .name = "stripecount",
807 .fops = &lod_stripecount_fops },
808 { .name = "stripetype",
809 .fops = &lod_stripetype_fops },
811 .fops = &lod_numobd_fops },
812 { .name = "activeobd",
813 .fops = &lod_activeobd_fops },
814 { .name = "desc_uuid",
815 .fops = &lod_desc_uuid_fops },
816 { .name = "qos_prio_free",
817 .fops = &lod_qos_priofree_fops },
818 { .name = "qos_threshold_rr",
819 .fops = &lod_qos_thresholdrr_fops },
820 { .name = "qos_maxage",
821 .fops = &lod_qos_maxage_fops },
822 { .name = "lmv_failout",
823 .fops = &lod_lmv_failout_fops },
825 .name = "dom_stripesize",
826 .fops = &lod_dom_stripesize_fops
831 static struct lprocfs_vars lprocfs_lod_osd_vars[] = {
832 { .name = "blocksize", .fops = &lod_dt_blksize_fops },
833 { .name = "kbytestotal", .fops = &lod_dt_kbytestotal_fops },
834 { .name = "kbytesfree", .fops = &lod_dt_kbytesfree_fops },
835 { .name = "kbytesavail", .fops = &lod_dt_kbytesavail_fops },
836 { .name = "filestotal", .fops = &lod_dt_filestotal_fops },
837 { .name = "filesfree", .fops = &lod_dt_filesfree_fops },
841 static const struct file_operations lod_proc_target_fops = {
842 .owner = THIS_MODULE,
843 .open = lod_osts_seq_open,
846 .release = lprocfs_seq_release,
850 * Initialize procfs entries for LOD.
852 * \param[in] lod LOD device
854 * \retval 0 on success
855 * \retval negative error code if failed
857 int lod_procfs_init(struct lod_device *lod)
859 struct obd_device *obd = lod2obd(lod);
860 struct proc_dir_entry *lov_proc_dir = NULL;
861 struct obd_type *type;
864 obd->obd_vars = lprocfs_lod_obd_vars;
865 rc = lprocfs_obd_setup(obd, true);
867 CERROR("%s: cannot setup procfs entry: %d\n",
872 rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
875 CERROR("%s: cannot setup procfs entry: %d\n",
880 rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
881 0444, &lod_proc_target_fops, obd);
883 CWARN("%s: Error adding the target_obd file %d\n",
888 lod->lod_pool_proc_entry = lprocfs_register("pools",
891 if (IS_ERR(lod->lod_pool_proc_entry)) {
892 rc = PTR_ERR(lod->lod_pool_proc_entry);
893 lod->lod_pool_proc_entry = NULL;
894 CWARN("%s: Failed to create pool proc file: %d\n",
899 /* If the real LOV is present which is the case for setups
900 * with both server and clients on the same node then use
901 * the LOV's proc root */
902 type = class_search_type(LUSTRE_LOV_NAME);
903 if (type != NULL && type->typ_procroot != NULL)
904 lov_proc_dir = type->typ_procroot;
906 lov_proc_dir = obd->obd_type->typ_procsym;
908 if (lov_proc_dir == NULL)
911 /* for compatibility we link old procfs's LOV entries to lod ones */
912 lod->lod_symlink = lprocfs_add_symlink(obd->obd_name, lov_proc_dir,
913 "../lod/%s", obd->obd_name);
914 if (lod->lod_symlink == NULL)
915 CERROR("cannot create LOV symlink for /proc/fs/lustre/lod/%s\n",
920 lprocfs_obd_cleanup(obd);
926 * Cleanup procfs entries registred for LOD.
928 * \param[in] lod LOD device
930 void lod_procfs_fini(struct lod_device *lod)
932 struct obd_device *obd = lod2obd(lod);
934 if (lod->lod_symlink != NULL) {
935 lprocfs_remove(&lod->lod_symlink);
936 lod->lod_symlink = NULL;
939 if (lod->lod_pool_proc_entry != NULL) {
940 lprocfs_remove(&lod->lod_pool_proc_entry);
941 lod->lod_pool_proc_entry = NULL;
944 lprocfs_obd_cleanup(obd);
947 #endif /* CONFIG_PROC_FS */