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, 2012, 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 <linux/vfs.h>
40 #include <obd_class.h>
41 #include <lprocfs_status.h>
45 static int mdc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
47 struct obd_device *dev = m->private;
51 max = obd_get_max_rpcs_in_flight(&dev->u.cli);
52 rc = seq_printf(m, "%u\n", max);
57 static ssize_t mdc_max_rpcs_in_flight_seq_write(struct file *file,
62 struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
66 rc = lprocfs_write_helper(buffer, count, &val);
68 rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
75 LPROC_SEQ_FOPS(mdc_max_rpcs_in_flight);
77 LPROC_SEQ_FOPS_WO_TYPE(mdc, ping);
79 LPROC_SEQ_FOPS_RO_TYPE(mdc, uuid);
80 LPROC_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
81 LPROC_SEQ_FOPS_RO_TYPE(mdc, blksize);
82 LPROC_SEQ_FOPS_RO_TYPE(mdc, kbytestotal);
83 LPROC_SEQ_FOPS_RO_TYPE(mdc, kbytesfree);
84 LPROC_SEQ_FOPS_RO_TYPE(mdc, kbytesavail);
85 LPROC_SEQ_FOPS_RO_TYPE(mdc, filestotal);
86 LPROC_SEQ_FOPS_RO_TYPE(mdc, filesfree);
87 LPROC_SEQ_FOPS_RO_TYPE(mdc, server_uuid);
88 LPROC_SEQ_FOPS_RO_TYPE(mdc, conn_uuid);
89 LPROC_SEQ_FOPS_RO_TYPE(mdc, timeouts);
90 LPROC_SEQ_FOPS_RO_TYPE(mdc, state);
92 static int mdc_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
94 return lprocfs_obd_max_pages_per_rpc_seq_show(m, m->private);
96 LPROC_SEQ_FOPS_RO(mdc_obd_max_pages_per_rpc);
98 LPROC_SEQ_FOPS_RW_TYPE(mdc, import);
99 LPROC_SEQ_FOPS_RW_TYPE(mdc, pinger_recov);
101 struct lprocfs_seq_vars lprocfs_mdc_obd_vars[] = {
103 .fops = &mdc_uuid_fops },
105 .fops = &mdc_ping_fops,
107 { .name = "connect_flags",
108 .fops = &mdc_connect_flags_fops },
109 { .name = "blocksize",
110 .fops = &mdc_blksize_fops },
111 { .name = "kbytestotal",
112 .fops = &mdc_kbytestotal_fops },
113 { .name = "kbytesfree",
114 .fops = &mdc_kbytesfree_fops },
115 { .name = "kbytesavail",
116 .fops = &mdc_kbytesavail_fops },
117 { .name = "filestotal",
118 .fops = &mdc_filestotal_fops },
119 { .name = "filesfree",
120 .fops = &mdc_filesfree_fops },
121 { .name = "mds_server_uuid",
122 .fops = &mdc_server_uuid_fops },
123 { .name = "mds_conn_uuid",
124 .fops = &mdc_conn_uuid_fops },
126 * FIXME: below proc entry is provided, but not in used, instead
127 * sbi->sb_md_brw_size is used, the per obd variable should be used
128 * when CMD is enabled, and dir pages are managed in MDC layer.
129 * Remember to enable proc write function.
131 { .name = "max_pages_per_rpc",
132 .fops = &mdc_obd_max_pages_per_rpc_fops },
133 { .name = "max_rpcs_in_flight",
134 .fops = &mdc_max_rpcs_in_flight_fops },
135 { .name = "timeouts",
136 .fops = &mdc_timeouts_fops },
138 .fops = &mdc_import_fops },
140 .fops = &mdc_state_fops },
141 { .name = "pinger_recov",
142 .fops = &mdc_pinger_recov_fops },