@@ -164,7 +164,7 @@ static int idx_pool_version_get(struct m0_op_idx *oi)
164164 */
165165static int idx_op_init (struct m0_idx * idx , int opcode ,
166166 struct m0_bufvec * keys , struct m0_bufvec * vals ,
167- int32_t * rcs , uint32_t flags ,
167+ int32_t * rcs , uint32_t min_success , uint32_t flags ,
168168 struct m0_op * op )
169169{
170170 int rc ;
@@ -180,6 +180,7 @@ static int idx_op_init(struct m0_idx *idx, int opcode,
180180
181181 M0_PRE (idx != NULL );
182182 M0_PRE (op != NULL );
183+ M0_PRE (min_success > 0 );
183184
184185 /* Initialise the operation's generic part. */
185186 entity = & idx -> in_entity ;
@@ -205,6 +206,7 @@ static int idx_op_init(struct m0_idx *idx, int opcode,
205206 oi -> oi_keys = keys ;
206207 oi -> oi_vals = vals ;
207208 oi -> oi_rcs = rcs ;
209+ oi -> oi_min_success = min_success ;
208210 oi -> oi_flags = flags ;
209211
210212 locality = m0__locality_pick (oi_instance (oi ));
@@ -557,6 +559,7 @@ int m0_idx_op(struct m0_idx *idx,
557559 struct m0_bufvec * keys ,
558560 struct m0_bufvec * vals ,
559561 int32_t * rcs ,
562+ uint32_t min_success ,
560563 uint32_t flags ,
561564 struct m0_op * * op )
562565{
@@ -579,14 +582,15 @@ int m0_idx_op(struct m0_idx *idx,
579582 keys -> ov_vec .v_count [i ] ==
580583 sizeof (struct m0_uint128 ))));
581584 M0_PRE (op != NULL );
585+ M0_PRE (min_success > 0 );
582586 M0_PRE (ergo (flags == M0_OIF_SYNC_WAIT ,
583587 M0_IN (opcode , (M0_IC_PUT , M0_IC_DEL ))));
584588
585589 rc = m0_op_get (op , sizeof (struct m0_op_idx ));
586590 if (rc == 0 ) {
587591 M0_ASSERT (* op != NULL );
588- rc = idx_op_init (idx , opcode , keys , vals , rcs , flags ,
589- * op );
592+ rc = idx_op_init (idx , opcode , keys , vals , rcs , min_success ,
593+ flags , * op );
590594 }
591595
592596 return M0_RC (rc );
@@ -617,7 +621,7 @@ M0_INTERNAL int m0_idx_op_namei(struct m0_entity *entity,
617621 if (rc == 0 ) {
618622 M0_ASSERT (* op != NULL );
619623 idx = M0_AMB (idx , entity , in_entity );
620- rc = idx_op_init (idx , opcode , NULL , NULL , NULL , 0 ,
624+ rc = idx_op_init (idx , opcode , NULL , NULL , NULL , 1 , 0 ,
621625 * op );
622626 }
623627
0 commit comments