Whamcloud - gitweb
*** empty log message ***
[fs/lustre-release.git] / lustre / mds / lproc_mds.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2002 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  */
22 #define DEBUG_SUBSYSTEM S_CLASS
23
24 #include <linux/version.h>
25 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
26 #include <asm/statfs.h>
27 #endif
28 #include <linux/obd.h>
29 #include <linux/obd_class.h>
30 #include <linux/lprocfs_status.h>
31
32 #include "mds_internal.h"
33
34 #ifdef LPROCFS
35 static int lprocfs_mds_rd_mntdev(char *page, char **start, off_t off, int count,
36                                  int *eof, void *data)
37 {
38         struct obd_device* obd = (struct obd_device *)data;
39
40         LASSERT(obd != NULL);
41         LASSERT(obd->u.mds.mds_vfsmnt->mnt_devname);
42         *eof = 1;
43
44         return snprintf(page, count, "%s\n",obd->u.mds.mds_vfsmnt->mnt_devname);
45 }
46
47 struct lprocfs_vars lprocfs_mds_obd_vars[] = {
48         { "uuid",         lprocfs_rd_uuid,        0, 0 },
49         { "blocksize",    lprocfs_rd_blksize,     0, 0 },
50         { "kbytestotal",  lprocfs_rd_kbytestotal, 0, 0 },
51         { "kbytesfree",   lprocfs_rd_kbytesfree,  0, 0 },
52         { "kbytesavail",  lprocfs_rd_kbytesavail, 0, 0 },
53         { "filestotal",   lprocfs_rd_filestotal,  0, 0 },
54         { "filesfree",    lprocfs_rd_filesfree,   0, 0 },
55         { "fstype",       lprocfs_rd_fstype,      0, 0 },
56         { "mntdev",       lprocfs_mds_rd_mntdev,  0, 0 },
57         { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 },
58         { "evict_client", 0, lprocfs_wr_evict_client, 0 },
59         { "num_exports",  lprocfs_rd_num_exports, 0, 0 },
60 #ifdef HAVE_QUOTA_SUPPORT
61         { "quota_bunit_sz", lprocfs_mds_rd_bunit, lprocfs_mds_wr_bunit, 0 },
62         { "quota_btune_sz", lprocfs_mds_rd_btune, lprocfs_mds_wr_btune, 0 },
63         { "quota_iunit_sz", lprocfs_mds_rd_iunit, lprocfs_mds_wr_iunit, 0 },
64         { "quota_itune_sz", lprocfs_mds_rd_itune, lprocfs_mds_wr_itune, 0 },
65 #endif
66         { 0 }
67 };
68
69 struct lprocfs_vars lprocfs_mds_module_vars[] = {
70         { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
71         { 0 }
72 };
73
74 struct lprocfs_vars lprocfs_mdt_obd_vars[] = {
75         { "uuid",         lprocfs_rd_uuid,        0, 0 },
76         { 0 }
77 };
78
79 struct lprocfs_vars lprocfs_mdt_module_vars[] = {
80         { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
81         { 0 }
82 };
83
84 LPROCFS_INIT_VARS(mds, lprocfs_mds_module_vars, lprocfs_mds_obd_vars);
85 LPROCFS_INIT_VARS(mdt, lprocfs_mdt_module_vars, lprocfs_mdt_obd_vars);
86 #endif