Whamcloud - gitweb
36cd54f18b1f3dbe4eccb0013bc783d6df9e0e12
[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
22 struct obd_import {
23         import_recover_t          imp_recover;
24         struct ptlrpc_connection *imp_connection;
25         struct ptlrpc_client     *imp_client;
26         struct lustre_handle      imp_handle;
27         struct list_head          imp_chain;
28
29         /* Lists of requests that are retained for replay, waiting for a reply,
30          * or waiting for recovery to complete, respectively.
31          */
32         struct list_head          imp_replay_list;
33         struct list_head          imp_sending_list;
34         struct list_head          imp_delayed_list;
35
36         struct obd_device        *imp_obd;
37         int                       imp_flags;
38         int                       imp_level;
39         __u64                     imp_last_xid;
40         __u64                     imp_last_bulk_xid;
41         __u64                     imp_max_transno;
42         __u64                     imp_peer_committed_transno;
43
44         /* Protects flags, level, last_xid, *_list */
45         spinlock_t                imp_lock;
46 };
47
48 extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
49 extern struct obd_import *class_conn2ldlmimp(struct lustre_handle *);
50
51 #endif /* __KERNEL__ */
52
53 #endif /* __IMPORT_H */