kernel/include/linux/rhashtable.h
/**
 * rhashtable_replace_fast - replace an object in hash table
 * @ht:		hash table
 * @obj_old:	pointer to hash head inside object being replaced
 * @obj_new:	pointer to hash head inside object which is new
 * @params:	hash table parameters
 *
 * Replacing an object doesn't affect the number of elements in the hash table
 * or bucket, so we don't need to worry about shrinking or expanding the
 * table here.
 *
 * Returns zero on success, -ENOENT if the entry could not be found,
 * -EINVAL if hash is not the same for the old and new objects.
 */
replace an object in hash table
@ht:         hash table
@obj_old:    pointer to hash head inside object being replaced
@obj_new:    pointer to hash head inside object which is new
@params:     hash table parameters

Replacing an object doesn't affect the number of elements in the hash table
or bucket, so we don't need to worry about shrinking or expanding the
table here.

Returns zero on success, -ENOENT if the entry could not be found,
-EINVAL if hash is not the same for the old and new objects.
replace an object in hash table @ht : hash table @obj_old : pointer to hash head inside object being replaced @obj_new : pointer to hash head inside object which is new @params : hash table parameters Replacing an object doesn ' t affect the number of elements in the hash table or bucket so we don ' t need to worry about shrinking or expanding the table here . Returns zero on success - ENOENT if the entry could not be found - EINVAL if hash is not the same for the old and new objects .
static inline int rhashtable_replace_fast(
	struct rhashtable *ht, struct rhash_head *obj_old,
	struct rhash_head *obj_new,
	const struct rhashtable_params params)
{
	struct bucket_table *tbl;
	int err;
	rcu_read_lock();
	tbl = rht_dereference_rcu(ht->tbl, ht);
	while ((err = __rhashtable_replace_fast(ht, tbl, obj_old,
						obj_new, params)) &&
	       (tbl = rht_dereference_rcu(tbl->future_tbl, ht)))
		;
	rcu_read_unlock();
	return err;
}
static inline int rhashtable_replace_fast ( struct rhashtable * ht , struct rhash_head * obj_old , struct rhash_head * obj_new , const struct rhashtable_params params ) { struct bucket_table * tbl ; int err ; rcu_read_lock ( ) ; tbl = rht_dereference_rcu ( ht -> tbl , ht ) ; while ( ( err = __rhashtable_replace_fast ( ht , tbl , obj_old , obj_new , params ) ) && ( tbl = rht_dereference_rcu ( tbl -> future_tbl , ht ) ) ) ; rcu_read_unlock ( ) ; return err ; }
rhashtable_replace_fast - replace an object in hash table
 @ht:         hash table
 @obj_old:    pointer to hash head inside object being replaced
 @obj_new:    pointer to hash head inside object which is new
 @params:     hash table parameters
rhashtable_replace_fast - replace an object in hash table @ht : hash table @obj_old : pointer to hash head inside object being replaced @obj_new : pointer to hash head inside object which is new @params : hash table parameters
/* Because we have already taken (and released) the bucket
	 * lock in old_tbl, if we find that future_tbl is not yet
	 * visible then that guarantees the entry to still be in
	 * the old tbl if it exists.
	 */