Whamcloud - gitweb
merge b_devel into HEAD, which will become 0.7.3
[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/lustre_lite.h>
29 #include <linux/lustre_fsfilt.h>
30 #include <linux/lprocfs_status.h>
31
32 #ifndef LPROCFS
33 struct lprocfs_vars lprocfs_mds_obd_vars[]  = { {0} };
34 struct lprocfs_vars lprocfs_mds_module_vars[] = { {0} };
35 struct lprocfs_vars lprocfs_mdt_obd_vars[] = { {0} };
36 struct lprocfs_vars lprocfs_mdt_module_vars[] = { {0} };
37
38 #else
39
40 static int lprocfs_mds_rd_mntdev(char *page, char **start, off_t off, int count,
41                                  int *eof, void *data)
42 {
43         struct obd_device* obd = (struct obd_device *)data;
44
45         LASSERT(obd != NULL);
46         LASSERT(obd->u.mds.mds_vfsmnt->mnt_devname);
47         *eof = 1;
48
49         return snprintf(page, count, "%s\n",obd->u.mds.mds_vfsmnt->mnt_devname);
50 }
51
52 struct lprocfs_vars lprocfs_mds_obd_vars[] = {
53         { "uuid",         lprocfs_rd_uuid,        0, 0 },
54         { "blocksize",    lprocfs_rd_blksize,     0, 0 },
55         { "kbytestotal",  lprocfs_rd_kbytestotal, 0, 0 },
56         { "kbytesfree",   lprocfs_rd_kbytesfree,  0, 0 },
57         { "fstype",       lprocfs_rd_fstype,      0, 0 },
58         { "filestotal",   lprocfs_rd_filestotal,  0, 0 },
59         { "filesfree",    lprocfs_rd_filesfree,   0, 0 },
60         //{ "filegroups",   lprocfs_rd_filegroups,  0, 0 },
61         { "mntdev",       lprocfs_mds_rd_mntdev,  0, 0 },
62         { 0 }
63 };
64
65 struct lprocfs_vars lprocfs_mds_module_vars[] = {
66         { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
67         { 0 }
68 };
69
70 struct lprocfs_vars lprocfs_mdt_obd_vars[] = {
71         { "uuid",         lprocfs_rd_uuid,        0, 0 },
72         { 0 }
73 };
74
75 struct lprocfs_vars lprocfs_mdt_module_vars[] = {
76         { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
77         { 0 }
78 };
79
80 #endif
81 struct lprocfs_static_vars lprocfs_array_vars[] = { {lprocfs_mds_module_vars,
82                                                      lprocfs_mds_obd_vars},
83                                                     {lprocfs_mdt_module_vars,
84                                                      lprocfs_mdt_obd_vars}};
85
86 LPROCFS_INIT_MULTI_VARS(lprocfs_array_vars,
87                         (sizeof(lprocfs_array_vars) /
88                          sizeof(struct lprocfs_static_vars)))