From d50a1883bb0e5b106e723607cd640deb4d95a72d Mon Sep 17 00:00:00 2001 From: Dotan Barak Date: Tue, 3 Jul 2012 13:13:22 +0300 Subject: [PATCH] rds: port the code to uek2 Signed-off-by: Dotan Barak Signed-off-by: Saeed Mahameed --- net/rds/af_rds.c | 6 +++--- net/rds/cong.c | 6 +++--- net/rds/connection.c | 1 + net/rds/ib.c | 1 + net/rds/ib_cm.c | 1 + net/rds/ib_send.c | 2 +- net/rds/ib_sysctl.c | 13 ++++--------- net/rds/iw_sysctl.c | 14 ++++---------- net/rds/rdma_transport.c | 2 ++ net/rds/rds.h | 2 +- net/rds/recv.c | 2 +- net/rds/send.c | 2 +- net/rds/sysctl.c | 13 +++---------- net/rds/tcp_listen.c | 6 +++--- net/rds/threads.c | 2 +- 15 files changed, 30 insertions(+), 43 deletions(-) diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 6909969bbcd4..ddbf568da6d4 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -39,7 +39,7 @@ #include #include "rds.h" - +#include "tcp.h" /* UNUSED for backwards compat only */ static unsigned int rds_ib_retry_count = 0xdead; module_param(rds_ib_retry_count, int, 0444); @@ -166,7 +166,7 @@ static unsigned int rds_poll(struct file *file, struct socket *sock, unsigned int mask = 0; unsigned long flags; - poll_wait(file, sk->sk_sleep, wait); + poll_wait(file, sk_sleep(sk), wait); if (rs->rs_seen_congestion) poll_wait(file, &rds_poll_waitq, wait); @@ -489,7 +489,7 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol) return 0; } -static int rds_create(struct net *net, struct socket *sock, int protocol) +static int rds_create(struct net *net, struct socket *sock, int protocol, int kern) { struct sock *sk; diff --git a/net/rds/cong.c b/net/rds/cong.c index 34607ac4da53..0d5456c44a9b 100644 --- a/net/rds/cong.c +++ b/net/rds/cong.c @@ -284,7 +284,7 @@ void rds_cong_set_bit(struct rds_cong_map *map, __be16 port) i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS; off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS; - generic___set_le_bit(off, (void *)map->m_page_addrs[i]); + __set_bit_le(off, (void *)map->m_page_addrs[i]); } void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port) @@ -298,7 +298,7 @@ void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port) i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS; off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS; - generic___clear_le_bit(off, (void *)map->m_page_addrs[i]); + __set_bit_le(off, (void *)map->m_page_addrs[i]); } static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port) @@ -309,7 +309,7 @@ static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port) i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS; off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS; - return generic_test_le_bit(off, (void *)map->m_page_addrs[i]); + return test_bit_le(off, (void *)map->m_page_addrs[i]); } void rds_cong_add_socket(struct rds_sock *rs) diff --git a/net/rds/connection.c b/net/rds/connection.c index a97080e17444..d5d2deb92180 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -36,6 +36,7 @@ #include "rds.h" #include "loop.h" +#include "tcp.h" #define RDS_CONNECTION_HASH_BITS 12 #define RDS_CONNECTION_HASH_ENTRIES (1 << RDS_CONNECTION_HASH_BITS) diff --git a/net/rds/ib.c b/net/rds/ib.c index 72a1ad75ec12..8af05de21c18 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -45,6 +45,7 @@ #include "rds.h" #include "ib.h" +#include "tcp.h" #include unsigned int rds_ib_fmr_1m_pool_size = RDS_FMR_1M_POOL_SIZE; diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 69773f894ce8..bdc64c48b841 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -38,6 +38,7 @@ #include "rds.h" #include "ib.h" +#include "tcp.h" static char *rds_ib_event_type_strings[] = { #define RDS_IB_EVENT_STRING(foo)[IB_EVENT_##foo] = __stringify(foo) diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index a1a568809106..52e497cad5f9 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -37,7 +37,7 @@ #include "rds.h" #include "ib.h" - +#include "tcp.h" /* * Convert IB-specific error message to RDS error message and call core * completion handler. diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c index 36f4b62369d0..2cb2aa1439b8 100644 --- a/net/rds/ib_sysctl.c +++ b/net/rds/ib_sysctl.c @@ -64,7 +64,6 @@ unsigned int rds_ib_sysctl_flow_control = 0; ctl_table rds_ib_sysctl_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "max_send_wr", .data = &rds_ib_sysctl_max_send_wr, .maxlen = sizeof(unsigned long), @@ -74,7 +73,6 @@ ctl_table rds_ib_sysctl_table[] = { .extra2 = &rds_ib_sysctl_max_wr_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_recv_wr", .data = &rds_ib_sysctl_max_recv_wr, .maxlen = sizeof(unsigned long), @@ -84,7 +82,6 @@ ctl_table rds_ib_sysctl_table[] = { .extra2 = &rds_ib_sysctl_max_wr_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_unsignaled_wr", .data = &rds_ib_sysctl_max_unsig_wrs, .maxlen = sizeof(unsigned long), @@ -94,7 +91,6 @@ ctl_table rds_ib_sysctl_table[] = { .extra2 = &rds_ib_sysctl_max_unsig_wr_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_recv_allocation", .data = &rds_ib_sysctl_max_recv_allocation, .maxlen = sizeof(unsigned long), @@ -102,20 +98,19 @@ ctl_table rds_ib_sysctl_table[] = { .proc_handler = &proc_doulongvec_minmax, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "flow_control", .data = &rds_ib_sysctl_flow_control, .maxlen = sizeof(rds_ib_sysctl_flow_control), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0} + { } }; static struct ctl_path rds_ib_sysctl_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, - { .procname = "ib", .ctl_name = CTL_UNNUMBERED, }, + { .procname = "net", }, + { .procname = "rds", }, + { .procname = "ib", }, { } }; diff --git a/net/rds/iw_sysctl.c b/net/rds/iw_sysctl.c index 04f583a05f1d..c5ed1c37a7bb 100644 --- a/net/rds/iw_sysctl.c +++ b/net/rds/iw_sysctl.c @@ -57,7 +57,6 @@ unsigned int rds_iw_sysctl_flow_control = 1; ctl_table rds_iw_sysctl_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "max_send_wr", .data = &rds_iw_sysctl_max_send_wr, .maxlen = sizeof(unsigned long), @@ -67,7 +66,6 @@ ctl_table rds_iw_sysctl_table[] = { .extra2 = &rds_iw_sysctl_max_wr_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_recv_wr", .data = &rds_iw_sysctl_max_recv_wr, .maxlen = sizeof(unsigned long), @@ -77,7 +75,6 @@ ctl_table rds_iw_sysctl_table[] = { .extra2 = &rds_iw_sysctl_max_wr_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_unsignaled_wr", .data = &rds_iw_sysctl_max_unsig_wrs, .maxlen = sizeof(unsigned long), @@ -87,7 +84,6 @@ ctl_table rds_iw_sysctl_table[] = { .extra2 = &rds_iw_sysctl_max_unsig_wr_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_unsignaled_bytes", .data = &rds_iw_sysctl_max_unsig_bytes, .maxlen = sizeof(unsigned long), @@ -97,7 +93,6 @@ ctl_table rds_iw_sysctl_table[] = { .extra2 = &rds_iw_sysctl_max_unsig_bytes_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_recv_allocation", .data = &rds_iw_sysctl_max_recv_allocation, .maxlen = sizeof(unsigned long), @@ -105,20 +100,19 @@ ctl_table rds_iw_sysctl_table[] = { .proc_handler = &proc_doulongvec_minmax, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "flow_control", .data = &rds_iw_sysctl_flow_control, .maxlen = sizeof(rds_iw_sysctl_flow_control), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0} + { } }; static struct ctl_path rds_iw_sysctl_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, - { .procname = "iw", .ctl_name = CTL_UNNUMBERED, }, + { .procname = "net", }, + { .procname = "rds", }, + { .procname = "iw", }, { } }; diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index 8808f35756e9..b070a9cab195 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c @@ -35,6 +35,8 @@ #include "rdma_transport.h" #include "ib.h" #include "net/arp.h" +#include "tcp.h" + #include #include diff --git a/net/rds/rds.h b/net/rds/rds.h index 51834ff83af8..b3ec12a769a4 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -606,7 +606,7 @@ void rds_sock_put(struct rds_sock *rs); void rds_wake_sk_sleep(struct rds_sock *rs); static inline void __rds_wake_sk_sleep(struct sock *sk) { - wait_queue_head_t *waitq = sk->sk_sleep; + wait_queue_head_t *waitq = sk_sleep(sk); if (!sock_flag(sk, SOCK_DEAD) && waitq) wake_up(waitq); diff --git a/net/rds/recv.c b/net/rds/recv.c index 90d9f75fc0f2..e4e7cdd466f7 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c @@ -443,7 +443,7 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, break; } - timeo = wait_event_interruptible_timeout(*sk->sk_sleep, + timeo = wait_event_interruptible_timeout(*sk_sleep(sk), (!list_empty(&rs->rs_notify_queue) || rs->rs_cong_notify || rds_next_incoming(rs, &inc)), diff --git a/net/rds/send.c b/net/rds/send.c index 9334b0a93527..156b686574c0 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1267,7 +1267,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, goto out; } - timeo = wait_event_interruptible_timeout(*sk->sk_sleep, + timeo = wait_event_interruptible_timeout(*sk_sleep(sk), rds_send_queue_rm(rs, conn, rm, rs->rs_bound_port, dport, diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c index 8607f88a8483..0505bda27a45 100644 --- a/net/rds/sysctl.c +++ b/net/rds/sysctl.c @@ -58,7 +58,6 @@ static int rds_sysctl_sol_rds = SOL_RDS; static ctl_table rds_sysctl_rds_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "reconnect_min_delay_ms", .data = &rds_sysctl_reconnect_min_jiffies, .maxlen = sizeof(unsigned long), @@ -68,7 +67,6 @@ static ctl_table rds_sysctl_rds_table[] = { .extra2 = &rds_sysctl_reconnect_max_jiffies, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "reconnect_max_delay_ms", .data = &rds_sysctl_reconnect_max_jiffies, .maxlen = sizeof(unsigned long), @@ -78,7 +76,6 @@ static ctl_table rds_sysctl_rds_table[] = { .extra2 = &rds_sysctl_reconnect_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "pf_rds", .data = &rds_sysctl_pf_rds, .maxlen = sizeof(int), @@ -86,7 +83,6 @@ static ctl_table rds_sysctl_rds_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sol_rds", .data = &rds_sysctl_sol_rds, .maxlen = sizeof(int), @@ -94,7 +90,6 @@ static ctl_table rds_sysctl_rds_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_unacked_packets", .data = &rds_sysctl_max_unacked_packets, .maxlen = sizeof(unsigned long), @@ -102,7 +97,6 @@ static ctl_table rds_sysctl_rds_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max_unacked_bytes", .data = &rds_sysctl_max_unacked_bytes, .maxlen = sizeof(unsigned long), @@ -110,19 +104,18 @@ static ctl_table rds_sysctl_rds_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "ping_enable", .data = &rds_sysctl_ping_enable, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0} + { } }; static struct ctl_path rds_sysctl_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, + { .procname = "net", }, + { .procname = "rds", }, { } }; diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 9a2ae298581a..b61efbd1bf75 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c @@ -67,10 +67,10 @@ static int rds_tcp_accept_one(struct socket *sock) inet = inet_sk(new_sock->sk); rdsdebug("accepted tcp %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n", - NIPQUAD(inet->saddr), ntohs(inet->sport), - NIPQUAD(inet->daddr), ntohs(inet->dport)); + NIPQUAD(inet->inet_saddr), ntohs(inet->inet_sport), + NIPQUAD(inet->inet_daddr), ntohs(inet->inet_dport)); - conn = rds_conn_create(inet->saddr, inet->daddr, &rds_tcp_transport, + conn = rds_conn_create(inet->inet_saddr, inet->inet_daddr, &rds_tcp_transport, 0, GFP_KERNEL); if (IS_ERR(conn)) { ret = PTR_ERR(conn); diff --git a/net/rds/threads.c b/net/rds/threads.c index e32a34099f26..975364addcdc 100644 --- a/net/rds/threads.c +++ b/net/rds/threads.c @@ -34,7 +34,7 @@ #include #include "rds.h" - +#include "tcp.h" static unsigned int rds_conn_hb_timeout = 0; module_param(rds_conn_hb_timeout, int, 0444); MODULE_PARM_DESC(rds_conn_hb_timeout, " Connection heartbeat timeout"); -- 2.50.1