@@ -397,7 +397,7 @@ static int resize_buckets(struct int_map *map)
397
397
continue ;
398
398
399
399
result = vdo_int_map_put (map , entry -> key , entry -> value , true, NULL );
400
- if (result != UDS_SUCCESS ) {
400
+ if (result != VDO_SUCCESS ) {
401
401
/* Destroy the new partial map and restore the map from the stack. */
402
402
vdo_free (vdo_forget (map -> buckets ));
403
403
* map = old_map ;
@@ -525,12 +525,8 @@ static struct bucket *move_empty_bucket(struct int_map *map __always_unused,
525
525
*
526
526
* Return: true if the map contains a mapping for the key, false if it does not.
527
527
*/
528
- static bool update_mapping (struct int_map * map ,
529
- struct bucket * neighborhood ,
530
- u64 key ,
531
- void * new_value ,
532
- bool update ,
533
- void * * old_value_ptr )
528
+ static bool update_mapping (struct int_map * map , struct bucket * neighborhood ,
529
+ u64 key , void * new_value , bool update , void * * old_value_ptr )
534
530
{
535
531
struct bucket * bucket = search_hop_list (map , neighborhood , key , NULL );
536
532
@@ -609,15 +605,15 @@ static struct bucket *find_or_make_vacancy(struct int_map *map,
609
605
* update is true. In either case the old value is returned. If the map does not already contain a
610
606
* value for the specified key, the new value is added regardless of the value of update.
611
607
*
612
- * Return: UDS_SUCCESS or an error code.
608
+ * Return: VDO_SUCCESS or an error code.
613
609
*/
614
610
int vdo_int_map_put (struct int_map * map , u64 key , void * new_value , bool update ,
615
611
void * * old_value_ptr )
616
612
{
617
613
struct bucket * neighborhood , * bucket ;
618
614
619
- if (new_value == NULL )
620
- return UDS_INVALID_ARGUMENT ;
615
+ if (unlikely ( new_value == NULL ) )
616
+ return - EINVAL ;
621
617
622
618
/*
623
619
* Select the bucket at the start of the neighborhood that must contain any entry for the
@@ -630,7 +626,7 @@ int vdo_int_map_put(struct int_map *map, u64 key, void *new_value, bool update,
630
626
* optionally update it, returning the old value.
631
627
*/
632
628
if (update_mapping (map , neighborhood , key , new_value , update , old_value_ptr ))
633
- return UDS_SUCCESS ;
629
+ return VDO_SUCCESS ;
634
630
635
631
/*
636
632
* Find an empty bucket in the desired neighborhood for the new entry or re-arrange entries
@@ -666,7 +662,7 @@ int vdo_int_map_put(struct int_map *map, u64 key, void *new_value, bool update,
666
662
/* There was no existing entry, so there was no old value to be returned. */
667
663
if (old_value_ptr != NULL )
668
664
* old_value_ptr = NULL ;
669
- return UDS_SUCCESS ;
665
+ return VDO_SUCCESS ;
670
666
}
671
667
672
668
/**
0 commit comments