Whamcloud - gitweb
6aac9608b06a291005ee54d099e89c972e2a96b2
[fs/lustre-release.git] / lustre / ptlrpc / ptlrpc_module.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (c) 2002, 2003 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  */
22
23 #ifndef EXPORT_SYMTAB
24 # define EXPORT_SYMTAB
25 #endif
26 #define DEBUG_SUBSYSTEM S_RPC
27
28 #ifdef __KERNEL__
29 # include <linux/module.h>
30 # include <linux/init.h>
31 #else
32 # include <liblustre.h>
33 #endif
34
35 #include <linux/obd_support.h>
36 #include <linux/obd_class.h>
37 #include <linux/lustre_net.h>
38
39 #include "ptlrpc_internal.h"
40
41 extern int ptlrpc_init_portals(void);
42 extern void ptlrpc_exit_portals(void);
43
44 __init int ptlrpc_init(void)
45 {
46         int rc;
47         ENTRY;
48
49         lustre_assert_wire_constants();
50
51         rc = ptlrpc_init_portals();
52         if (rc)
53                 RETURN(rc);
54
55         ptlrpc_init_connection();
56         llog_init_commit_master();
57
58         ptlrpc_put_connection_superhack = ptlrpc_put_connection;
59         ptlrpc_abort_inflight_superhack = ptlrpc_abort_inflight;
60
61         ptlrpc_start_pinger();
62         ldlm_init();
63         RETURN(0);
64 }
65
66 #ifdef __KERNEL__
67 static void __exit ptlrpc_exit(void)
68 {
69         ldlm_exit();
70         ptlrpc_stop_pinger();
71         ptlrpc_exit_portals();
72         ptlrpc_cleanup_connection();
73         llog_cleanup_commit_master(0);
74 }
75
76 /* connection.c */
77 EXPORT_SYMBOL(ptlrpc_dump_connections);
78 EXPORT_SYMBOL(ptlrpc_readdress_connection);
79 EXPORT_SYMBOL(ptlrpc_get_connection);
80 EXPORT_SYMBOL(ptlrpc_put_connection);
81 EXPORT_SYMBOL(ptlrpc_connection_addref);
82 EXPORT_SYMBOL(ptlrpc_init_connection);
83 EXPORT_SYMBOL(ptlrpc_cleanup_connection);
84
85 /* niobuf.c */
86 EXPORT_SYMBOL(ptlrpc_start_bulk_transfer);
87 EXPORT_SYMBOL(ptlrpc_abort_bulk);
88 EXPORT_SYMBOL(ptlrpc_register_bulk);
89 EXPORT_SYMBOL(ptlrpc_unregister_bulk);
90 EXPORT_SYMBOL(ptlrpc_send_reply);
91 EXPORT_SYMBOL(ptlrpc_reply);
92 EXPORT_SYMBOL(ptlrpc_error);
93 EXPORT_SYMBOL(ptlrpc_resend_req);
94 EXPORT_SYMBOL(ptl_send_rpc);
95 EXPORT_SYMBOL(ptl_do_rawrpc);
96 EXPORT_SYMBOL(ptl_do_rawrpc_simple);
97 EXPORT_SYMBOL(rawrpc_req_finished);
98
99 /* client.c */
100 EXPORT_SYMBOL(ptlrpc_init_client);
101 EXPORT_SYMBOL(ptlrpc_cleanup_client);
102 EXPORT_SYMBOL(ptlrpc_uuid_to_connection);
103 EXPORT_SYMBOL(ptlrpc_queue_wait);
104 EXPORT_SYMBOL(ptlrpc_replay_req);
105 EXPORT_SYMBOL(ptlrpc_restart_req);
106 EXPORT_SYMBOL(ptlrpc_prep_req);
107 EXPORT_SYMBOL(ptlrpc_free_req);
108 EXPORT_SYMBOL(ptlrpc_unregister_reply);
109 EXPORT_SYMBOL(ptlrpc_req_finished);
110 EXPORT_SYMBOL(ptlrpc_req_finished_with_imp_lock);
111 EXPORT_SYMBOL(ptlrpc_request_addref);
112 EXPORT_SYMBOL(ptlrpc_prep_bulk_imp);
113 EXPORT_SYMBOL(ptlrpc_prep_bulk_exp);
114 EXPORT_SYMBOL(ptlrpc_free_bulk);
115 EXPORT_SYMBOL(ptlrpc_prep_bulk_page);
116 EXPORT_SYMBOL(ptlrpc_abort_inflight);
117 EXPORT_SYMBOL(ptlrpc_retain_replayable_request);
118 EXPORT_SYMBOL(ptlrpc_next_xid);
119
120 EXPORT_SYMBOL(ptlrpc_prep_set);
121 EXPORT_SYMBOL(ptlrpc_set_add_req);
122 EXPORT_SYMBOL(ptlrpc_set_add_new_req);
123 EXPORT_SYMBOL(ptlrpc_set_destroy);
124 EXPORT_SYMBOL(ptlrpc_set_next_timeout);
125 EXPORT_SYMBOL(ptlrpc_check_set);
126 EXPORT_SYMBOL(ptlrpc_set_wait);
127 EXPORT_SYMBOL(ptlrpc_expired_set);
128 EXPORT_SYMBOL(ptlrpc_interrupted_set);
129 EXPORT_SYMBOL(ptlrpc_mark_interrupted);
130
131 /* import.c */
132 EXPORT_SYMBOL(ptlrpc_deactivate_import);
133 EXPORT_SYMBOL(ptlrpc_invalidate_import);
134 EXPORT_SYMBOL(ptlrpc_activate_import);
135 EXPORT_SYMBOL(ptlrpc_fail_import);
136 EXPORT_SYMBOL(ptlrpc_disconnect_import);
137 EXPORT_SYMBOL(ptlrpc_import_control_recovery);
138
139 /* service.c */
140 EXPORT_SYMBOL(ptlrpc_require_repack);
141 EXPORT_SYMBOL(ptlrpc_save_lock);
142 EXPORT_SYMBOL(ptlrpc_save_llog_lock);
143 EXPORT_SYMBOL(ptlrpc_schedule_difficult_reply);
144 EXPORT_SYMBOL(ptlrpc_commit_replies);
145 EXPORT_SYMBOL(ptlrpc_init_svc);
146 EXPORT_SYMBOL(ptlrpc_stop_all_threads);
147 EXPORT_SYMBOL(ptlrpc_start_n_threads);
148 EXPORT_SYMBOL(ptlrpc_start_thread);
149 EXPORT_SYMBOL(ptlrpc_unregister_service);
150 EXPORT_SYMBOL(ptlrpc_daemonize);
151
152 /* pack_generic.c */
153 EXPORT_SYMBOL(lustre_msg_swabbed);
154 EXPORT_SYMBOL(lustre_msg_check_version);
155 EXPORT_SYMBOL(lustre_secdesc_size);
156 EXPORT_SYMBOL(lustre_pack_secdesc);
157 EXPORT_SYMBOL(lustre_pack_request);
158 EXPORT_SYMBOL(lustre_pack_reply);
159 EXPORT_SYMBOL(lustre_free_reply_state);
160 EXPORT_SYMBOL(lustre_msg_size);
161 EXPORT_SYMBOL(lustre_init_msg);
162 EXPORT_SYMBOL(lustre_unpack_msg);
163 EXPORT_SYMBOL(lustre_msg_buf);
164 EXPORT_SYMBOL(lustre_msg_string);
165 EXPORT_SYMBOL(lustre_swab_buf);
166 EXPORT_SYMBOL(lustre_swab_reqbuf);
167 EXPORT_SYMBOL(lustre_swab_repbuf);
168 EXPORT_SYMBOL(lustre_swab_obdo);
169 EXPORT_SYMBOL(lustre_swab_obd_statfs);
170 EXPORT_SYMBOL(lustre_swab_obd_ioobj);
171 EXPORT_SYMBOL(lustre_swab_niobuf_remote);
172 EXPORT_SYMBOL(lustre_swab_ost_body);
173 EXPORT_SYMBOL(lustre_swab_ost_last_id);
174 EXPORT_SYMBOL(lustre_swab_ost_lvb);
175 EXPORT_SYMBOL(lustre_swab_generic_32s);
176 EXPORT_SYMBOL(lustre_swab_lustre_id);
177 EXPORT_SYMBOL(lustre_swab_lustre_stc);
178 EXPORT_SYMBOL(lustre_swab_lustre_fid);
179 EXPORT_SYMBOL(lustre_swab_parseid_pkg);
180 EXPORT_SYMBOL(lustre_swab_audit_msg);
181 EXPORT_SYMBOL(lustre_swab_audit_attr);
182 EXPORT_SYMBOL(lustre_swab_mds_status_req);
183 EXPORT_SYMBOL(lustre_swab_mds_secdesc);
184 EXPORT_SYMBOL(lustre_swab_remote_perm);
185 EXPORT_SYMBOL(lustre_swab_mds_body);
186 EXPORT_SYMBOL(lustre_swab_mds_rec_setattr);
187 EXPORT_SYMBOL(lustre_swab_mds_rec_create);
188 EXPORT_SYMBOL(lustre_swab_mds_rec_link);
189 EXPORT_SYMBOL(lustre_swab_mds_rec_unlink);
190 EXPORT_SYMBOL(lustre_swab_mds_rec_rename);
191 EXPORT_SYMBOL(lustre_swab_lov_desc);
192 EXPORT_SYMBOL(lustre_swab_fid_extent);
193 EXPORT_SYMBOL(lustre_swab_ldlm_res_id);
194 EXPORT_SYMBOL(lustre_swab_ldlm_policy_data);
195 EXPORT_SYMBOL(lustre_swab_ldlm_intent);
196 EXPORT_SYMBOL(lustre_swab_ldlm_resource_desc);
197 EXPORT_SYMBOL(lustre_swab_ldlm_lock_desc);
198 EXPORT_SYMBOL(lustre_swab_ldlm_request);
199 EXPORT_SYMBOL(lustre_swab_ldlm_reply);
200 EXPORT_SYMBOL(lustre_swab_ptlbd_op);
201 EXPORT_SYMBOL(lustre_swab_ptlbd_niob);
202 EXPORT_SYMBOL(lustre_swab_ptlbd_rsp);
203 EXPORT_SYMBOL(lustre_swab_lustre_capa);
204 EXPORT_SYMBOL(lustre_swab_lustre_capa_key);
205 EXPORT_SYMBOL(lustre_swab_key_context);
206 EXPORT_SYMBOL(lustre_swab_key_perms);
207 EXPORT_SYMBOL(mdc_create_pack);
208 EXPORT_SYMBOL(mdc_setattr_pack);
209 EXPORT_SYMBOL(mdc_unlink_pack);
210 EXPORT_SYMBOL(mdc_link_pack);
211 EXPORT_SYMBOL(mdc_rename_pack);
212 EXPORT_SYMBOL(mds_pack_open_flags);
213
214 /* recover.c */
215 EXPORT_SYMBOL(ptlrpc_run_recovery_over_upcall);
216 EXPORT_SYMBOL(ptlrpc_run_failed_import_upcall);
217 EXPORT_SYMBOL(ptlrpc_resend);
218 EXPORT_SYMBOL(ptlrpc_wake_delayed);
219 EXPORT_SYMBOL(ptlrpc_set_import_active);
220 EXPORT_SYMBOL(ptlrpc_fail_export);
221 EXPORT_SYMBOL(ptlrpc_recover_import);
222
223 /* pinger.c */
224 EXPORT_SYMBOL(ptlrpc_pinger_add_import);
225 EXPORT_SYMBOL(ptlrpc_pinger_del_import);
226 EXPORT_SYMBOL(ptlrpc_pinger_sending_on_import);
227
228 /* ptlrpcd.c */
229 EXPORT_SYMBOL(ptlrpcd_addref);
230 EXPORT_SYMBOL(ptlrpcd_decref);
231 EXPORT_SYMBOL(ptlrpcd_add_req);
232 EXPORT_SYMBOL(ptlrpcd_wake);
233
234 /* lproc_ptlrpc.c */
235 EXPORT_SYMBOL(ptlrpc_lprocfs_register_obd);
236 EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);
237
238 /* llogd.c */
239 EXPORT_SYMBOL(llog_origin_handle_open);
240 EXPORT_SYMBOL(llog_origin_handle_prev_block);
241 EXPORT_SYMBOL(llog_origin_handle_next_block);
242 EXPORT_SYMBOL(llog_origin_handle_read_header);
243 EXPORT_SYMBOL(llog_origin_handle_close);
244 EXPORT_SYMBOL(llog_client_ops);
245 EXPORT_SYMBOL(llog_catinfo);
246
247 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
248 MODULE_DESCRIPTION("Lustre Request Processor and Lock Management");
249 MODULE_LICENSE("GPL");
250
251 module_init(ptlrpc_init);
252 module_exit(ptlrpc_exit);
253 #endif