Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / include / lustre_mdt.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2006 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 __LINUX_MDT_H
24 #define __LINUX_MDT_H
25
26 #include <lustre/lustre_idl.h>
27 #include <lustre_req_layout.h>
28 #include <md_object.h>
29 #include <dt_object.h>
30 #include <libcfs/libcfs.h>
31
32 /*
33  * Common thread info for mdt, seq and fld
34  */
35 struct com_thread_info {
36         /*
37          * for req-layout interface.
38          */
39         struct req_capsule *cti_pill;
40 };
41
42 enum {
43         ESERIOUS = 0x0001000
44 };
45
46 static inline int err_serious(int rc)
47 {
48         LASSERT(rc < 0);
49         LASSERT(-rc < ESERIOUS);
50         return -(-rc | ESERIOUS);
51 }
52
53 static inline int clear_serious(int rc)
54 {
55         if (rc < 0)
56                 rc = -(-rc & ~ESERIOUS);
57         return rc;
58 }
59
60 static inline int is_serious(int rc)
61 {
62         return (rc < 0 && -rc & ESERIOUS);
63 }
64
65
66 #endif