1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
6 * This file is part of the Lustre file system, http://www.lustre.org
7 * Lustre is a trademark of Cluster File Systems, Inc.
9 * You may have signed or agreed to another license before downloading
10 * this software. If so, you are bound by the terms and conditions
11 * of that agreement, and the following does not apply to you. See the
12 * LICENSE file included with this distribution for more information.
14 * If you did not agree to a different license, then this copy of Lustre
15 * is open source software; you can redistribute it and/or modify it
16 * under the terms of version 2 of the GNU General Public License as
17 * published by the Free Software Foundation.
19 * In either case, Lustre is distributed in the hope that it will be
20 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
21 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * license text for more details.
25 #define DEBUG_SUBSYSTEM S_CLASS
27 #include <linux/version.h>
28 #include <linux/vfs.h>
29 #include <obd_class.h>
30 #include <lprocfs_status.h>
34 static int mdc_rd_max_rpcs_in_flight(char *page, char **start, off_t off,
35 int count, int *eof, void *data)
37 struct obd_device *dev = data;
38 struct client_obd *cli = &dev->u.cli;
41 spin_lock(&cli->cl_loi_list_lock);
42 rc = snprintf(page, count, "%u\n", cli->cl_max_rpcs_in_flight);
43 spin_unlock(&cli->cl_loi_list_lock);
47 static int mdc_wr_max_rpcs_in_flight(struct file *file, const char *buffer,
48 unsigned long count, void *data)
50 struct obd_device *dev = data;
51 struct client_obd *cli = &dev->u.cli;
54 rc = lprocfs_write_helper(buffer, count, &val);
58 if (val < 1 || val > MDC_MAX_RIF_MAX)
61 spin_lock(&cli->cl_loi_list_lock);
62 cli->cl_max_rpcs_in_flight = val;
63 spin_unlock(&cli->cl_loi_list_lock);
67 static struct lprocfs_vars lprocfs_obd_vars[] = {
68 { "uuid", lprocfs_rd_uuid, 0, 0 },
69 { "ping", 0, lprocfs_wr_ping, 0 },
70 { "connect_flags", lprocfs_rd_connect_flags, 0, 0 },
71 { "blocksize", lprocfs_rd_blksize, 0, 0 },
72 { "kbytestotal", lprocfs_rd_kbytestotal, 0, 0 },
73 { "kbytesfree", lprocfs_rd_kbytesfree, 0, 0 },
74 { "kbytesavail", lprocfs_rd_kbytesavail, 0, 0 },
75 { "filestotal", lprocfs_rd_filestotal, 0, 0 },
76 { "filesfree", lprocfs_rd_filesfree, 0, 0 },
77 //{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
78 { "mds_server_uuid", lprocfs_rd_server_uuid, 0, 0 },
79 { "mds_conn_uuid", lprocfs_rd_conn_uuid, 0, 0 },
80 { "max_rpcs_in_flight", mdc_rd_max_rpcs_in_flight,
81 mdc_wr_max_rpcs_in_flight, 0 },
85 static struct lprocfs_vars lprocfs_module_vars[] = {
86 { "num_refs", lprocfs_rd_numrefs, 0, 0 },
90 LPROCFS_INIT_VARS(mdc, lprocfs_module_vars, lprocfs_obd_vars)