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.
23 #ifndef _LUSTRE_DEBUG_H
24 #define _LUSTRE_DEBUG_H
26 #include <linux/lustre_net.h>
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; \
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; \
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 int page_debug_setup(void *addr, int len, __u64 off, __u64 id);
52 int page_debug_check(char *who, void *addr, int len, __u64 off, __u64 id);