History

futex: Rename hash_futex()

In order to prepare introducing these symbols into the global namespace; rename: s/hash_futex/futex_hash/g

Peter Zijlstra committed 5 years ago

Commit eee5a7b1 parent af92dce1 file · +11 −11Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/futex/core.c+11−11
@@ -279,7 +279,7 @@ struct futex_hash_bucket { · 278 unmodified lines
279 279
280/*280/*
281 * The base of the bucket array and its size are always used together281 * The base of the bucket array and its size are always used together
282 * (after initialization only in hash_futex()), so ensure that they282 * (after initialization only in futex_hash()), so ensure that they
283 * reside in the same cacheline.283 * reside in the same cacheline.
284 */284 */
285static struct {285static struct {
@@ -380,13 +380,13 @@ static inline int hb_waiters_pending(struct futex_hash_bucket *hb) · 94 unmodified lines
380}380}
381 381
382/**382/**
383 * hash_futex - Return the hash bucket in the global hash383 * futex_hash - Return the hash bucket in the global hash
384 * @key: Pointer to the futex key for which the hash is calculated384 * @key: Pointer to the futex key for which the hash is calculated
385 *385 *
386 * We hash on the keys returned from get_futex_key (see below) and return the386 * We hash on the keys returned from get_futex_key (see below) and return the
387 * corresponding hash bucket in the global hash.387 * corresponding hash bucket in the global hash.
388 */388 */
389static struct futex_hash_bucket *hash_futex(union futex_key *key)389static struct futex_hash_bucket *futex_hash(union futex_key *key)
390{390{
391 u32 hash = jhash2((u32 *)key, offsetof(typeof(*key), both.offset) / 4,391 u32 hash = jhash2((u32 *)key, offsetof(typeof(*key), both.offset) / 4,
392 key->both.offset);392 key->both.offset);
@@ -885,7 +885,7 @@ static void exit_pi_state_list(struct task_struct *curr) · 492 unmodified lines
885 next = head->next;885 next = head->next;
886 pi_state = list_entry(next, struct futex_pi_state, list);886 pi_state = list_entry(next, struct futex_pi_state, list);
887 key = pi_state->key;887 key = pi_state->key;
888 hb = hash_futex(&key);888 hb = futex_hash(&key);
889 889
890 /*890 /*
891 * We can race against put_pi_state() removing itself from the891 * We can race against put_pi_state() removing itself from the
@@ -1634,7 +1634,7 @@ int futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) · 742 unmodified lines
1634 if (unlikely(ret != 0))1634 if (unlikely(ret != 0))
1635 return ret;1635 return ret;
1636 1636
1637 hb = hash_futex(&key);1637 hb = futex_hash(&key);
1638 1638
1639 /* Make sure we really have tasks to wakeup */1639 /* Make sure we really have tasks to wakeup */
1640 if (!hb_waiters_pending(hb))1640 if (!hb_waiters_pending(hb))
@@ -1731,8 +1731,8 @@ retry: · 90 unmodified lines
1731 if (unlikely(ret != 0))1731 if (unlikely(ret != 0))
1732 return ret;1732 return ret;
1733 1733
1734 hb1 = hash_futex(&key1);1734 hb1 = futex_hash(&key1);
1735 hb2 = hash_futex(&key2);1735 hb2 = futex_hash(&key2);
1736 1736
1737retry_private:1737retry_private:
1738 double_lock_hb(hb1, hb2);1738 double_lock_hb(hb1, hb2);
@@ -2172,8 +2172,8 @@ retry: · 433 unmodified lines
2172 if (requeue_pi && match_futex(&key1, &key2))2172 if (requeue_pi && match_futex(&key1, &key2))
2173 return -EINVAL;2173 return -EINVAL;
2174 2174
2175 hb1 = hash_futex(&key1);2175 hb1 = futex_hash(&key1);
2176 hb2 = hash_futex(&key2);2176 hb2 = futex_hash(&key2);
2177 2177
2178retry_private:2178retry_private:
2179 hb_waiters_inc(hb2);2179 hb_waiters_inc(hb2);
@@ -2415,7 +2415,7 @@ static inline struct futex_hash_bucket *futex_q_lock(struct futex_q *q) · 235 unmodified lines
2415{2415{
2416 struct futex_hash_bucket *hb;2416 struct futex_hash_bucket *hb;
2417 2417
2418 hb = hash_futex(&q->key);2418 hb = futex_hash(&q->key);
2419 2419
2420 /*2420 /*
2421 * Increment the counter before taking the lock so that2421 * Increment the counter before taking the lock so that
@@ -3177,7 +3177,7 @@ retry: · 755 unmodified lines
3177 if (ret)3177 if (ret)
3178 return ret;3178 return ret;
3179 3179
3180 hb = hash_futex(&key);3180 hb = futex_hash(&key);
3181 spin_lock(&hb->lock);3181 spin_lock(&hb->lock);
3182 3182
3183 /*3183 /*