Skip to content

Commit d854e4e

Browse files
author
Peter Zijlstra
committed
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) <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6c67f8d commit d854e4e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

kernel/futex/core.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ late_initcall(fail_futex_debugfs);
107107

108108
#endif /* CONFIG_FAIL_FUTEX */
109109

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+
110122
/**
111123
* futex_hash - Return the hash bucket in the global hash
112124
* @key: Pointer to the futex key for which the hash is calculated

kernel/futex/futex.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,18 @@ extern struct futex_hash_bucket *futex_hash(union futex_key *key);
206206
extern void futex_hash_get(struct futex_hash_bucket *hb);
207207
extern void futex_hash_put(struct futex_hash_bucket *hb);
208208

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+
209213
DEFINE_CLASS(hb, struct futex_hash_bucket *,
210214
if (_T) futex_hash_put(_T),
211215
futex_hash(key), union futex_key *key);
212216

217+
DEFINE_CLASS(private_hash, struct futex_private_hash *,
218+
if (_T) futex_private_hash_put(_T),
219+
futex_private_hash(), void);
220+
213221
/**
214222
* futex_match - Check whether two futex keys are equal
215223
* @key1: Pointer to key1

0 commit comments

Comments
 (0)