diff options
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index c14d88ad348d..a598768c616c 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -588,10 +588,19 @@ void inet_csk_reqsk_queue_prune(struct sock *parent, | |||
588 | } | 588 | } |
589 | EXPORT_SYMBOL_GPL(inet_csk_reqsk_queue_prune); | 589 | EXPORT_SYMBOL_GPL(inet_csk_reqsk_queue_prune); |
590 | 590 | ||
591 | struct sock *inet_csk_clone(struct sock *sk, const struct request_sock *req, | 591 | /** |
592 | const gfp_t priority) | 592 | * inet_csk_clone_lock - clone an inet socket, and lock its clone |
593 | * @sk: the socket to clone | ||
594 | * @req: request_sock | ||
595 | * @priority: for allocation (%GFP_KERNEL, %GFP_ATOMIC, etc) | ||
596 | * | ||
597 | * Caller must unlock socket even in error path (bh_unlock_sock(newsk)) | ||
598 | */ | ||
599 | struct sock *inet_csk_clone_lock(const struct sock *sk, | ||
600 | const struct request_sock *req, | ||
601 | const gfp_t priority) | ||
593 | { | 602 | { |
594 | struct sock *newsk = sk_clone(sk, priority); | 603 | struct sock *newsk = sk_clone_lock(sk, priority); |
595 | 604 | ||
596 | if (newsk != NULL) { | 605 | if (newsk != NULL) { |
597 | struct inet_connection_sock *newicsk = inet_csk(newsk); | 606 | struct inet_connection_sock *newicsk = inet_csk(newsk); |
@@ -615,7 +624,7 @@ struct sock *inet_csk_clone(struct sock *sk, const struct request_sock *req, | |||
615 | } | 624 | } |
616 | return newsk; | 625 | return newsk; |
617 | } | 626 | } |
618 | EXPORT_SYMBOL_GPL(inet_csk_clone); | 627 | EXPORT_SYMBOL_GPL(inet_csk_clone_lock); |
619 | 628 | ||
620 | /* | 629 | /* |
621 | * At this point, there should be no process reference to this | 630 | * At this point, there should be no process reference to this |