Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60236fdd authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

[NET] Rename open_request to request_sock



Ok, this one just renames some stuff to have a better namespace and to
dissassociate it from TCP:

struct open_request  -> struct request_sock
tcp_openreq_alloc    -> reqsk_alloc
tcp_openreq_free     -> reqsk_free
tcp_openreq_fastfree -> __reqsk_free

With this most of the infrastructure closely resembles a struct
sock methods subset.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e6599cb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ struct ip_options {
#define optlength(opt) (sizeof(struct ip_options) + opt->optlen)

struct inet_request_sock {
	struct open_request	req;
	struct request_sock	req;
	u32			loc_addr;
	u32			rmt_addr;
	u16			rmt_port;
@@ -123,7 +123,7 @@ struct inet_request_sock {
	struct ip_options	*opt;
};

static inline struct inet_request_sock *inet_rsk(const struct open_request *sk)
static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
{
	return (struct inet_request_sock *)sk;
}
+1 −1
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ struct tcp6_request_sock {
	int			iif;
};

static inline struct tcp6_request_sock *tcp6_rsk(const struct open_request *sk)
static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk)
{
	return (struct tcp6_request_sock *)sk;
}
+3 −3
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ struct tcp_request_sock {
	__u32			 snt_isn;
};

static inline struct tcp_request_sock *tcp_rsk(const struct open_request *req)
static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
{
	return (struct tcp_request_sock *)req;
}
@@ -393,8 +393,8 @@ struct tcp_sock {
	struct tcp_listen_opt	*listen_opt;

	/* FIFO of established children */
	struct open_request	*accept_queue;
	struct open_request	*accept_queue_tail;
	struct request_sock	*accept_queue;
	struct request_sock	*accept_queue_tail;

	unsigned int		keepalive_time;	  /* time before keep alive takes place */
	unsigned int		keepalive_intvl;  /* time interval between keep alive probes */
+17 −17
Original line number Diff line number Diff line
@@ -19,28 +19,28 @@
#include <linux/types.h>
#include <net/sock.h>

struct open_request;
struct request_sock;
struct sk_buff;
struct dst_entry;
struct proto;

struct or_calltable {
struct request_sock_ops {
	int		family;
	kmem_cache_t	*slab;
	int		obj_size;
	int		(*rtx_syn_ack)(struct sock *sk,
				       struct open_request *req,
				       struct request_sock *req,
				       struct dst_entry *dst);
	void		(*send_ack)(struct sk_buff *skb,
				    struct open_request *req);
				    struct request_sock *req);
	void		(*send_reset)(struct sk_buff *skb);
	void		(*destructor)(struct open_request *req);
	void		(*destructor)(struct request_sock *req);
};

/* struct open_request - mini sock to represent a connection request
/* struct request_sock - mini sock to represent a connection request
 */
struct open_request {
	struct open_request		*dl_next; /* Must be first member! */
struct request_sock {
	struct request_sock		*dl_next; /* Must be first member! */
	u16				mss;
	u8				retrans;
	u8				__pad;
@@ -49,29 +49,29 @@ struct open_request {
	u32				rcv_wnd;	  /* rcv_wnd offered first time */
	u32				ts_recent;
	unsigned long			expires;
	struct or_calltable		*class;
	struct request_sock_ops		*rsk_ops;
	struct sock			*sk;
};

static inline struct open_request *tcp_openreq_alloc(struct or_calltable *class)
static inline struct request_sock *reqsk_alloc(struct request_sock_ops *ops)
{
	struct open_request *req = kmem_cache_alloc(class->slab, SLAB_ATOMIC);
	struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC);

	if (req != NULL)
		req->class = class;
		req->rsk_ops = ops;

	return req;
}

static inline void tcp_openreq_fastfree(struct open_request *req)
static inline void __reqsk_free(struct request_sock *req)
{
	kmem_cache_free(req->class->slab, req);
	kmem_cache_free(req->rsk_ops->slab, req);
}

static inline void tcp_openreq_free(struct open_request *req)
static inline void reqsk_free(struct request_sock *req)
{
	req->class->destructor(req);
	tcp_openreq_fastfree(req);
	req->rsk_ops->destructor(req);
	__reqsk_free(req);
}

#endif /* _REQUEST_SOCK_H */
+2 −2
Original line number Diff line number Diff line
@@ -484,7 +484,7 @@ extern void sk_stream_kill_queues(struct sock *sk);

extern int sk_wait_data(struct sock *sk, long *timeo);

struct or_calltable;
struct request_sock_ops;

/* Networking protocol blocks we attach to sockets.
 * socket layer -> transport layer interface
@@ -549,7 +549,7 @@ struct proto {
	kmem_cache_t		*slab;
	unsigned int		obj_size;

	struct or_calltable	*rsk_prot;
	struct request_sock_ops	*rsk_prot;

	struct module		*owner;

Loading