ANDROID: fix ABI by undoing atomic64_t -> u64 type conversion

This is pretty much a no-op, but avoids changing struct net ABI.

Bug: 274789652
Test: builds, net_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia744bdf0a026adccaef8382aaecc771a8d0763a6
This commit is contained in:
Maciej Żenczykowski
2023-03-22 16:13:37 -07:00
committed by Todd Kjos
parent cda90416c0
commit 05fa7d8eee
4 changed files with 4 additions and 4 deletions

View File

@@ -171,7 +171,7 @@ struct net {
struct netns_xfrm xfrm;
#endif
u64 net_cookie; /* written once */
atomic64_t net_cookie; /* written once */
#if IS_ENABLED(CONFIG_IP_VS)
struct netns_ipvs *ipvs;

View File

@@ -4638,7 +4638,7 @@ static u64 __bpf_get_netns_cookie(struct sock *sk)
{
const struct net *net = sk ? sock_net(sk) : &init_net;
return net->net_cookie;
return atomic64_read(&net->net_cookie);
}
BPF_CALL_1(bpf_get_netns_cookie_sock, struct sock *, ctx)

View File

@@ -330,7 +330,7 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)
refcount_set(&net->passive, 1);
get_random_bytes(&net->hash_mix, sizeof(u32));
preempt_disable();
net->net_cookie = gen_cookie_next(&net_cookie);
atomic64_set(&net->net_cookie, gen_cookie_next(&net_cookie));
preempt_enable();
net->dev_base_seq = 1;
net->user_ns = user_ns;

View File

@@ -1617,7 +1617,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
lv = sizeof(u64);
if (len != lv)
return -EINVAL;
v.val64 = sock_net(sk)->net_cookie;
v.val64 = atomic64_read(&sock_net(sk)->net_cookie);
break;
default: