Motr  M0
ag.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-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_SNS_CM_REPAIR_AG_H__
26 #define __MOTR_SNS_CM_REPAIR_AG_H__
27 
28 
29 #include "sns/cm/ag.h"
30 #include "pool/pool_machine.h"
31 
46 
48  uint32_t fc_failed_idx;
49 
54  uint32_t fc_tgt_idx;
55 
56  /*
57  * cob fid containing the target unit for the aggregation
58  * group.
59  */
61 
63  uint64_t fc_tgt_cob_index;
64 
70 
73 };
74 
78 
83  uint32_t rag_acc_freed;
84 
86  uint32_t rag_acc_inuse_nr;
87 
94 
97 
99  struct m0_sns_ir rag_ir;
100 };
101 
102 
112 M0_INTERNAL int m0_sns_cm_repair_ag_alloc(struct m0_cm *cm,
113  const struct m0_cm_ag_id *id,
114  bool has_incoming,
115  struct m0_cm_aggr_group **out);
116 
117 /*
118  * Configures accumulator copy packet, acquires buffer for accumulator copy
119  * packet.
120  * Increments struct m0_cm_aggr_group::cag_cp_local_nr for newly created
121  * accumulator copy packets, so that aggregation group is not finalised before
122  * the finalisation of accumulator copy packets.
123  *
124  * @see m0_sns_cm_acc_cp_setup()
125  */
126 M0_INTERNAL int m0_sns_cm_repair_ag_setup(struct m0_sns_cm_ag *ag,
127  struct m0_pdclust_layout *pl);
128 
134 M0_INTERNAL bool m0_sns_cm_ag_acc_is_full_with(const struct m0_cm_cp *acc,
135  uint64_t nr_cps);
136 
140 M0_INTERNAL int64_t m0_sns_cm_repair_ag_inbufs(struct m0_sns_cm *scm,
141  struct m0_sns_cm_file_ctx *fctx,
142  const struct m0_cm_ag_id *id);
143 
144 M0_INTERNAL struct m0_sns_cm_repair_ag *
145 sag2repairag(const struct m0_sns_cm_ag *sag);
146 
149 #endif /* __MOTR_SNS_CM_REPAIR_AG_H__ */
150 
151 /*
152  * Local variables:
153  * c-indentation-style: "K&R"
154  * c-basic-offset: 8
155  * tab-width: 8
156  * fill-column: 80
157  * scroll-step: 1
158  * End:
159  */
Definition: cm.h:205
M0_INTERNAL int m0_sns_cm_repair_ag_setup(struct m0_sns_cm_ag *sag, struct m0_pdclust_layout *pl)
Definition: ag.c:525
struct m0_parity_math rag_math
Definition: ag.h:96
Definition: cp.h:160
uint32_t rag_acc_inuse_nr
Definition: ag.h:86
static struct m0_sns_cm * scm
Definition: cm.c:64
static struct m0_cm * cm
Definition: cm.c:63
static struct m0_sns_cm_ag * sag
Definition: cm.c:66
struct m0_sns_cm_ag rag_base
Definition: ag.h:77
struct m0_sns_ir rag_ir
Definition: ag.h:99
struct m0_fid fc_tgt_cobfid
Definition: ag.h:60
M0_INTERNAL int m0_sns_cm_repair_ag_alloc(struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, struct m0_cm_aggr_group **out)
Definition: ag.c:453
struct m0_sns_cm_cp fc_tgt_acc_cp
Definition: ag.h:45
M0_INTERNAL bool m0_sns_cm_ag_acc_is_full_with(const struct m0_cm_cp *acc, uint64_t nr_cps)
Definition: ag.c:562
struct m0_sns_cm_repair_ag_failure_ctx * rag_fc
Definition: ag.h:93
Definition: fid.h:38
M0_INTERNAL int64_t m0_sns_cm_repair_ag_inbufs(struct m0_sns_cm *scm, struct m0_sns_cm_file_ctx *fctx, const struct m0_cm_ag_id *id)
Definition: ag.c:66
Definition: cm.h:166
uint32_t rag_acc_freed
Definition: ag.h:83
static struct m0_sns_cm_file_ctx fctx
Definition: net.c:55
#define out(...)
Definition: gen.c:41
M0_INTERNAL struct m0_sns_cm_repair_ag * sag2repairag(const struct m0_sns_cm_ag *sag)
Definition: ag.c:61
Definition: ag.h:49