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 Lustre, http://www.lustre.org.
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.
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.
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.
22 #define DEBUG_SUBSYSTEM S_CLASS
24 #include <linux/lustre_lite.h>
25 #include <linux/lprocfs_status.h>
28 static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
29 static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
31 /* Common STATUS namespace */
32 static int cobd_rd_target(char *page, char **start, off_t off, int count,
35 struct obd_device *cobd = (struct obd_device *)data;
38 LASSERT(cobd != NULL);
40 if (!cobd->obd_set_up) {
41 rc = snprintf(page, count, "not set up\n");
43 struct obd_device *tgt =
44 class_conn2obd(&cobd->u.cobd.cobd_target);
46 rc = snprintf(page, count, "%s\n", tgt->obd_uuid.uuid);
51 static int cobd_rd_cache(char *page, char **start, off_t off, int count,
54 struct obd_device *cobd = (struct obd_device*)data;
57 LASSERT(cobd != NULL);
59 if (!cobd->obd_set_up) {
60 rc = snprintf(page, count, "not set up\n");
62 struct obd_device *cache =
63 class_conn2obd(&cobd->u.cobd.cobd_cache);
64 LASSERT(cache != NULL);
65 rc = snprintf(page, count, "%s\n", cache->obd_uuid.uuid);
70 static struct lprocfs_vars lprocfs_obd_vars[] = {
71 { "uuid", lprocfs_rd_uuid, 0, 0 },
72 { "target_uuid", cobd_rd_target, 0, 0 },
73 { "cache_uuid", cobd_rd_cache, 0, 0 },
77 struct lprocfs_vars lprocfs_module_vars[] = {
78 { "num_refs", lprocfs_rd_numrefs, 0, 0 },
83 LPROCFS_INIT_VARS(cobd, lprocfs_module_vars, lprocfs_obd_vars)