netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2][INET] Move the reqsk_queue_yank_listen_sk from header
@ 2007-11-14 18:11 Pavel Emelyanov
  2007-11-15  0:12 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2007-11-14 18:11 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

This function is used in the net/core/request_sock.c only.
No need in keeping it in the header file.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 0a954ee..e80b53f 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -123,19 +123,6 @@ struct request_sock_queue {
 
 extern int reqsk_queue_alloc(struct request_sock_queue *queue,
 			     unsigned int nr_table_entries);
-
-static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue)
-{
-	struct listen_sock *lopt;
-
-	write_lock_bh(&queue->syn_wait_lock);
-	lopt = queue->listen_opt;
-	queue->listen_opt = NULL;
-	write_unlock_bh(&queue->syn_wait_lock);
-
-	return lopt;
-}
-
 extern void __reqsk_queue_destroy(struct request_sock_queue *queue);
 extern void reqsk_queue_destroy(struct request_sock_queue *queue);
 
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index 12a15f5..16b2ef0 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -71,6 +71,19 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,
 
 EXPORT_SYMBOL(reqsk_queue_alloc);
 
+static struct listen_sock *reqsk_queue_yank_listen_sk(
+		struct request_sock_queue *queue)
+{
+	struct listen_sock *lopt;
+
+	write_lock_bh(&queue->syn_wait_lock);
+	lopt = queue->listen_opt;
+	queue->listen_opt = NULL;
+	write_unlock_bh(&queue->syn_wait_lock);
+
+	return lopt;
+}
+
 void __reqsk_queue_destroy(struct request_sock_queue *queue)
 {
 	struct listen_sock *lopt = reqsk_queue_yank_listen_sk(queue);
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2][INET] Move the reqsk_queue_yank_listen_sk from header
  2007-11-14 18:11 [PATCH 2/2][INET] Move the reqsk_queue_yank_listen_sk from header Pavel Emelyanov
@ 2007-11-15  0:12 ` Simon Horman
  2007-11-15  8:12   ` Pavel Emelyanov
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2007-11-15  0:12 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: David Miller, Linux Netdev List, devel

On Wed, Nov 14, 2007 at 09:11:06PM +0300, Pavel Emelyanov wrote:
> This function is used in the net/core/request_sock.c only.
> No need in keeping it in the header file.

I feel like I am missing something here, but 
doesn't __reqsk_queue_destroy() in include/net/request_sock.h use
reqsk_queue_yank_listen_sk()?

static inline void __reqsk_queue_destroy(struct request_sock_queue
*queue)
{
        kfree(reqsk_queue_yank_listen_sk(queue));
}

> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> ---
> 
> diff --git a/include/net/request_sock.h b/include/net/request_sock.h
> index 0a954ee..e80b53f 100644
> --- a/include/net/request_sock.h
> +++ b/include/net/request_sock.h
> @@ -123,19 +123,6 @@ struct request_sock_queue {
>  
>  extern int reqsk_queue_alloc(struct request_sock_queue *queue,
>  			     unsigned int nr_table_entries);
> -
> -static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue)
> -{
> -	struct listen_sock *lopt;
> -
> -	write_lock_bh(&queue->syn_wait_lock);
> -	lopt = queue->listen_opt;
> -	queue->listen_opt = NULL;
> -	write_unlock_bh(&queue->syn_wait_lock);
> -
> -	return lopt;
> -}
> -
>  extern void __reqsk_queue_destroy(struct request_sock_queue *queue);
>  extern void reqsk_queue_destroy(struct request_sock_queue *queue);
>  
> diff --git a/net/core/request_sock.c b/net/core/request_sock.c
> index 12a15f5..16b2ef0 100644
> --- a/net/core/request_sock.c
> +++ b/net/core/request_sock.c
> @@ -71,6 +71,19 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,
>  
>  EXPORT_SYMBOL(reqsk_queue_alloc);
>  
> +static struct listen_sock *reqsk_queue_yank_listen_sk(
> +		struct request_sock_queue *queue)
> +{
> +	struct listen_sock *lopt;
> +
> +	write_lock_bh(&queue->syn_wait_lock);
> +	lopt = queue->listen_opt;
> +	queue->listen_opt = NULL;
> +	write_unlock_bh(&queue->syn_wait_lock);
> +
> +	return lopt;
> +}
> +
>  void __reqsk_queue_destroy(struct request_sock_queue *queue)
>  {
>  	struct listen_sock *lopt = reqsk_queue_yank_listen_sk(queue);
> -- 
> 1.5.3.4
> 
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Horms, California Edition


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2][INET] Move the reqsk_queue_yank_listen_sk from header
  2007-11-15  0:12 ` Simon Horman
@ 2007-11-15  8:12   ` Pavel Emelyanov
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Emelyanov @ 2007-11-15  8:12 UTC (permalink / raw)
  To: Simon Horman; +Cc: David Miller, Linux Netdev List, devel

Simon Horman wrote:
> On Wed, Nov 14, 2007 at 09:11:06PM +0300, Pavel Emelyanov wrote:
>> This function is used in the net/core/request_sock.c only.
>> No need in keeping it in the header file.
> 
> I feel like I am missing something here, but 
> doesn't __reqsk_queue_destroy() in include/net/request_sock.h use
> reqsk_queue_yank_listen_sk()?

It does, but this is a patch number 2. The patch number 1 moved this
__reqsk_queue_destroy() into request_sock.c.

> static inline void __reqsk_queue_destroy(struct request_sock_queue
> *queue)
> {
>         kfree(reqsk_queue_yank_listen_sk(queue));
> }

Thanks,
Pavel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-15  8:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-14 18:11 [PATCH 2/2][INET] Move the reqsk_queue_yank_listen_sk from header Pavel Emelyanov
2007-11-15  0:12 ` Simon Horman
2007-11-15  8:12   ` Pavel Emelyanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).