diff options
author | Christoph Böhmwalder <christoph.boehmwalder@linbit.com> | 2022-12-01 12:03:49 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-12-01 11:33:49 -0700 |
commit | e3fa02d7d420c7cfb7077cc6eeb62c886ba5ff39 (patch) | |
tree | f07f3aa22891ae6f9045534d0a4693dcd31eead9 /drivers/block/drbd/drbd_bitmap.c | |
parent | aa034695971124f673d4ccdd39cd7f269904ea86 (diff) | |
download | linux-stable-e3fa02d7d420c7cfb7077cc6eeb62c886ba5ff39.tar.gz linux-stable-e3fa02d7d420c7cfb7077cc6eeb62c886ba5ff39.tar.bz2 linux-stable-e3fa02d7d420c7cfb7077cc6eeb62c886ba5ff39.zip |
drbd: introduce drbd_ratelimit()
Use call site specific ratelimit instead of one single static global.
Also ratelimit ASSERTION messages generated by expect().
Originally-from: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20221201110349.1282687-5-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/drbd/drbd_bitmap.c')
-rw-r--r-- | drivers/block/drbd/drbd_bitmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index b90a5c1003fc..8e6534a90e12 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -113,7 +113,7 @@ struct drbd_bitmap { static void __bm_print_lock_info(struct drbd_device *device, const char *func) { struct drbd_bitmap *b = device->bitmap; - if (!__ratelimit(&drbd_ratelimit_state)) + if (!drbd_ratelimit()) return; drbd_err(device, "FIXME %s[%d] in %s, bitmap locked for '%s' by %s[%d]\n", current->comm, task_pid_nr(current), @@ -952,7 +952,7 @@ static void drbd_bm_endio(struct bio *bio) bm_set_page_io_err(b->bm_pages[idx]); /* Not identical to on disk version of it. * Is BM_PAGE_IO_ERROR enough? */ - if (__ratelimit(&drbd_ratelimit_state)) + if (drbd_ratelimit()) drbd_err(device, "IO ERROR %d on bitmap page idx %u\n", bio->bi_status, idx); } else { @@ -1013,7 +1013,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho else len = PAGE_SIZE; } else { - if (__ratelimit(&drbd_ratelimit_state)) { + if (drbd_ratelimit()) { drbd_err(device, "Invalid offset during on-disk bitmap access: " "page idx %u, sector %llu\n", page_nr, on_disk_sector); } |