Lines Matching refs:newsk

2375 	struct sock *newsk;  in sk_clone_lock()  local
2377 newsk = sk_prot_alloc(prot, priority, sk->sk_family); in sk_clone_lock()
2378 if (!newsk) in sk_clone_lock()
2381 sock_copy(newsk, sk); in sk_clone_lock()
2383 newsk->sk_prot_creator = prot; in sk_clone_lock()
2386 if (likely(newsk->sk_net_refcnt)) { in sk_clone_lock()
2387 get_net_track(sock_net(newsk), &newsk->ns_tracker, priority); in sk_clone_lock()
2388 sock_inuse_add(sock_net(newsk), 1); in sk_clone_lock()
2395 __netns_tracker_alloc(sock_net(newsk), &newsk->ns_tracker, in sk_clone_lock()
2398 sk_node_init(&newsk->sk_node); in sk_clone_lock()
2399 sock_lock_init(newsk); in sk_clone_lock()
2400 bh_lock_sock(newsk); in sk_clone_lock()
2401 newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL; in sk_clone_lock()
2402 newsk->sk_backlog.len = 0; in sk_clone_lock()
2404 atomic_set(&newsk->sk_rmem_alloc, 0); in sk_clone_lock()
2407 refcount_set(&newsk->sk_wmem_alloc, 1); in sk_clone_lock()
2409 atomic_set(&newsk->sk_omem_alloc, 0); in sk_clone_lock()
2410 sk_init_common(newsk); in sk_clone_lock()
2412 newsk->sk_dst_cache = NULL; in sk_clone_lock()
2413 newsk->sk_dst_pending_confirm = 0; in sk_clone_lock()
2414 newsk->sk_wmem_queued = 0; in sk_clone_lock()
2415 newsk->sk_forward_alloc = 0; in sk_clone_lock()
2416 newsk->sk_reserved_mem = 0; in sk_clone_lock()
2417 atomic_set(&newsk->sk_drops, 0); in sk_clone_lock()
2418 newsk->sk_send_head = NULL; in sk_clone_lock()
2419 newsk->sk_userlocks = sk->sk_userlocks & ~SOCK_BINDPORT_LOCK; in sk_clone_lock()
2420 atomic_set(&newsk->sk_zckey, 0); in sk_clone_lock()
2422 sock_reset_flag(newsk, SOCK_DONE); in sk_clone_lock()
2425 newsk->sk_memcg = NULL; in sk_clone_lock()
2427 cgroup_sk_clone(&newsk->sk_cgrp_data); in sk_clone_lock()
2436 is_charged = sk_filter_charge(newsk, filter); in sk_clone_lock()
2437 RCU_INIT_POINTER(newsk->sk_filter, filter); in sk_clone_lock()
2440 if (unlikely(!is_charged || xfrm_sk_clone_policy(newsk, sk))) { in sk_clone_lock()
2446 RCU_INIT_POINTER(newsk->sk_filter, NULL); in sk_clone_lock()
2447 sk_free_unlock_clone(newsk); in sk_clone_lock()
2448 newsk = NULL; in sk_clone_lock()
2451 RCU_INIT_POINTER(newsk->sk_reuseport_cb, NULL); in sk_clone_lock()
2453 if (bpf_sk_storage_clone(sk, newsk)) { in sk_clone_lock()
2454 sk_free_unlock_clone(newsk); in sk_clone_lock()
2455 newsk = NULL; in sk_clone_lock()
2462 if (sk_user_data_is_nocopy(newsk)) in sk_clone_lock()
2463 newsk->sk_user_data = NULL; in sk_clone_lock()
2465 newsk->sk_err = 0; in sk_clone_lock()
2466 newsk->sk_err_soft = 0; in sk_clone_lock()
2467 newsk->sk_priority = 0; in sk_clone_lock()
2468 newsk->sk_incoming_cpu = raw_smp_processor_id(); in sk_clone_lock()
2474 refcount_set(&newsk->sk_refcnt, 2); in sk_clone_lock()
2476 sk_set_socket(newsk, NULL); in sk_clone_lock()
2477 sk_tx_queue_clear(newsk); in sk_clone_lock()
2478 RCU_INIT_POINTER(newsk->sk_wq, NULL); in sk_clone_lock()
2480 if (newsk->sk_prot->sockets_allocated) in sk_clone_lock()
2481 sk_sockets_allocated_inc(newsk); in sk_clone_lock()
2483 if (sock_needs_netstamp(sk) && newsk->sk_flags & SK_FLAGS_TIMESTAMP) in sk_clone_lock()
2486 return newsk; in sk_clone_lock()