1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001 Cluster File Systems, Inc.
6 * This code is issued under the GNU General Public License.
7 * See the file COPYING in this distribution
13 #include <linux/lustre_handles.h>
14 #include <linux/lustre_idl.h>
17 struct portals_handle imp_handle;
18 atomic_t imp_refcount;
19 struct lustre_handle imp_dlm_handle; /* client's ldlm export */
20 struct ptlrpc_connection *imp_connection;
21 struct ptlrpc_client *imp_client;
22 struct list_head imp_observers;
23 struct list_head imp_pinger_chain;
25 /* Lists of requests that are retained for replay, waiting for a reply,
26 * or waiting for recovery to complete, respectively.
28 struct list_head imp_replay_list;
29 struct list_head imp_sending_list;
30 struct list_head imp_delayed_list;
32 struct obd_device *imp_obd;
35 __u64 imp_max_transno;
36 __u64 imp_peer_committed_transno;
37 struct obd_uuid imp_target_uuid; /* XXX -> lustre_name */
38 struct lustre_handle imp_remote_handle;
40 /* Protects flags, level, generation, *_list */
44 int imp_invalid:1, imp_replayable:1,
49 typedef void (*obd_import_callback)(struct obd_import *imp, void *closure,
50 int event, void *event_arg, void *cb_data);
52 struct obd_import_observer {
53 struct list_head oio_chain;
54 obd_import_callback oio_cb;
58 void class_observe_import(struct obd_import *imp, obd_import_callback cb,
60 void class_unobserve_import(struct obd_import *imp, obd_import_callback cb,
62 void class_notify_import_observers(struct obd_import *imp, int event,
65 #define IMP_EVENT_ACTIVE 1
66 #define IMP_EVENT_INACTIVE 2
69 extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
70 extern struct obd_import *class_conn2ldlmimp(struct lustre_handle *);
72 #endif /* __IMPORT_H */