Whamcloud - gitweb
6939a9541912eaab592fa51ea8f6044fa975fe47
[fs/lustre-release.git] / lustre / include / linux / lustre_export.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 __EXPORT_H
11 #define __EXPORT_H
12
13 #include <linux/lustre_idl.h>
14 #include <linux/obd_filter.h>
15
16 struct mds_client_data;
17
18 struct mds_export_data {
19         struct list_head        med_open_head;
20         spinlock_t              med_open_lock;
21         struct mds_client_data *med_mcd;
22         int                     med_off;
23 };
24
25 struct ldlm_export_data {
26         struct list_head       led_held_locks; /* protected by namespace lock */
27         struct obd_import     *led_import;
28 };
29
30 struct lov_export_data {
31         spinlock_t       led_lock;
32         struct list_head led_open_head;
33 };
34
35 struct ec_export_data { /* echo client */
36         struct list_head eced_open_head;
37         struct list_head eced_locks;
38 };
39
40 struct obd_export {
41         struct portals_handle     exp_handle;
42         atomic_t                  exp_refcount;
43         struct obd_uuid           exp_client_uuid;
44         struct list_head          exp_obd_chain;
45         struct obd_device        *exp_obd;
46         struct ptlrpc_connection *exp_connection;
47         struct ldlm_export_data   exp_ldlm_data;
48         struct ptlrpc_request    *exp_outstanding_reply;
49         time_t                    exp_last_request_time;
50         spinlock_t                exp_lock; /* protects flags int below */
51         int                       exp_failed:1, exp_failover:1;
52         union {
53                 struct mds_export_data    eu_mds_data;
54                 struct filter_export_data eu_filter_data;
55                 struct lov_export_data    eu_lov_data;
56                 struct ec_export_data     eu_ec_data;
57         } u;
58 };
59
60 #define exp_mds_data    u.eu_mds_data
61 #define exp_lov_data    u.eu_lov_data
62 #define exp_filter_data u.eu_filter_data
63 #define exp_ec_data     u.eu_ec_data
64
65 extern struct obd_export *class_conn2export(struct lustre_handle *conn);
66 extern struct obd_device *class_conn2obd(struct lustre_handle *conn);
67
68 #endif /* __EXPORT_H */