7070 * it's crucial to keep the hop fields near the buckets that they use them so they'll tend to share
7171 * cache lines.
7272 */
73- struct __packed bucket {
73+ struct bucket {
7474 /**
7575 * @first_hop: The biased offset of the first entry in the hop list of the neighborhood
7676 * that hashes to this bucket.
@@ -82,7 +82,7 @@ struct __packed bucket {
8282 u64 key ;
8383 /** @value: The value stored in this bucket (NULL if empty). */
8484 void * value ;
85- };
85+ } __packed ;
8686
8787/**
8888 * struct int_map - The concrete definition of the opaque int_map type.
@@ -310,7 +310,6 @@ static struct bucket *select_bucket(const struct int_map *map, u64 key)
310310/**
311311 * search_hop_list() - Search the hop list associated with given hash bucket for a given search
312312 * key.
313- * @map: The map being searched.
314313 * @bucket: The map bucket to search for the key.
315314 * @key: The mapping key.
316315 * @previous_ptr: Output. if not NULL, a pointer in which to store the bucket in the list preceding
@@ -321,9 +320,7 @@ static struct bucket *select_bucket(const struct int_map *map, u64 key)
321320 *
322321 * Return: An entry that matches the key, or NULL if not found.
323322 */
324- static struct bucket * search_hop_list (struct int_map * map __always_unused ,
325- struct bucket * bucket ,
326- u64 key ,
323+ static struct bucket * search_hop_list (struct bucket * bucket , u64 key ,
327324 struct bucket * * previous_ptr )
328325{
329326 struct bucket * previous = NULL ;
@@ -357,7 +354,7 @@ static struct bucket *search_hop_list(struct int_map *map __always_unused,
357354 */
358355void * vdo_int_map_get (struct int_map * map , u64 key )
359356{
360- struct bucket * match = search_hop_list (map , select_bucket (map , key ), key , NULL );
357+ struct bucket * match = search_hop_list (select_bucket (map , key ), key , NULL );
361358
362359 return ((match != NULL ) ? match -> value : NULL );
363360}
@@ -443,7 +440,6 @@ find_empty_bucket(struct int_map *map, struct bucket *bucket, unsigned int max_p
443440
444441/**
445442 * move_empty_bucket() - Move an empty bucket closer to the start of the bucket array.
446- * @map: The map containing the bucket.
447443 * @hole: The empty bucket to fill with an entry that precedes it in one of its enclosing
448444 * neighborhoods.
449445 *
@@ -454,8 +450,7 @@ find_empty_bucket(struct int_map *map, struct bucket *bucket, unsigned int max_p
454450 * Return: The bucket that was vacated by moving its entry to the provided hole, or NULL if no
455451 * entry could be moved.
456452 */
457- static struct bucket * move_empty_bucket (struct int_map * map __always_unused ,
458- struct bucket * hole )
453+ static struct bucket * move_empty_bucket (struct bucket * hole )
459454{
460455 /*
461456 * Examine every neighborhood that the empty bucket is part of, starting with the one in
@@ -516,7 +511,6 @@ static struct bucket *move_empty_bucket(struct int_map *map __always_unused,
516511/**
517512 * update_mapping() - Find and update any existing mapping for a given key, returning the value
518513 * associated with the key in the provided pointer.
519- * @map: The int_map to attempt to modify.
520514 * @neighborhood: The first bucket in the neighborhood that would contain the search key
521515 * @key: The key with which to associate the new value.
522516 * @new_value: The value to be associated with the key.
@@ -525,10 +519,10 @@ static struct bucket *move_empty_bucket(struct int_map *map __always_unused,
525519 *
526520 * Return: true if the map contains a mapping for the key, false if it does not.
527521 */
528- static bool update_mapping (struct int_map * map , struct bucket * neighborhood ,
529- u64 key , void * new_value , bool update , void * * old_value_ptr )
522+ static bool update_mapping (struct bucket * neighborhood , u64 key , void * new_value ,
523+ bool update , void * * old_value_ptr )
530524{
531- struct bucket * bucket = search_hop_list (map , neighborhood , key , NULL );
525+ struct bucket * bucket = search_hop_list (neighborhood , key , NULL );
532526
533527 if (bucket == NULL ) {
534528 /* There is no bucket containing the key in the neighborhood. */
@@ -584,7 +578,7 @@ static struct bucket *find_or_make_vacancy(struct int_map *map,
584578 * The nearest empty bucket isn't within the neighborhood that must contain the new
585579 * entry, so try to swap it with bucket that is closer.
586580 */
587- hole = move_empty_bucket (map , hole );
581+ hole = move_empty_bucket (hole );
588582 }
589583
590584 return NULL ;
@@ -625,7 +619,7 @@ int vdo_int_map_put(struct int_map *map, u64 key, void *new_value, bool update,
625619 * Check whether the neighborhood already contains an entry for the key, in which case we
626620 * optionally update it, returning the old value.
627621 */
628- if (update_mapping (map , neighborhood , key , new_value , update , old_value_ptr ))
622+ if (update_mapping (neighborhood , key , new_value , update , old_value_ptr ))
629623 return VDO_SUCCESS ;
630624
631625 /*
@@ -679,7 +673,7 @@ void *vdo_int_map_remove(struct int_map *map, u64 key)
679673 /* Select the bucket to search and search it for an existing entry. */
680674 struct bucket * bucket = select_bucket (map , key );
681675 struct bucket * previous ;
682- struct bucket * victim = search_hop_list (map , bucket , key , & previous );
676+ struct bucket * victim = search_hop_list (bucket , key , & previous );
683677
684678 if (victim == NULL ) {
685679 /* There is no matching entry to remove. */
0 commit comments