__locked_re...a_with_flags(9)
π
__locked_read_sk_user_data_with_flags(9) β the Kernel API Manual, bestie edition π
okay so this is __locked_re...a_with_flags(9) from the Kernel API Manual, and the way I need you to understand it is: this is the picky little reader function. It only hands you the pointer if the flags you asked about are all set in sk_user_data. Otherwise? It gives you NULL and walks away. no notes. π
β¨ NAME β¨
__locked_read_sk_user_data_with_flags β return the pointer only if the argument flags are all set in sk_user_data. Otherwise return NULL. that's it, that's the whole vibe check π«Ά
πΈ SYNOPSIS πΈ
void * __locked_read_sk_user_data_with_flags (const struct sock *sk ,
uintptr_t flags );
like literally just two args, she's low maintenance π
π¦ ARGUMENTS π¦
skβ the socket. the main character, the whole point, the socket in question πflagsβ flag bits. these are the bits she's gonna check againstsk_user_data, and all of them have to be set or you get nothing back β¨
π DESCRIPTION π
okay so the one rule, and it's not optional: the caller must be holding sk->sk_callback_lock. that's it. that's the whole description. no cap, it's short because it means it π
fr fr though, this is not a suggestion β it's a requirement. hold sk->sk_callback_lock before you call this. don't be the person who skips it. π
and remember how the NAME said it: you get the pointer back only if all of the argument flags are set in sk_user_data. otherwise it's NULL o'clock π
π§ SEE ALSO π§
sibling functions and friends of the family, all iconic in their own right π
Kernel file ./include/net/sock.hstruct sock_common(9)struct sock(9)sk_user_data_is_nocopy(9)__rcu_dereference_sk_user_data_with_flags(9)sk_for_each_entry_offset_rcu(9)SOCK_CONNECT_BIND(9)lock_sock_fast(9)unlock_sock_fast(9)sk_wmem_alloc_get(9)sk_rmem_alloc_get(9)sk_has_allocations(9)skwq_has_sleeper(9)sock_poll_wait(9)sk_page_frag(9)_sock_tx_timestamp(9)sk_eat_skb(9)
and that's the page!! π brought to you from ./include/net, dated October 2026, filed under __locked_re...a_with_flags(9) in the Kernel API Manual. mwah, go hold that lock π«Άβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms