Skip to contentSkip to conversation

Move the reqsk_queue_yank_listen_sk from header

PATCH In review Pavel Emelyanov 2 participants 3 messages Nov 14, 2007 – Nov 15, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Move the reqsk_queue_yank_listen_sk from header

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

---

include/net/request_sock.h +0 -13
index 0a954ee..e80b53f 100644
@@ -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);
 
net/core/request_sock.c +13 -0
index 12a15f5..16b2ef0 100644
@@ -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);
Signature · 1 line
1.5.3.4
#1 lore raw
Quoted 2 lines · Pavel Emelyanov

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));
}
Quoted 60 lines

---

include/net/request_sock.h +0 -13
index 0a954ee..e80b53f 100644
@@ -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);
 
net/core/request_sock.c +13 -0
index 12a15f5..16b2ef0 100644
@@ -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);
Signature · 6 lines
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Horms, California Edition
#2 lore raw
Quoted 7 lines · Simon Horman
Quoted 2 lines · Pavel Emelyanov

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.

Quoted 5 lines

static inline void __reqsk_queue_destroy(struct request_sock_queue *queue)

{
        kfree(reqsk_queue_yank_listen_sk(queue));
}

Thanks,
Pavel