Whamcloud - gitweb
not wait for finish requests if this mgc connection.
[fs/lustre-release.git] / lustre / ptlrpc / ptlrpc_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2003 Cluster File Systems, Inc.
5  *
6  *   This file is part of the Lustre file system, http://www.lustre.org
7  *   Lustre is a trademark of Cluster File Systems, Inc.
8  *
9  *   You may have signed or agreed to another license before downloading
10  *   this software.  If so, you are bound by the terms and conditions
11  *   of that agreement, and the following does not apply to you.  See the
12  *   LICENSE file included with this distribution for more information.
13  *
14  *   If you did not agree to a different license, then this copy of Lustre
15  *   is open source software; you can redistribute it and/or modify it
16  *   under the terms of version 2 of the GNU General Public License as
17  *   published by the Free Software Foundation.
18  *
19  *   In either case, Lustre is distributed in the hope that it will be
20  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
21  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *   license text for more details.
23  *
24  */
25
26 /* Intramodule declarations for ptlrpc. */
27
28 #ifndef PTLRPC_INTERNAL_H
29 #define PTLRPC_INTERNAL_H
30
31 #include "../ldlm/ldlm_internal.h"
32
33 struct ldlm_namespace;
34 struct obd_import;
35 struct ldlm_res_id;
36 struct ptlrpc_request_set;
37 extern int test_req_buffer_pressure;
38
39 void ptlrpc_request_handle_notconn(struct ptlrpc_request *);
40 void lustre_assert_wire_constants(void);
41 int ptlrpc_import_in_recovery(struct obd_import *imp);
42 int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt);
43 void ptlrpc_handle_failed_import(struct obd_import *imp);
44 int ptlrpc_replay_next(struct obd_import *imp, int *inflight);
45 void ptlrpc_initiate_recovery(struct obd_import *imp);
46
47 int lustre_unpack_req_ptlrpc_body(struct ptlrpc_request *req, int offset);
48 int lustre_unpack_rep_ptlrpc_body(struct ptlrpc_request *req, int offset);
49
50 #ifdef LPROCFS
51 void ptlrpc_lprocfs_register_service(struct proc_dir_entry *proc_entry,
52                                      struct ptlrpc_service *svc);
53 void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc);
54 void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req);
55 void ptlrpc_lprocfs_do_request_stat (struct ptlrpc_request *req,
56                                      long q_usec, long work_usec);
57 #else
58 #define ptlrpc_lprocfs_register_service(params...) do{}while(0)
59 #define ptlrpc_lprocfs_unregister_service(params...) do{}while(0)
60 #define ptlrpc_lprocfs_rpc_sent(params...) do{}while(0)
61 #define ptlrpc_lprocfs_do_request_stat(params...) do{}while(0)
62 #endif /* LPROCFS */
63
64 /* recovd_thread.c */
65
66 int ptlrpc_expire_one_request(struct ptlrpc_request *req);
67
68 /* pers.c */
69 void ptlrpc_fill_bulk_md(lnet_md_t *md, struct ptlrpc_bulk_desc *desc);
70 void ptlrpc_add_bulk_page(struct ptlrpc_bulk_desc *desc, cfs_page_t *page,
71                           int pageoffset, int len);
72 void ptl_rpc_wipe_bulk_pages(struct ptlrpc_bulk_desc *desc);
73
74 /* pack_generic.c */
75 struct ptlrpc_reply_state *lustre_get_emerg_rs(struct ptlrpc_service *svc);
76 void lustre_put_emerg_rs(struct ptlrpc_reply_state *rs);
77
78 /* pinger.c */
79 int ptlrpc_start_pinger(void);
80 int ptlrpc_stop_pinger(void);
81 void ptlrpc_pinger_sending_on_import(struct obd_import *imp);
82 void ptlrpc_pinger_wake_up(void);
83 void ptlrpc_ping_import_soon(struct obd_import *imp);
84 #ifdef __KERNEL__
85 int ping_evictor_wake(struct obd_export *exp);
86 #else
87 #define ping_evictor_wake(exp)     1
88 #endif
89
90 /* sec_null.c */
91 int  sptlrpc_null_init(void);
92 void sptlrpc_null_fini(void);
93
94 /* sec_plain.c */
95 int  sptlrpc_plain_init(void);
96 void sptlrpc_plain_fini(void);
97
98 /* sec_bulk.c */
99 int  sptlrpc_enc_pool_init(void);
100 void sptlrpc_enc_pool_fini(void);
101 int sptlrpc_proc_read_enc_pool(char *page, char **start, off_t off, int count,
102                                int *eof, void *data);
103
104 /* sec_lproc.c */
105 int  sptlrpc_lproc_init(void);
106 void sptlrpc_lproc_fini(void);
107
108 /* sec_gc.c */
109 int sptlrpc_gc_start_thread(void);
110 void sptlrpc_gc_stop_thread(void);
111
112 /* sec.c */
113 int  __init sptlrpc_init(void);
114 void __exit sptlrpc_fini(void);
115
116 static inline int ll_rpc_recoverable_error(int rc)
117
118         return (rc == -ENOTCONN || rc == -ENODEV);
119 }
120 #endif /* PTLRPC_INTERNAL_H */