Whamcloud - gitweb
land 0.5.20.3 b_devel onto HEAD (b_devel will remain)
[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
14 #define IMP_INVALID       1
15 #define IMP_REPLAYABLE    2
16
17
18 struct obd_import;
19 typedef int (*import_recover_t)(struct obd_import *imp, int phase);
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_max_transno;
40         __u64                     imp_peer_committed_transno;
41
42         /* Protects flags, level, *_list */
43         spinlock_t                imp_lock;
44 };
45
46 extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
47 extern struct obd_import *class_conn2ldlmimp(struct lustre_handle *);
48
49
50 #endif /* __IMPORT_H */