1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
38 * Lustre Metadata Server (MDS) filesystem interface code
41 # define EXPORT_SYMTAB
43 #define DEBUG_SUBSYSTEM S_MDS
45 #include "mdt_internal.h"
47 int mdt_export_stats_init(struct obd_device *obd,
48 struct obd_export *exp,
51 lnet_nid_t *client_nid = localdata;
54 rc = lprocfs_exp_setup(exp, client_nid, &newnid);
56 /* Mask error for already created
63 if ((obd->md_stats == NULL) &&
64 (rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_NR)))
67 /* Always add in ldlm_stats */
68 exp->exp_nid_stats->nid_ldlm_stats =
69 lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC,
70 LPROCFS_STATS_FLAG_NOPERCPU);
71 if (exp->exp_nid_stats->nid_ldlm_stats == NULL)
73 lprocfs_init_ldlm_stats(exp->exp_nid_stats->nid_ldlm_stats);
74 rc = lprocfs_register_stats(exp->exp_nid_stats->nid_proc,
76 exp->exp_nid_stats->nid_ldlm_stats);