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) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2012, 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/osp/lproc_osp.c
34 * Lustre OST Proxy Device (OSP), procfs functions
36 * Author: Alex Zhuravlev <alexey.zhuravlev@intel.com>
39 #define DEBUG_SUBSYSTEM S_CLASS
41 #include "osp_internal.h"
45 * Show OSP active status
47 * \param[in] m seq_file handle
48 * \param[in] data unused for single entry
49 * \retval 0 on success
50 * \retval negative number on error
52 static int osp_active_seq_show(struct seq_file *m, void *data)
54 struct obd_device *dev = m->private;
56 LPROCFS_CLIMP_CHECK(dev);
57 seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
58 LPROCFS_CLIMP_EXIT(dev);
63 * Activate/Deactivate OSP
65 * \param[in] file proc file
66 * \param[in] buffer string, which is "1" or "0" to activate/deactivate OSP
67 * \param[in] count \a buffer length
68 * \param[in] off unused for single entry
69 * \retval \a count on success
70 * \retval negative number on error
73 osp_active_seq_write(struct file *file, const char __user *buffer,
74 size_t count, loff_t *off)
76 struct seq_file *m = file->private_data;
77 struct obd_device *dev = m->private;
80 rc = lprocfs_write_helper(buffer, count, &val);
83 if (val < 0 || val > 1)
86 LPROCFS_CLIMP_CHECK(dev);
88 if (dev->u.cli.cl_import->imp_deactive == val)
89 rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
91 CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n",
94 LPROCFS_CLIMP_EXIT(dev);
97 LPROC_SEQ_FOPS(osp_active);
100 * Show number of RPCs in flight
102 * \param[in] m seq_file handle
103 * \param[in] data unused for single entry
104 * \retval 0 on success
105 * \retval negative number on error
107 static int osp_syn_in_flight_seq_show(struct seq_file *m, void *data)
109 struct obd_device *dev = m->private;
110 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
115 seq_printf(m, "%u\n", osp->opd_syn_rpc_in_flight);
118 LPROC_SEQ_FOPS_RO(osp_syn_in_flight);
121 * Show number of RPCs in processing (including uncommitted by OST)
123 * \param[in] m seq_file handle
124 * \param[in] data unused for single entry
125 * \retval 0 on success
126 * \retval negative number on error
128 static int osp_syn_in_prog_seq_show(struct seq_file *m, void *data)
130 struct obd_device *dev = m->private;
131 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
136 seq_printf(m, "%u\n", osp->opd_syn_rpc_in_progress);
139 LPROC_SEQ_FOPS_RO(osp_syn_in_prog);
142 * Show number of changes to sync
144 * \param[in] m seq_file handle
145 * \param[in] data unused for single entry
146 * \retval 0 on success
147 * \retval negative number on error
149 static int osp_syn_changes_seq_show(struct seq_file *m, void *data)
151 struct obd_device *dev = m->private;
152 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
157 seq_printf(m, "%lu\n", osp->opd_syn_changes);
164 * \param[in] file proc file
165 * \param[in] buffer unused because any input will do
166 * \param[in] count \a buffer length
167 * \param[in] off unused for single entry
168 * \retval \a count on success
169 * \retval negative number on error
171 static ssize_t osp_syn_changes_seq_write(struct file *file,
172 const char __user *buffer,
173 size_t count, loff_t *off)
175 struct seq_file *m = file->private_data;
176 struct obd_device *dev = m->private;
177 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
181 rc = lu_env_init(&env, LCT_LOCAL);
185 rc = dt_sync(&env, &osp->opd_dt_dev);
188 return rc == 0 ? count : rc;
190 LPROC_SEQ_FOPS(osp_syn_changes);
193 * Show maximum number of RPCs in flight allowed
195 * \param[in] m seq_file handle
196 * \param[in] data unused for single entry
197 * \retval 0 on success
198 * \retval negative number on error
200 static int osp_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
202 struct obd_device *dev = m->private;
203 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
208 seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
213 * Change maximum number of RPCs in flight allowed
215 * \param[in] file proc file
216 * \param[in] buffer string which represents maximum number
217 * \param[in] count \a buffer length
218 * \param[in] off unused for single entry
219 * \retval \a count on success
220 * \retval negative number on error
223 osp_max_rpcs_in_flight_seq_write(struct file *file, const char __user *buffer,
224 size_t count, loff_t *off)
226 struct seq_file *m = file->private_data;
227 struct obd_device *dev = m->private;
228 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
234 rc = lprocfs_write_helper(buffer, count, &val);
241 osp->opd_syn_max_rpc_in_flight = val;
244 LPROC_SEQ_FOPS(osp_max_rpcs_in_flight);
247 * Show maximum number of RPCs in processing allowed
249 * \param[in] m seq_file handle
250 * \param[in] data unused
251 * \retval 0 on success
252 * \retval negative number on error
254 static int osp_max_rpcs_in_prog_seq_show(struct seq_file *m, void *data)
256 struct obd_device *dev = m->private;
257 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
262 seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
267 * Change maximum number of RPCs in processing allowed
269 * \param[in] file proc file
270 * \param[in] buffer string which represents maximum number
271 * \param[in] count \a buffer length
272 * \param[in] off unused for single entry
273 * \retval \a count on success
274 * \retval negative number on error
277 osp_max_rpcs_in_prog_seq_write(struct file *file, const char __user *buffer,
278 size_t count, loff_t *off)
280 struct seq_file *m = file->private_data;
281 struct obd_device *dev = m->private;
282 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
288 rc = lprocfs_write_helper(buffer, count, &val);
295 osp->opd_syn_max_rpc_in_progress = val;
299 LPROC_SEQ_FOPS(osp_max_rpcs_in_prog);
302 * Show number of objects to precreate next time
304 * \param[in] m seq_file handle
305 * \param[in] data unused for single entry
306 * \retval 0 on success
307 * \retval negative number on error
309 static int osp_create_count_seq_show(struct seq_file *m, void *data)
311 struct obd_device *obd = m->private;
312 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
314 if (osp == NULL || osp->opd_pre == NULL)
317 seq_printf(m, "%d\n", osp->opd_pre_create_count);
322 * Change number of objects to precreate next time
324 * \param[in] file proc file
325 * \param[in] buffer string which represents number of objects to precreate
326 * \param[in] count \a buffer length
327 * \param[in] off unused for single entry
328 * \retval \a count on success
329 * \retval negative number on error
332 osp_create_count_seq_write(struct file *file, const char __user *buffer,
333 size_t count, loff_t *off)
335 struct seq_file *m = file->private_data;
336 struct obd_device *obd = m->private;
337 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
340 if (osp == NULL || osp->opd_pre == NULL)
343 rc = lprocfs_write_helper(buffer, count, &val);
347 /* The MDT ALWAYS needs to limit the precreate count to
348 * OST_MAX_PRECREATE, and the constant cannot be changed
349 * because it is a value shared between the OSP and OST
350 * that is the maximum possible number of objects that will
351 * ever be handled by MDT->OST recovery processing.
353 * If the OST ever gets a request to delete more orphans,
354 * this implies that something has gone badly on the MDT
355 * and the OST will refuse to delete so much data from the
356 * filesystem as a safety measure. */
357 if (val < OST_MIN_PRECREATE || val > OST_MAX_PRECREATE)
359 if (val > osp->opd_pre_max_create_count)
362 for (i = 1; (i << 1) <= val; i <<= 1)
364 osp->opd_pre_create_count = i;
368 LPROC_SEQ_FOPS(osp_create_count);
371 * Show maximum number of objects to precreate
373 * \param[in] m seq_file handle
374 * \param[in] data unused for single entry
375 * \retval 0 on success
376 * \retval negative number on error
378 static int osp_max_create_count_seq_show(struct seq_file *m, void *data)
380 struct obd_device *obd = m->private;
381 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
383 if (osp == NULL || osp->opd_pre == NULL)
386 seq_printf(m, "%d\n", osp->opd_pre_max_create_count);
391 * Change maximum number of objects to precreate
393 * \param[in] file proc file
394 * \param[in] buffer string which represents maximum number
395 * \param[in] count \a buffer length
396 * \param[in] off unused for single entry
397 * \retval \a count on success
398 * \retval negative number on error
401 osp_max_create_count_seq_write(struct file *file, const char __user *buffer,
402 size_t count, loff_t *off)
404 struct seq_file *m = file->private_data;
405 struct obd_device *obd = m->private;
406 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
409 if (osp == NULL || osp->opd_pre == NULL)
412 rc = lprocfs_write_helper(buffer, count, &val);
418 if (val > OST_MAX_PRECREATE)
421 if (osp->opd_pre_create_count > val)
422 osp->opd_pre_create_count = val;
424 osp->opd_pre_max_create_count = val;
428 LPROC_SEQ_FOPS(osp_max_create_count);
431 * Show last id to assign in creation
433 * \param[in] m seq_file handle
434 * \param[in] data unused for single entry
435 * \retval 0 on success
436 * \retval negative number on error
438 static int osp_prealloc_next_id_seq_show(struct seq_file *m, void *data)
440 struct obd_device *obd = m->private;
441 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
443 if (osp == NULL || osp->opd_pre == NULL)
446 seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_used_fid) + 1);
449 LPROC_SEQ_FOPS_RO(osp_prealloc_next_id);
452 * Show last created id OST reported
454 * \param[in] m seq_file handle
455 * \param[in] data unused for single entry
456 * \retval 0 on success
457 * \retval negative number on error
459 static int osp_prealloc_last_id_seq_show(struct seq_file *m, void *data)
461 struct obd_device *obd = m->private;
462 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
464 if (osp == NULL || osp->opd_pre == NULL)
467 seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_last_created_fid));
470 LPROC_SEQ_FOPS_RO(osp_prealloc_last_id);
473 * Show next FID sequence to precreate
475 * \param[in] m seq_file handle
476 * \param[in] data unused for single entry
477 * \retval 0 on success
478 * \retval negative number on error
480 static int osp_prealloc_next_seq_seq_show(struct seq_file *m, void *data)
482 struct obd_device *obd = m->private;
483 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
485 if (osp == NULL || osp->opd_pre == NULL)
488 seq_printf(m, LPX64"\n", fid_seq(&osp->opd_pre_used_fid));
491 LPROC_SEQ_FOPS_RO(osp_prealloc_next_seq);
494 * Show last created FID sequence OST reported
496 * \param[in] m seq_file handle
497 * \param[in] data unused for single entry
498 * \retval 0 on success
499 * \retval negative number on error
501 static int osp_prealloc_last_seq_seq_show(struct seq_file *m, void *data)
503 struct obd_device *obd = m->private;
504 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
506 if (osp == NULL || osp->opd_pre == NULL)
509 seq_printf(m, LPX64"\n",
510 fid_seq(&osp->opd_pre_last_created_fid));
513 LPROC_SEQ_FOPS_RO(osp_prealloc_last_seq);
516 * Show the number of ids reserved by declare
518 * \param[in] m seq_file handle
519 * \param[in] data unused for single entry
520 * \retval 0 on success
521 * \retval negative number on error
523 static int osp_prealloc_reserved_seq_show(struct seq_file *m, void *data)
525 struct obd_device *obd = m->private;
526 struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
528 if (osp == NULL || osp->opd_pre == NULL)
531 seq_printf(m, LPU64"\n", osp->opd_pre_reserved);
534 LPROC_SEQ_FOPS_RO(osp_prealloc_reserved);
537 * Show interval (in seconds) to update statfs data
539 * \param[in] m seq_file handle
540 * \param[in] data unused for single entry
541 * \retval 0 on success
542 * \retval negative number on error
544 static int osp_maxage_seq_show(struct seq_file *m, void *data)
546 struct obd_device *dev = m->private;
547 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
552 seq_printf(m, "%u\n", osp->opd_statfs_maxage);
557 * Change interval to update statfs data
559 * \param[in] file proc file
560 * \param[in] buffer string which represents statfs interval (in seconds)
561 * \param[in] count \a buffer length
562 * \param[in] off unused for single entry
563 * \retval \a count on success
564 * \retval negative number on error
567 osp_maxage_seq_write(struct file *file, const char __user *buffer,
568 size_t count, loff_t *off)
570 struct seq_file *m = file->private_data;
571 struct obd_device *dev = m->private;
572 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
578 rc = lprocfs_write_helper(buffer, count, &val);
585 osp->opd_statfs_maxage = val;
589 LPROC_SEQ_FOPS(osp_maxage);
592 * Show current precreation status: output 0 means success, otherwise negative
595 * \param[in] m seq_file handle
596 * \param[in] data unused for single entry
597 * \retval 0 on success
598 * \retval negative number on error
600 static int osp_pre_status_seq_show(struct seq_file *m, void *data)
602 struct obd_device *dev = m->private;
603 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
605 if (osp == NULL || osp->opd_pre == NULL)
608 seq_printf(m, "%d\n", osp->opd_pre_status);
611 LPROC_SEQ_FOPS_RO(osp_pre_status);
614 * Show the number of RPCs in processing (including uncommitted by OST) plus
615 * changes to sync, i.e. this is the total number of changes OST needs to apply
618 * This counter is used to determine if OST has space returned. A zero value
619 * indicates that OST storage space consumed by destroyed objects has been freed
620 * on disk, the associated llog records have been cleared, and no synchronous
621 * RPC are being processed.
623 * \param[in] m seq_file handle
624 * \param[in] data unused for single entry
625 * \retval 0 on success
626 * \retval negative number on error
628 static int osp_destroys_in_flight_seq_show(struct seq_file *m, void *data)
630 struct obd_device *dev = m->private;
631 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
636 seq_printf(m, "%lu\n",
637 osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
640 LPROC_SEQ_FOPS_RO(osp_destroys_in_flight);
643 * Show changes synced from previous mount
645 * \param[in] m seq_file handle
646 * \param[in] data unused for single entry
647 * \retval 0 on success
648 * \retval negative number on error
650 static int osp_old_sync_processed_seq_show(struct seq_file *m, void *data)
652 struct obd_device *dev = m->private;
653 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
658 seq_printf(m, "%d\n", osp->opd_syn_prev_done);
661 LPROC_SEQ_FOPS_RO(osp_old_sync_processed);
664 * Show maximum number of RPCs in flight
666 * \param[in] m seq_file handle
667 * \param[in] data unused for single entry
668 * \retval 0 on success
669 * \retval negative number on error
672 osp_lfsck_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
674 struct obd_device *dev = m->private;
677 max = obd_get_max_rpcs_in_flight(&dev->u.cli);
678 seq_printf(m, "%u\n", max);
683 * Change maximum number of RPCs in flight
685 * \param[in] file proc file
686 * \param[in] buffer string which represents maximum number of RPCs in flight
687 * \param[in] count \a buffer length
688 * \param[in] off unused for single entry
689 * \retval \a count on success
690 * \retval negative number on error
693 osp_lfsck_max_rpcs_in_flight_seq_write(struct file *file,
694 const char __user *buffer,
695 size_t count, loff_t *off)
697 struct seq_file *m = file->private_data;
698 struct obd_device *dev = m->private;
702 rc = lprocfs_write_helper(buffer, count, &val);
704 rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
711 LPROC_SEQ_FOPS(osp_lfsck_max_rpcs_in_flight);
713 LPROC_SEQ_FOPS_WO_TYPE(osp, ping);
714 LPROC_SEQ_FOPS_RO_TYPE(osp, uuid);
715 LPROC_SEQ_FOPS_RO_TYPE(osp, connect_flags);
716 LPROC_SEQ_FOPS_RO_TYPE(osp, server_uuid);
717 LPROC_SEQ_FOPS_RO_TYPE(osp, conn_uuid);
720 * Show maximum pages per bulk RPC
722 * \param[in] m seq_file handle
723 * \param[in] data unused for single entry
724 * \retval 0 on success
725 * \retval negative number on error
727 static int osp_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
729 return lprocfs_obd_max_pages_per_rpc_seq_show(m, m->private);
731 LPROC_SEQ_FOPS_RO(osp_max_pages_per_rpc);
732 LPROC_SEQ_FOPS_RO_TYPE(osp, timeouts);
734 LPROC_SEQ_FOPS_RW_TYPE(osp, import);
735 LPROC_SEQ_FOPS_RO_TYPE(osp, state);
737 static struct lprocfs_vars lprocfs_osp_obd_vars[] = {
739 .fops = &osp_uuid_fops },
741 .fops = &osp_ping_fops,
743 { .name = "connect_flags",
744 .fops = &osp_connect_flags_fops },
745 { .name = "ost_server_uuid",
746 .fops = &osp_server_uuid_fops },
747 { .name = "ost_conn_uuid",
748 .fops = &osp_conn_uuid_fops },
750 .fops = &osp_active_fops },
751 { .name = "max_rpcs_in_flight",
752 .fops = &osp_max_rpcs_in_flight_fops },
753 { .name = "max_rpcs_in_progress",
754 .fops = &osp_max_rpcs_in_prog_fops },
755 { .name = "create_count",
756 .fops = &osp_create_count_fops },
757 { .name = "max_create_count",
758 .fops = &osp_max_create_count_fops },
759 { .name = "prealloc_next_id",
760 .fops = &osp_prealloc_next_id_fops },
761 { .name = "prealloc_next_seq",
762 .fops = &osp_prealloc_next_seq_fops },
763 { .name = "prealloc_last_id",
764 .fops = &osp_prealloc_last_id_fops },
765 { .name = "prealloc_last_seq",
766 .fops = &osp_prealloc_last_seq_fops },
767 { .name = "prealloc_reserved",
768 .fops = &osp_prealloc_reserved_fops },
769 { .name = "timeouts",
770 .fops = &osp_timeouts_fops },
772 .fops = &osp_import_fops },
774 .fops = &osp_state_fops },
776 .fops = &osp_maxage_fops },
777 { .name = "prealloc_status",
778 .fops = &osp_pre_status_fops },
779 { .name = "sync_changes",
780 .fops = &osp_syn_changes_fops },
781 { .name = "sync_in_flight",
782 .fops = &osp_syn_in_flight_fops },
783 { .name = "sync_in_progress",
784 .fops = &osp_syn_in_prog_fops },
785 { .name = "old_sync_processed",
786 .fops = &osp_old_sync_processed_fops },
788 /* for compatibility reasons */
789 { .name = "destroys_in_flight",
790 .fops = &osp_destroys_in_flight_fops },
791 { .name = "lfsck_max_rpcs_in_flight",
792 .fops = &osp_lfsck_max_rpcs_in_flight_fops },
796 static struct lprocfs_vars lprocfs_osp_md_vars[] = {
798 .fops = &osp_uuid_fops },
800 .fops = &osp_ping_fops,
802 { .name = "connect_flags",
803 .fops = &osp_connect_flags_fops },
804 { .name = "mdt_server_uuid",
805 .fops = &osp_server_uuid_fops },
806 { .name = "mdt_conn_uuid",
807 .fops = &osp_conn_uuid_fops },
809 .fops = &osp_active_fops },
810 { .name = "max_rpcs_in_flight",
811 .fops = &osp_max_rpcs_in_flight_fops },
812 { .name = "max_rpcs_in_progress",
813 .fops = &osp_max_rpcs_in_prog_fops },
814 { .name = "timeouts",
815 .fops = &osp_timeouts_fops },
817 .fops = &osp_import_fops },
819 .fops = &osp_state_fops },
821 .fops = &osp_maxage_fops },
822 { .name = "prealloc_status",
823 .fops = &osp_pre_status_fops },
825 /* for compatibility reasons */
826 { .name = "destroys_in_flight",
827 .fops = &osp_destroys_in_flight_fops },
828 { .name = "lfsck_max_rpcs_in_flight",
829 .fops = &osp_lfsck_max_rpcs_in_flight_fops },
833 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_blksize);
834 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_kbytestotal);
835 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_kbytesfree);
836 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_kbytesavail);
837 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filestotal);
838 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filesfree);
840 static struct lprocfs_vars lprocfs_osp_osd_vars[] = {
841 { .name = "blocksize",
842 .fops = &osp_dt_blksize_fops },
843 { .name = "kbytestotal",
844 .fops = &osp_dt_kbytestotal_fops },
845 { .name = "kbytesfree",
846 .fops = &osp_dt_kbytesfree_fops },
847 { .name = "kbytesavail",
848 .fops = &osp_dt_kbytesavail_fops },
849 { .name = "filestotal",
850 .fops = &osp_dt_filestotal_fops },
851 { .name = "filesfree",
852 .fops = &osp_dt_filesfree_fops },
857 * Initialize OSP lprocfs
859 * param[in] osp OSP device
861 void osp_lprocfs_init(struct osp_device *osp)
863 struct obd_device *obd = osp->opd_obd;
864 struct proc_dir_entry *osc_proc_dir = NULL;
865 struct obd_type *type;
868 if (osp->opd_connect_mdt)
869 obd->obd_vars = lprocfs_osp_md_vars;
871 obd->obd_vars = lprocfs_osp_obd_vars;
872 if (lprocfs_obd_setup(obd) != 0)
875 rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_osp_osd_vars,
878 CERROR("%s: can't register in lprocfs, rc %d\n",
883 sptlrpc_lprocfs_cliobd_attach(obd);
884 ptlrpc_lprocfs_register_obd(obd);
886 if (osp->opd_connect_mdt || !strstr(obd->obd_name, "osc"))
889 /* If the real OSC is present which is the case for setups
890 * with both server and clients on the same node then use
891 * the OSC's proc root */
892 type = class_search_type(LUSTRE_OSC_NAME);
893 if (type != NULL && type->typ_procroot != NULL)
894 osc_proc_dir = type->typ_procroot;
896 osc_proc_dir = obd->obd_type->typ_procsym;
898 if (osc_proc_dir == NULL)
901 /* for compatibility we link old procfs's OSC entries to osp ones */
902 osp->opd_symlink = lprocfs_add_symlink(obd->obd_name, osc_proc_dir,
903 "../osp/%s", obd->obd_name);
904 if (osp->opd_symlink == NULL)
905 CERROR("cannot create OSC symlink for /proc/fs/lustre/osp/%s\n",
909 #endif /* CONFIG_PROC_FS */