Whamcloud - gitweb
0f0d67dec8031fde6b29396e8334dd08d5840ba5
[fs/lustre-release.git] / lustre / include / linux / lustre_import.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2001  Cluster File Systems, Inc.
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  */
9
10 #ifndef __IMPORT_H
11 #define __IMPORT_H
12
13 #ifdef __KERNEL__
14
15 #define IMP_INVALID       1
16 #define IMP_REPLAYABLE    2
17
18 typedef int (*import_recover_t)(struct obd_import *imp, int phase);
19
20 #include <linux/lustre_idl.h>
21 struct obd_import {
22         import_recover_t          imp_recover;
23         struct ptlrpc_connection *imp_connection;
24         struct ptlrpc_client     *imp_client;
25         struct lustre_handle      imp_handle;
26         struct list_head          imp_chain;
27
28         /* Lists of requests that are retained for replay, waiting for a reply,
29          * or waiting for recovery to complete, respectively.
30          */
31         struct list_head          imp_replay_list;
32         struct list_head          imp_sending_list;
33         struct list_head          imp_delayed_list;
34
35         struct obd_device        *imp_obd;
36         int                       imp_flags;
37         int                       imp_level;
38         __u64                     imp_last_xid;
39         __u64                     imp_max_transno;
40         __u64                     imp_peer_last_xid;
41         __u64                     imp_peer_committed_transno;
42
43         /* Protects flags, level, *_xid, *_list */
44         spinlock_t                imp_lock;
45 };
46
47 extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
48 extern struct obd_import *class_conn2ldlmimp(struct lustre_handle *);
49
50 #endif /* __KERNEL__ */
51
52 #endif /* __IMPORT_H */