Motr  M0
msg_queue.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 #pragma once
24 
25 #ifndef __MOTR_HA_MSG_QUEUE_H__
26 #define __MOTR_HA_MSG_QUEUE_H__
27 
39 #include "lib/types.h" /* uint64_t */
40 #include "lib/tlist.h" /* m0_tlink */
41 #include "ha/msg.h" /* m0_ha_msg */
42 
46 };
47 
54  uint64_t hmq_magic;
55 };
56 
58  int unused;
59 };
60 
63  struct m0_tl mq_queue;
64 };
65 
66 M0_INTERNAL void m0_ha_msg_queue_init(struct m0_ha_msg_queue *mq,
67  struct m0_ha_msg_queue_cfg *cfg);
68 M0_INTERNAL void m0_ha_msg_queue_fini(struct m0_ha_msg_queue *mq);
69 M0_INTERNAL struct m0_ha_msg_qitem *
71 M0_INTERNAL void m0_ha_msg_queue_free(struct m0_ha_msg_queue *mq,
72  struct m0_ha_msg_qitem *qitem);
73 M0_INTERNAL void m0_ha_msg_queue_enqueue(struct m0_ha_msg_queue *mq,
74  struct m0_ha_msg_qitem *qitem);
75 M0_INTERNAL struct m0_ha_msg_qitem *
77 M0_INTERNAL void m0_ha_msg_queue_push_front(struct m0_ha_msg_queue *mq,
78  struct m0_ha_msg_qitem *qitem);
79 M0_INTERNAL bool m0_ha_msg_queue_is_empty(struct m0_ha_msg_queue *mq);
80 M0_INTERNAL struct m0_ha_msg_qitem *
82  uint64_t tag);
83 M0_INTERNAL struct m0_ha_msg_qitem *
85  const struct m0_ha_msg_qitem *cur);
86 M0_INTERNAL struct m0_ha_msg_qitem *
88  const struct m0_ha_msg_qitem *cur);
89 
90 
92 #endif /* __MOTR_HA_MSG_QUEUE_H__ */
93 
94 /*
95  * Local variables:
96  * c-indentation-style: "K&R"
97  * c-basic-offset: 8
98  * tab-width: 8
99  * fill-column: 80
100  * scroll-step: 1
101  * End:
102  */
103 /*
104  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
105  */
struct m0_ha_msg_queue_cfg mq_cfg
Definition: msg_queue.h:62
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
Definition: addb2.c:791
m0_ha_msg_qitem_delivery_state
Definition: msg_queue.h:43
static uint64_t tag(uint8_t code, uint64_t id)
Definition: addb2.c:1047
M0_INTERNAL struct m0_ha_msg_qitem * m0_ha_msg_queue_dequeue(struct m0_ha_msg_queue *mq)
Definition: msg_queue.c:75
struct m0_tl mq_queue
Definition: msg_queue.h:63
uint64_t hmq_magic
Definition: msg_queue.h:54
M0_INTERNAL void m0_ha_msg_queue_enqueue(struct m0_ha_msg_queue *mq, struct m0_ha_msg_qitem *qitem)
Definition: msg_queue.c:68
M0_INTERNAL struct m0_ha_msg_qitem * m0_ha_msg_queue_find(struct m0_ha_msg_queue *mq, uint64_t tag)
Definition: msg_queue.c:97
M0_INTERNAL void m0_ha_msg_queue_fini(struct m0_ha_msg_queue *mq)
Definition: msg_queue.c:48
M0_INTERNAL void m0_ha_msg_queue_free(struct m0_ha_msg_queue *mq, struct m0_ha_msg_qitem *qitem)
Definition: msg_queue.c:62
Definition: tlist.h:251
M0_INTERNAL struct m0_ha_msg_qitem * m0_ha_msg_queue_alloc(struct m0_ha_msg_queue *mq)
Definition: msg_queue.c:54
Definition: msg.h:115
M0_INTERNAL bool m0_ha_msg_queue_is_empty(struct m0_ha_msg_queue *mq)
Definition: msg_queue.c:91
M0_INTERNAL struct m0_ha_msg_qitem * m0_ha_msg_queue_next(struct m0_ha_msg_queue *mq, const struct m0_ha_msg_qitem *cur)
Definition: msg_queue.c:105
M0_INTERNAL struct m0_ha_msg_qitem * m0_ha_msg_queue_prev(struct m0_ha_msg_queue *mq, const struct m0_ha_msg_qitem *cur)
Definition: msg_queue.c:113
enum m0_ha_msg_qitem_delivery_state hmq_delivery_state
Definition: msg_queue.h:51
struct m0_tlink hmq_link
Definition: msg_queue.h:53
M0_INTERNAL void m0_ha_msg_queue_init(struct m0_ha_msg_queue *mq, struct m0_ha_msg_queue_cfg *cfg)
Definition: msg_queue.c:42
M0_INTERNAL void m0_ha_msg_queue_push_front(struct m0_ha_msg_queue *mq, struct m0_ha_msg_qitem *qitem)
Definition: msg_queue.c:85
struct m0_ha_msg hmq_msg
Definition: msg_queue.h:50