Whamcloud - gitweb
- update from b1_4_mountconf
[fs/lustre-release.git] / lustre / include / lustre_export.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef __EXPORT_H
6 #define __EXPORT_H
7
8 #include <lustre/lustre_idl.h>
9 #include <lustre_dlm.h>
10
11 /* Data stored per client in the last_rcvd file.  In le32 order. */
12 struct mds_client_data;
13
14 struct mds_export_data {
15         struct list_head        med_open_head;
16         spinlock_t              med_open_lock; /* lock med_open_head, mfd_list*/
17         struct mds_client_data *med_mcd;
18         __u64                   med_ibits_known;
19         loff_t                  med_lr_off;
20         int                     med_lr_idx;
21 };
22
23 struct osc_creator {
24         spinlock_t              oscc_lock;
25         struct list_head        oscc_list;
26         struct obd_device       *oscc_obd;
27         obd_id                  oscc_last_id;//last available pre-created object
28         obd_id                  oscc_next_id;// what object id to give out next
29         int                     oscc_grow_count;
30         struct obdo             oscc_oa;
31         int                     oscc_flags;
32         cfs_waitq_t             oscc_waitq; /* creating procs wait on this */
33 };
34
35 struct ldlm_export_data {
36         struct list_head       led_held_locks; /* protected by namespace lock */
37 };
38
39 struct ec_export_data { /* echo client */
40         struct list_head eced_locks;
41 };
42
43 /* In-memory access to client data from OST struct */
44 struct filter_client_data;
45 struct filter_export_data {
46         spinlock_t                 fed_lock;      /* protects fed_open_head */
47         struct filter_client_data *fed_fcd;
48         loff_t                     fed_lr_off;
49         int                        fed_lr_idx;
50         long                       fed_dirty;    /* in bytes */
51         long                       fed_grant;    /* in bytes */
52         long                       fed_pending;  /* bytes just being written */
53 };
54
55 struct obd_export {
56         struct portals_handle     exp_handle;
57         atomic_t                  exp_refcount;
58         struct obd_uuid           exp_client_uuid;
59         struct list_head          exp_obd_chain;
60         /* exp_obd_chain_timed fo ping evictor, protected by obd_dev_lock */
61         struct list_head          exp_obd_chain_timed;
62         struct obd_device        *exp_obd;
63         struct obd_import        *exp_imp_reverse; /* to make RPCs backwards */
64         struct ptlrpc_connection *exp_connection;
65         __u32                     exp_conn_cnt;
66         struct ldlm_export_data   exp_ldlm_data;
67         struct list_head          exp_outstanding_replies;
68         time_t                    exp_last_request_time;
69         spinlock_t                exp_lock; /* protects flags int below */
70         /* ^ protects exp_outstanding_replies too */
71         __u64                     exp_connect_flags;
72         int                       exp_flags;
73         unsigned int              exp_failed:1,
74                                   exp_disconnected:1,
75                                   exp_connecting:1,
76                                   exp_replay_needed:1,
77                                   exp_libclient:1; /* liblustre client? */
78         union {
79                 struct mds_export_data    eu_mds_data;
80                 struct filter_export_data eu_filter_data;
81                 struct ec_export_data     eu_ec_data;
82         } u;
83 };
84
85 #define exp_mds_data    u.eu_mds_data
86 #define exp_lov_data    u.eu_lov_data
87 #define exp_filter_data u.eu_filter_data
88 #define exp_ec_data     u.eu_ec_data
89
90 extern struct obd_export *class_conn2export(struct lustre_handle *conn);
91 extern struct obd_device *class_conn2obd(struct lustre_handle *conn);
92
93 #endif /* __EXPORT_H */