lib/ccmap.c
/* Decrements the count associated with 'hash'.  The caller must
 * ensure that 'ccmap' cannot change concurrently (from another thread).
 *
 * Returns the current count related to 'hash' in the ccmap after the
 * decrement. */
Decrements the count associated with 'hash'.  The caller must
ensure that 'ccmap' cannot change concurrently (from another thread).

Returns the current count related to 'hash' in the ccmap after the
decrement.
Decrements the count associated with ' hash ' . The caller must ensure that ' ccmap ' cannot change concurrently ( from another thread ) . Returns the current count related to ' hash ' in the ccmap after the decrement .
uint32_t
ccmap_dec(struct ccmap *ccmap, uint32_t hash)
{
    struct ccmap_impl *impl = ccmap_get_impl(ccmap);
    uint32_t h1 = rehash(impl, hash);
    uint32_t h2 = other_hash(h1);
    uint32_t old_count = ccmap_dec__(impl, hash, h1);
    if (!old_count) {
        old_count = ccmap_dec__(impl, hash, h2);
    }
    ovs_assert(old_count);
    old_count--;
    if (old_count == 0) {
        impl->n_unique--;
        if (OVS_UNLIKELY(impl->n_unique < impl->min_n)) {
            COVERAGE_INC(ccmap_shrink);
            impl = ccmap_rehash(ccmap, impl->mask >> 1);
        }
    }
    impl->n--;
    return old_count;
}
uint32_t ccmap_dec ( struct ccmap * ccmap , uint32_t hash ) { struct ccmap_impl * impl = ccmap_get_impl ( ccmap ) ; uint32_t h1 = rehash ( impl , hash ) ; uint32_t h2 = other_hash ( h1 ) ; uint32_t old_count = ccmap_dec__ ( impl , hash , h1 ) ; if ( ! old_count ) { old_count = ccmap_dec__ ( impl , hash , h2 ) ; } ovs_assert ( old_count ) ; old_count -- ; if ( old_count == 0 ) { impl -> n_unique -- ; if ( OVS_UNLIKELY ( impl -> n_unique < impl -> min_n ) ) { COVERAGE_INC ( ccmap_shrink ) ; impl = ccmap_rehash ( ccmap , impl -> mask >> 1 ) ; } } impl -> n -- ; return old_count ; }
Decrements the count associated with 'hash'.
Decrements the count associated with ' hash ' .