1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
8 #include <lustre/lustre_idl.h>
9 #include <lustre_dlm.h>
10 #include <lprocfs_status.h>
12 /* Data stored per client in the last_rcvd file. In le32 order. */
13 struct mds_client_data;
14 struct mdt_client_data;
15 struct mds_idmap_table;
16 struct mdt_idmap_table;
18 struct mdt_export_data {
19 struct list_head med_open_head;
20 spinlock_t med_open_lock; /* lock med_open_head, mfd_list*/
21 struct semaphore med_lcd_lock;
22 struct lsd_client_data *med_lcd;
23 __u64 med_ibits_known;
26 unsigned int med_rmtclient:1; /* remote client? */
27 struct semaphore med_idmap_sem;
28 struct lustre_idmap_table *med_idmap;
33 struct list_head oscc_list;
34 struct obd_device *oscc_obd;
35 obd_id oscc_last_id;//last available pre-created object
36 obd_id oscc_next_id;// what object id to give out next
39 * Limit oscc_grow_count value, can be changed via proc fs
41 int oscc_max_grow_count;
44 cfs_waitq_t oscc_waitq; /* creating procs wait on this */
47 struct ldlm_export_data {
48 struct list_head led_held_locks; /* protected by led_lock */
52 struct ec_export_data { /* echo client */
53 struct list_head eced_locks;
56 /* In-memory access to client data from OST struct */
57 struct filter_export_data {
58 spinlock_t fed_lock; /* protects fed_open_head */
59 struct lsd_client_data *fed_lcd;
62 long fed_dirty; /* in bytes */
63 long fed_grant; /* in bytes */
64 struct list_head fed_mod_list; /* files being modified */
65 int fed_mod_count;/* items in fed_writing list */
66 long fed_pending; /* bytes just being written */
68 struct brw_stats fed_brw_stats;
71 typedef struct nid_stat {
73 struct hlist_node nid_hash;
74 struct list_head nid_list;
75 struct obd_device *nid_obd;
76 struct proc_dir_entry *nid_proc;
77 struct lprocfs_stats *nid_stats;
78 struct brw_stats *nid_brw_stats;
79 int nid_exp_ref_count;
83 struct portals_handle exp_handle;
84 atomic_t exp_refcount;
85 atomic_t exp_rpc_count;
86 struct obd_uuid exp_client_uuid;
87 struct list_head exp_obd_chain;
88 struct hlist_node exp_uuid_hash; /* uuid-export hash*/
89 struct hlist_node exp_nid_hash; /* nid-export hash */
90 /* exp_obd_chain_timed fo ping evictor, protected by obd_dev_lock */
91 struct list_head exp_obd_chain_timed;
92 struct obd_device *exp_obd;
93 struct obd_import *exp_imp_reverse; /* to make RPCs backwards */
94 struct nid_stat *exp_nid_stats;
95 struct lprocfs_stats *exp_md_stats;
96 struct lprocfs_stats *exp_ldlm_stats;
97 struct ptlrpc_connection *exp_connection;
99 struct ldlm_export_data exp_ldlm_data;
100 struct list_head exp_outstanding_replies;
101 time_t exp_last_request_time;
102 struct list_head exp_req_replay_queue;
103 spinlock_t exp_lock; /* protects flags int below */
104 /* ^ protects exp_outstanding_replies too */
105 __u64 exp_connect_flags;
107 unsigned long exp_failed:1,
111 exp_req_replay_needed:1,
112 exp_lock_replay_needed:1,
116 exp_libclient:1; /* liblustre client? */
117 /* also protected by exp_lock */
118 enum lustre_sec_part exp_sp_peer;
119 struct sptlrpc_flavor exp_flvr; /* current */
120 struct sptlrpc_flavor exp_flvr_old[2]; /* about-to-expire */
121 cfs_time_t exp_flvr_expire[2]; /* seconds */
124 struct mdt_export_data eu_mdt_data;
125 struct filter_export_data eu_filter_data;
126 struct ec_export_data eu_ec_data;
130 #define exp_mdt_data u.eu_mdt_data
131 #define exp_filter_data u.eu_filter_data
132 #define exp_ec_data u.eu_ec_data
134 static inline int exp_connect_cancelset(struct obd_export *exp)
136 LASSERT(exp != NULL);
137 return !!(exp->exp_connect_flags & OBD_CONNECT_CANCELSET);
140 static inline int exp_connect_lru_resize(struct obd_export *exp)
142 LASSERT(exp != NULL);
143 return !!(exp->exp_connect_flags & OBD_CONNECT_LRU_RESIZE);
146 static inline int imp_connect_lru_resize(struct obd_import *imp)
148 struct obd_connect_data *ocd;
150 LASSERT(imp != NULL);
151 ocd = &imp->imp_connect_data;
152 return !!(ocd->ocd_connect_flags & OBD_CONNECT_LRU_RESIZE);
155 extern struct obd_export *class_conn2export(struct lustre_handle *conn);
156 extern struct obd_device *class_conn2obd(struct lustre_handle *conn);
158 #endif /* __EXPORT_H */