Skip to content

Commit cb0a605

Browse files
Manuel ZerpiesDavid S. Miller
authored andcommitted
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: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de> Signed-off-by: David S. Miller <davem@conan.davemloft.net>
1 parent d751e62 commit cb0a605

7 files changed

Lines changed: 21 additions & 22 deletions

File tree

‎net/rds/bind.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/in.h>
3636
#include <linux/if_arp.h>
3737
#include <linux/jhash.h>
38+
#include <linux/ratelimit.h>
3839
#include "rds.h"
3940

4041
#define BIND_HASH_SIZE 1024
@@ -185,8 +186,7 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
185186
if (!trans) {
186187
ret = -EADDRNOTAVAIL;
187188
rds_remove_bound(rs);
188-
if (printk_ratelimit())
189-
printk(KERN_INFO "RDS: rds_bind() could not find a transport, "
189+
printk_ratelimited(KERN_INFO "RDS: rds_bind() could not find a transport, "
190190
"load rds_tcp or rds_rdma?\n");
191191
goto out;
192192
}

‎net/rds/ib_cm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/in.h>
3535
#include <linux/slab.h>
3636
#include <linux/vmalloc.h>
37+
#include <linux/ratelimit.h>
3738

3839
#include "rds.h"
3940
#include "ib.h"
@@ -435,13 +436,12 @@ static u32 rds_ib_protocol_compatible(struct rdma_cm_event *event)
435436
version = RDS_PROTOCOL_3_0;
436437
while ((common >>= 1) != 0)
437438
version++;
438-
} else if (printk_ratelimit()) {
439-
printk(KERN_NOTICE "RDS: Connection from %pI4 using "
439+
}
440+
printk_ratelimited(KERN_NOTICE "RDS: Connection from %pI4 using "
440441
"incompatible protocol version %u.%u\n",
441442
&dp->dp_saddr,
442443
dp->dp_protocol_major,
443444
dp->dp_protocol_minor);
444-
}
445445
return version;
446446
}
447447

‎net/rds/ib_send.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/in.h>
3535
#include <linux/device.h>
3636
#include <linux/dmapool.h>
37+
#include <linux/ratelimit.h>
3738

3839
#include "rds.h"
3940
#include "ib.h"
@@ -207,8 +208,7 @@ static struct rds_message *rds_ib_send_unmap_op(struct rds_ib_connection *ic,
207208
}
208209
break;
209210
default:
210-
if (printk_ratelimit())
211-
printk(KERN_NOTICE
211+
printk_ratelimited(KERN_NOTICE
212212
"RDS/IB: %s: unexpected opcode 0x%x in WR!\n",
213213
__func__, send->s_wr.opcode);
214214
break;

‎net/rds/iw_cm.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/in.h>
3535
#include <linux/slab.h>
3636
#include <linux/vmalloc.h>
37+
#include <linux/ratelimit.h>
3738

3839
#include "rds.h"
3940
#include "iw.h"
@@ -258,8 +259,7 @@ static int rds_iw_setup_qp(struct rds_connection *conn)
258259
*/
259260
rds_iwdev = ib_get_client_data(dev, &rds_iw_client);
260261
if (!rds_iwdev) {
261-
if (printk_ratelimit())
262-
printk(KERN_NOTICE "RDS/IW: No client_data for device %s\n",
262+
printk_ratelimited(KERN_NOTICE "RDS/IW: No client_data for device %s\n",
263263
dev->name);
264264
return -EOPNOTSUPP;
265265
}
@@ -365,13 +365,12 @@ static u32 rds_iw_protocol_compatible(const struct rds_iw_connect_private *dp)
365365
version = RDS_PROTOCOL_3_0;
366366
while ((common >>= 1) != 0)
367367
version++;
368-
} else if (printk_ratelimit()) {
369-
printk(KERN_NOTICE "RDS: Connection from %pI4 using "
368+
}
369+
printk_ratelimited(KERN_NOTICE "RDS: Connection from %pI4 using "
370370
"incompatible protocol version %u.%u\n",
371371
&dp->dp_saddr,
372372
dp->dp_protocol_major,
373373
dp->dp_protocol_minor);
374-
}
375374
return version;
376375
}
377376

‎net/rds/iw_rdma.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
*/
3333
#include <linux/kernel.h>
3434
#include <linux/slab.h>
35+
#include <linux/ratelimit.h>
3536

3637
#include "rds.h"
3738
#include "iw.h"
@@ -729,8 +730,8 @@ static int rds_iw_rdma_build_fastreg(struct rds_iw_mapping *mapping)
729730
failed_wr = &f_wr;
730731
ret = ib_post_send(ibmr->cm_id->qp, &f_wr, &failed_wr);
731732
BUG_ON(failed_wr != &f_wr);
732-
if (ret && printk_ratelimit())
733-
printk(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n",
733+
if (ret)
734+
printk_ratelimited(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n",
734735
__func__, __LINE__, ret);
735736
return ret;
736737
}
@@ -751,8 +752,8 @@ static int rds_iw_rdma_fastreg_inv(struct rds_iw_mr *ibmr)
751752

752753
failed_wr = &s_wr;
753754
ret = ib_post_send(ibmr->cm_id->qp, &s_wr, &failed_wr);
754-
if (ret && printk_ratelimit()) {
755-
printk(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n",
755+
if (ret) {
756+
printk_ratelimited(KERN_WARNING "RDS/IW: %s:%d ib_post_send returned %d\n",
756757
__func__, __LINE__, ret);
757758
goto out;
758759
}

‎net/rds/iw_send.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/in.h>
3535
#include <linux/device.h>
3636
#include <linux/dmapool.h>
37+
#include <linux/ratelimit.h>
3738

3839
#include "rds.h"
3940
#include "iw.h"
@@ -258,8 +259,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)
258259
* when the SEND completes. */
259260
break;
260261
default:
261-
if (printk_ratelimit())
262-
printk(KERN_NOTICE
262+
printk_ratelimited(KERN_NOTICE
263263
"RDS/IW: %s: unexpected opcode 0x%x in WR!\n",
264264
__func__, send->s_wr.opcode);
265265
break;

‎net/rds/send.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <net/sock.h>
3636
#include <linux/in.h>
3737
#include <linux/list.h>
38+
#include <linux/ratelimit.h>
3839

3940
#include "rds.h"
4041

@@ -1006,16 +1007,14 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
10061007
goto out;
10071008

10081009
if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) {
1009-
if (printk_ratelimit())
1010-
printk(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",
1010+
printk_ratelimited(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",
10111011
&rm->rdma, conn->c_trans->xmit_rdma);
10121012
ret = -EOPNOTSUPP;
10131013
goto out;
10141014
}
10151015

10161016
if (rm->atomic.op_active && !conn->c_trans->xmit_atomic) {
1017-
if (printk_ratelimit())
1018-
printk(KERN_NOTICE "atomic_op %p conn xmit_atomic %p\n",
1017+
printk_ratelimited(KERN_NOTICE "atomic_op %p conn xmit_atomic %p\n",
10191018
&rm->atomic, conn->c_trans->xmit_atomic);
10201019
ret = -EOPNOTSUPP;
10211020
goto out;

0 commit comments

Comments
 (0)