Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73871
b: refs/heads/master
c: dab6ba3
h: refs/heads/master
i:
  73869: 3375089
  73867: 830d203
  73863: cc18ef7
  73855: f80fbff
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 15, 2007
1 parent 0a389ee commit fb6fa4a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd7b3f34198071d8bec05180530c362f1800ba46
refs/heads/master: dab6ba36888a12f3e3edff71eeef968fc159178a
18 changes: 1 addition & 17 deletions trunk/include/net/request_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,7 @@ 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;
}

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

extern void __reqsk_queue_destroy(struct request_sock_queue *queue);
extern void reqsk_queue_destroy(struct request_sock_queue *queue);

static inline struct request_sock *
Expand Down
35 changes: 35 additions & 0 deletions trunk/net/core/request_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,41 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,

EXPORT_SYMBOL(reqsk_queue_alloc);

void __reqsk_queue_destroy(struct request_sock_queue *queue)
{
struct listen_sock *lopt;
size_t lopt_size;

/*
* this is an error recovery path only
* no locking needed and the lopt is not NULL
*/

lopt = queue->listen_opt;
lopt_size = sizeof(struct listen_sock) +
lopt->nr_table_entries * sizeof(struct request_sock *);

if (lopt_size > PAGE_SIZE)
vfree(lopt);
else
kfree(lopt);
}

EXPORT_SYMBOL(__reqsk_queue_destroy);

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;
}

void reqsk_queue_destroy(struct request_sock_queue *queue)
{
/* make all the listen_opt local to us */
Expand Down

0 comments on commit fb6fa4a

Please sign in to comment.