Lines Matching refs:newsk
1398 static void sk_update_clone(const struct sock *sk, struct sock *newsk) in sk_update_clone() argument
1401 sock_update_memcg(newsk); in sk_update_clone()
1413 struct sock *newsk; in sk_clone_lock() local
1415 newsk = sk_prot_alloc(sk->sk_prot, priority, sk->sk_family); in sk_clone_lock()
1416 if (newsk != NULL) { in sk_clone_lock()
1419 sock_copy(newsk, sk); in sk_clone_lock()
1422 get_net(sock_net(newsk)); in sk_clone_lock()
1423 sk_node_init(&newsk->sk_node); in sk_clone_lock()
1424 sock_lock_init(newsk); in sk_clone_lock()
1425 bh_lock_sock(newsk); in sk_clone_lock()
1426 newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL; in sk_clone_lock()
1427 newsk->sk_backlog.len = 0; in sk_clone_lock()
1429 atomic_set(&newsk->sk_rmem_alloc, 0); in sk_clone_lock()
1433 atomic_set(&newsk->sk_wmem_alloc, 1); in sk_clone_lock()
1434 atomic_set(&newsk->sk_omem_alloc, 0); in sk_clone_lock()
1435 skb_queue_head_init(&newsk->sk_receive_queue); in sk_clone_lock()
1436 skb_queue_head_init(&newsk->sk_write_queue); in sk_clone_lock()
1438 skb_queue_head_init(&newsk->sk_async_wait_queue); in sk_clone_lock()
1441 spin_lock_init(&newsk->sk_dst_lock); in sk_clone_lock()
1442 rwlock_init(&newsk->sk_callback_lock); in sk_clone_lock()
1443 lockdep_set_class_and_name(&newsk->sk_callback_lock, in sk_clone_lock()
1444 af_callback_keys + newsk->sk_family, in sk_clone_lock()
1445 af_family_clock_key_strings[newsk->sk_family]); in sk_clone_lock()
1447 newsk->sk_dst_cache = NULL; in sk_clone_lock()
1448 newsk->sk_wmem_queued = 0; in sk_clone_lock()
1449 newsk->sk_forward_alloc = 0; in sk_clone_lock()
1450 newsk->sk_send_head = NULL; in sk_clone_lock()
1451 newsk->sk_userlocks = sk->sk_userlocks & ~SOCK_BINDPORT_LOCK; in sk_clone_lock()
1453 sock_reset_flag(newsk, SOCK_DONE); in sk_clone_lock()
1454 skb_queue_head_init(&newsk->sk_error_queue); in sk_clone_lock()
1456 filter = rcu_dereference_protected(newsk->sk_filter, 1); in sk_clone_lock()
1458 sk_filter_charge(newsk, filter); in sk_clone_lock()
1460 if (unlikely(xfrm_sk_clone_policy(newsk))) { in sk_clone_lock()
1463 newsk->sk_destruct = NULL; in sk_clone_lock()
1464 bh_unlock_sock(newsk); in sk_clone_lock()
1465 sk_free(newsk); in sk_clone_lock()
1466 newsk = NULL; in sk_clone_lock()
1470 newsk->sk_err = 0; in sk_clone_lock()
1471 newsk->sk_priority = 0; in sk_clone_lock()
1477 atomic_set(&newsk->sk_refcnt, 2); in sk_clone_lock()
1490 sk_refcnt_debug_inc(newsk); in sk_clone_lock()
1491 sk_set_socket(newsk, NULL); in sk_clone_lock()
1492 newsk->sk_wq = NULL; in sk_clone_lock()
1494 sk_update_clone(sk, newsk); in sk_clone_lock()
1496 if (newsk->sk_prot->sockets_allocated) in sk_clone_lock()
1497 sk_sockets_allocated_inc(newsk); in sk_clone_lock()
1499 if (newsk->sk_flags & SK_FLAGS_TIMESTAMP) in sk_clone_lock()
1503 return newsk; in sk_clone_lock()