Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

futex: Create private_hash() get/put class

This gets us:

fph = futex_private_hash(key) /* gets fph and inc users */
futex_private_hash_get(fph) /* inc users */
futex_private_hash_put(fph) /* dec users */

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250416162921.513656-8-bigeasy@linutronix.de

+20
+12
kernel/futex/core.c
··· 107 107 108 108 #endif /* CONFIG_FAIL_FUTEX */ 109 109 110 + struct futex_private_hash *futex_private_hash(void) 111 + { 112 + return NULL; 113 + } 114 + 115 + bool futex_private_hash_get(struct futex_private_hash *fph) 116 + { 117 + return false; 118 + } 119 + 120 + void futex_private_hash_put(struct futex_private_hash *fph) { } 121 + 110 122 /** 111 123 * futex_hash - Return the hash bucket in the global hash 112 124 * @key: Pointer to the futex key for which the hash is calculated
+8
kernel/futex/futex.h
··· 206 206 extern void futex_hash_get(struct futex_hash_bucket *hb); 207 207 extern void futex_hash_put(struct futex_hash_bucket *hb); 208 208 209 + extern struct futex_private_hash *futex_private_hash(void); 210 + extern bool futex_private_hash_get(struct futex_private_hash *fph); 211 + extern void futex_private_hash_put(struct futex_private_hash *fph); 212 + 209 213 DEFINE_CLASS(hb, struct futex_hash_bucket *, 210 214 if (_T) futex_hash_put(_T), 211 215 futex_hash(key), union futex_key *key); 216 + 217 + DEFINE_CLASS(private_hash, struct futex_private_hash *, 218 + if (_T) futex_private_hash_put(_T), 219 + futex_private_hash(), void); 212 220 213 221 /** 214 222 * futex_match - Check whether two futex keys are equal