Motr
M0
common.h
Go to the documentation of this file.
1
/* -*- C -*- */
2
/*
3
* Copyright (c) 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_ISCSERVICE_UT_COMMON_H__
26
#define __MOTR_ISCSERVICE_UT_COMMON_H__
27
28
#include "
lib/thread.h
"
29
#include "
ut/ut.h
"
30
#include "
ut/misc.h
"
31
enum
{
32
THR_NR
= 5,
33
};
34
35
struct
thr_args
{
36
void
*
ta_data
;
37
struct
m0_semaphore
*
ta_barrier
;
38
int
ta_rc
;
39
};
40
41
struct
cnc_cntrl_block
{
42
struct
m0_thread
ccb_threads
[
THR_NR
];
43
struct
m0_semaphore
ccb_barrier
;
44
struct
thr_args
ccb_args
[
THR_NR
];
45
};
46
47
M0_INTERNAL
void
cc_block_init
(
struct
cnc_cntrl_block
*cc_block,
size_t
size
,
48
void
(*t_data_init)(
void
*,
int
));
49
50
M0_INTERNAL
void
cc_block_launch
(
struct
cnc_cntrl_block
*cc_block,
51
void
(*t_op)(
void
*));
52
53
#endif
54
/*
55
* Local variables:
56
* c-indentation-style: "K&R"
57
* c-basic-offset: 8
58
* tab-width: 8
59
* fill-column: 80
60
* scroll-step: 1
61
* End:
62
*/
ut.h
cnc_cntrl_block::ccb_threads
struct m0_thread ccb_threads[THR_NR]
Definition:
common.h:42
misc.h
m0_semaphore
Definition:
semaphore.h:35
thr_args
Definition:
common.h:35
thr_args::ta_barrier
struct m0_semaphore * ta_barrier
Definition:
common.h:37
thread.h
cc_block_launch
M0_INTERNAL void cc_block_launch(struct cnc_cntrl_block *cc_block, void(*t_op)(void *))
Definition:
common.c:47
m0_thread
Definition:
thread.h:110
thr_args::ta_rc
int ta_rc
Definition:
common.h:38
THR_NR
Definition:
common.h:32
cnc_cntrl_block::ccb_args
struct thr_args ccb_args[THR_NR]
Definition:
common.h:44
cc_block_init
M0_INTERNAL void cc_block_init(struct cnc_cntrl_block *cc_block, size_t size, void(*t_data_init)(void *, int))
Definition:
common.c:29
size
m0_bcount_t size
Definition:
di.c:39
thr_args::ta_data
void * ta_data
Definition:
common.h:36
cnc_cntrl_block
Definition:
common.h:41
cnc_cntrl_block::ccb_barrier
struct m0_semaphore ccb_barrier
Definition:
common.h:43
iscservice
ut
common.h
Generated on Thu Apr 14 2022 14:02:51 for Motr by
1.8.14