Motr  M0
failvec.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 
24 #pragma once
25 
26 #ifndef __MOTR_HA_FAILVEC_H__
27 #define __MOTR_HA_FAILVEC_H__
28 
29 
30 #include "lib/tlist.h" /* m0_tl */
31 #include "lib/mutex.h" /* m0_mutex */
32 #include "ha/dispatcher.h" /* m0_motr_ha_handler */
33 #include "lib/cookie.h" /* m0_cookie */
34 #include "ha/note.h" /* M0_HA_STATE_UPDATE_LIMIT */
35 #include "xcode/xcode_attr.h"
36 
37 #include "ha/note_xc.h"
38 #include "lib/cookie_xc.h"
39 
40 /* Forward declarations. */
41 struct m0_cookie;
42 struct m0_poolmach;
43 struct m0_fid;
44 struct m0_chan;
45 struct m0_ha_dispatcher;
46 
48  struct m0_fid mfq_pool;
50 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
51 
53  struct m0_fid mfp_pool;
55  uint32_t mfp_nr;
57 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
58 
60  struct m0_tl hfh_fvreq;
64 };
65 
66 M0_INTERNAL int m0_ha_fvec_handler_init(struct m0_ha_fvec_handler *hfh,
67  struct m0_ha_dispatcher *hd);
68 
69 M0_INTERNAL void m0_ha_fvec_handler_fini(struct m0_ha_fvec_handler *hfh);
70 
71 M0_INTERNAL int m0_ha_fvec_handler_add(struct m0_ha_fvec_handler *hfh,
72  const struct m0_fid *pool_fid,
73  struct m0_poolmach *pool_mach,
74  struct m0_chan *chan,
75  struct m0_cookie *cookie);
77 M0_INTERNAL int m0_ha_msg_fvec_send(const struct m0_fid *pool_fid,
78  const struct m0_cookie *req_cookie,
79  struct m0_ha_link *hl,
80  uint32_t type);
81 
83 M0_INTERNAL void m0_ha_fvec_req_handler(struct m0_ha_fvec_handler *hfh,
84  const struct m0_ha_msg *msg,
85  struct m0_ha_link *hl);
86 
88 M0_INTERNAL void m0_ha_fvec_rep_handler(struct m0_ha_fvec_handler *hfh,
89  const struct m0_ha_msg *msg);
90 
92 M0_INTERNAL int m0_ha_failvec_fetch(const struct m0_fid *pool_fid,
93  struct m0_poolmach *pmach,
94  struct m0_chan *chan);
95 
96 #endif /* __MOTR_HA_FAILVEC_H__ */
97 
98 /*
99  * Local variables:
100  * c-indentation-style: "K&R"
101  * c-basic-offset: 8
102  * tab-width: 8
103  * fill-column: 80
104  * scroll-step: 1
105  * End:
106  */
107 /*
108  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
109  */
M0_INTERNAL int m0_ha_fvec_handler_add(struct m0_ha_fvec_handler *hfh, const struct m0_fid *pool_fid, struct m0_poolmach *pool_mach, struct m0_chan *chan, struct m0_cookie *cookie)
Definition: failvec.c:135
M0_INTERNAL void m0_ha_fvec_req_handler(struct m0_ha_fvec_handler *hfh, const struct m0_ha_msg *msg, struct m0_ha_link *hl)
Definition: failvec.c:191
struct m0_mutex hfh_lock
Definition: failvec.h:61
struct m0_tl hfh_fvreq
Definition: failvec.h:60
struct m0_ha_dispatcher * hfh_dispatcher
Definition: failvec.h:63
struct m0_fid mfp_pool
Definition: failvec.h:53
Definition: tlist.h:251
struct m0_cookie mfp_cookie
Definition: failvec.h:54
struct m0_ha_msg_nvec_array mfp_vec
Definition: failvec.h:56
Definition: msg.h:115
struct m0_fid mfq_pool
Definition: failvec.h:48
M0_INTERNAL int m0_ha_msg_fvec_send(const struct m0_fid *pool_fid, const struct m0_cookie *req_cookie, struct m0_ha_link *hl, uint32_t type)
Definition: failvec.c:275
Definition: chan.h:229
struct m0_cookie mfq_cookie
Definition: failvec.h:49
M0_INTERNAL int m0_ha_fvec_handler_init(struct m0_ha_fvec_handler *hfh, struct m0_ha_dispatcher *hd)
Definition: failvec.c:108
static struct m0_chan chan[RDWR_REQUEST_MAX]
Definition: fid.h:38
M0_INTERNAL void m0_ha_fvec_rep_handler(struct m0_ha_fvec_handler *hfh, const struct m0_ha_msg *msg)
Definition: failvec.c:165
M0_INTERNAL void m0_ha_fvec_handler_fini(struct m0_ha_fvec_handler *hfh)
Definition: failvec.c:126
struct m0_ha_handler hfh_handler
Definition: failvec.h:62
int type
Definition: dir.c:1031
M0_INTERNAL int m0_ha_failvec_fetch(const struct m0_fid *pool_fid, struct m0_poolmach *pmach, struct m0_chan *chan)
Definition: failvec.c:208
Definition: mutex.h:47
struct m0_ha_fvec_handler M0_XCA_DOMAIN