Whamcloud - gitweb
- comment out the noisy get/put LDLM_DEBUGs; I'll remove them when I'm sure
[fs/lustre-release.git] / lustre / include / linux / lustre_debug.h
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
23 #ifndef _LUSTRE_DEBUG_H
24 #define _LUSTRE_DEBUG_H
25
26 #include <linux/lustre_net.h>
27
28 #define ASSERT_MAX_SIZE_MB 60000ULL
29 #define ASSERT_PAGE_INDEX(index, OP)                                    \
30 do { if (index > ASSERT_MAX_SIZE_MB << (20 - PAGE_SHIFT)) {             \
31         CERROR("bad page index %lu > %Lu\n", index,                     \
32                ASSERT_MAX_SIZE_MB << (20 - PAGE_SHIFT));                \
33         portal_debug = ~0UL;                                            \
34         OP;                                                             \
35 }} while(0)
36
37 #define ASSERT_FILE_OFFSET(offset, OP)                                  \
38 do { if (offset > ASSERT_MAX_SIZE_MB << 20) {                           \
39         CERROR("bad file offset %Lu > %Lu\n", offset,                   \
40                ASSERT_MAX_SIZE_MB << 20);                               \
41         portal_debug = ~0UL;                                            \
42         OP;                                                             \
43 }} while(0)
44
45 /* lib/debug.c */
46 int dump_lniobuf(struct niobuf_local *lnb);
47 int dump_rniobuf(struct niobuf_remote *rnb);
48 int dump_ioo(struct obd_ioobj *nb);
49 int dump_req(struct ptlrpc_request *req);
50 int dump_obdo(struct obdo *oa);
51 #endif