• Thomas Graf's avatar
    rhashtable: Supports for nulls marker · f89bd6f8
    Thomas Graf authored
    In order to allow for wider usage of rhashtable, use a special nulls
    marker to terminate each chain. The reason for not using the existing
    nulls_list is that the prev pointer usage would not be valid as entries
    can be linked in two different buckets at the same time.
    
    The 4 nulls base bits can be set through the rhashtable_params structure
    like this:
    
    struct rhashtable_params params = {
            [...]
            .nulls_base = (1U << RHT_BASE_SHIFT),
    };
    
    This reduces the hash length from 32 bits to 27 bits.
    Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f89bd6f8
rhashtable.c 26.3 KB