Commit cb0a6056 authored by Manuel Zerpies's avatar Manuel Zerpies Committed by David S. Miller

net/rds: use prink_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()
Signed-off-by: default avatarManuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: default avatarDavid S. Miller <davem@conan.davemloft.net>
parent d751e623
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/in.h> #include <linux/in.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/jhash.h> #include <linux/jhash.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
#define BIND_HASH_SIZE 1024 #define BIND_HASH_SIZE 1024
...@@ -185,8 +186,7 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -185,8 +186,7 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (!trans) { if (!trans) {
ret = -EADDRNOTAVAIL; ret = -EADDRNOTAVAIL;
rds_remove_bound(rs); rds_remove_bound(rs);
if (printk_ratelimit()) printk_ratelimited(KERN_INFO "RDS: rds_bind() could not find a transport, "
printk(KERN_INFO "RDS: rds_bind() could not find a transport, "
"load rds_tcp or rds_rdma?\n"); "load rds_tcp or rds_rdma?\n");
goto out; goto out;
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/in.h> #include <linux/in.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
#include "ib.h" #include "ib.h"
...@@ -435,13 +436,12 @@ static u32 rds_ib_protocol_compatible(struct rdma_cm_event *event) ...@@ -435,13 +436,12 @@ static u32 rds_ib_protocol_compatible(struct rdma_cm_event *event)
version = RDS_PROTOCOL_3_0; version = RDS_PROTOCOL_3_0;
while ((common >>= 1) != 0) while ((common >>= 1) != 0)
version++; version++;
} else if (printk_ratelimit()) { }
printk(KERN_NOTICE "RDS: Connection from %pI4 using " printk_ratelimited(KERN_NOTICE "RDS: Connection from %pI4 using "
"incompatible protocol version %u.%u\n", "incompatible protocol version %u.%u\n",
&dp->dp_saddr, &dp->dp_saddr,
dp->dp_protocol_major, dp->dp_protocol_major,
dp->dp_protocol_minor); dp->dp_protocol_minor);
}
return version; return version;
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/in.h> #include <linux/in.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
#include "ib.h" #include "ib.h"
...@@ -207,8 +208,7 @@ static struct rds_message *rds_ib_send_unmap_op(struct rds_ib_connection *ic, ...@@ -207,8 +208,7 @@ static struct rds_message *rds_ib_send_unmap_op(struct rds_ib_connection *ic,
} }
break; break;
default: default:
if (printk_ratelimit()) printk_ratelimited(KERN_NOTICE
printk(KERN_NOTICE
"RDS/IB: %s: unexpected opcode 0x%x in WR!\n", "RDS/IB: %s: unexpected opcode 0x%x in WR!\n",
__func__, send->s_wr.opcode); __func__, send->s_wr.opcode);
break; break;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/in.h> #include <linux/in.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
#include "iw.h" #include "iw.h"
...@@ -258,8 +259,7 @@ static int rds_iw_setup_qp(struct rds_connection *conn) ...@@ -258,8 +259,7 @@ static int rds_iw_setup_qp(struct rds_connection *conn)
*/ */
rds_iwdev = ib_get_client_data(dev, &rds_iw_client); rds_iwdev = ib_get_client_data(dev, &rds_iw_client);
if (!rds_iwdev) { if (!rds_iwdev) {
if (printk_ratelimit()) printk_ratelimited(KERN_NOTICE "RDS/IW: No client_data for device %s\n",
printk(KERN_NOTICE "RDS/IW: No client_data for device %s\n",
dev->name); dev->name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -365,13 +365,12 @@ static u32 rds_iw_protocol_compatible(const struct rds_iw_connect_private *dp) ...@@ -365,13 +365,12 @@ static u32 rds_iw_protocol_compatible(const struct rds_iw_connect_private *dp)
version = RDS_PROTOCOL_3_0; version = RDS_PROTOCOL_3_0;
while ((common >>= 1) != 0) while ((common >>= 1) != 0)
version++; version++;
} else if (printk_ratelimit()) { }
printk(KERN_NOTICE "RDS: Connection from %pI4 using " printk_ratelimited(KERN_NOTICE "RDS: Connection from %pI4 using "
"incompatible protocol version %u.%u\n", "incompatible protocol version %u.%u\n",
&dp->dp_saddr, &dp->dp_saddr,
dp->dp_protocol_major, dp->dp_protocol_major,
dp->dp_protocol_minor); dp->dp_protocol_minor);
}
return version; return version;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
#include "iw.h" #include "iw.h"
...@@ -729,8 +730,8 @@ static int rds_iw_rdma_build_fastreg(struct rds_iw_mapping *mapping) ...@@ -729,8 +730,8 @@ static int rds_iw_rdma_build_fastreg(struct rds_iw_mapping *mapping)
failed_wr = &f_wr; failed_wr = &f_wr;
ret = ib_post_send(ibmr->cm_id->qp, &f_wr, &failed_wr); ret = ib_post_send(ibmr->cm_id->qp, &f_wr, &failed_wr);
BUG_ON(failed_wr != &f_wr); BUG_ON(failed_wr != &f_wr);
if (ret && printk_ratelimit()) if (ret)
printk(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n", printk_ratelimited(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n",
__func__, __LINE__, ret); __func__, __LINE__, ret);
return ret; return ret;
} }
...@@ -751,8 +752,8 @@ static int rds_iw_rdma_fastreg_inv(struct rds_iw_mr *ibmr) ...@@ -751,8 +752,8 @@ static int rds_iw_rdma_fastreg_inv(struct rds_iw_mr *ibmr)
failed_wr = &s_wr; failed_wr = &s_wr;
ret = ib_post_send(ibmr->cm_id->qp, &s_wr, &failed_wr); ret = ib_post_send(ibmr->cm_id->qp, &s_wr, &failed_wr);
if (ret && printk_ratelimit()) { if (ret) {
printk(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n", printk_ratelimited(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n",
__func__, __LINE__, ret); __func__, __LINE__, ret);
goto out; goto out;
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/in.h> #include <linux/in.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
#include "iw.h" #include "iw.h"
...@@ -258,8 +259,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context) ...@@ -258,8 +259,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)
* when the SEND completes. */ * when the SEND completes. */
break; break;
default: default:
if (printk_ratelimit()) printk_ratelimited(KERN_NOTICE
printk(KERN_NOTICE
"RDS/IW: %s: unexpected opcode 0x%x in WR!\n", "RDS/IW: %s: unexpected opcode 0x%x in WR!\n",
__func__, send->s_wr.opcode); __func__, send->s_wr.opcode);
break; break;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <net/sock.h> #include <net/sock.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/ratelimit.h>
#include "rds.h" #include "rds.h"
...@@ -1006,16 +1007,14 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, ...@@ -1006,16 +1007,14 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
goto out; goto out;
if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) { if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) {
if (printk_ratelimit()) printk_ratelimited(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",
printk(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",
&rm->rdma, conn->c_trans->xmit_rdma); &rm->rdma, conn->c_trans->xmit_rdma);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out; goto out;
} }
if (rm->atomic.op_active && !conn->c_trans->xmit_atomic) { if (rm->atomic.op_active && !conn->c_trans->xmit_atomic) {
if (printk_ratelimit()) printk_ratelimited(KERN_NOTICE "atomic_op %p conn xmit_atomic %p\n",
printk(KERN_NOTICE "atomic_op %p conn xmit_atomic %p\n",
&rm->atomic, conn->c_trans->xmit_atomic); &rm->atomic, conn->c_trans->xmit_atomic);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment