summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-06-27 16:23:33 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2014-02-17 16:45:04 +0100
commit0b0ba1efc7b887bc2bd767ef822979fe2dae620e (patch)
treecb87bd0b135803615bd76eebb63ddc72bf797b20 /drivers/block/drbd/drbd_main.c
parent1ec861ebd0889263841b822ee3f3eb49caf23656 (diff)
downloadlinux-0b0ba1efc7b887bc2bd767ef822979fe2dae620e.tar.bz2
drbd: Add explicit device parameter to D_ASSERT
The implicit dependency on a variable inside the macro is problematic. Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9e2c8f9d7a0b..358eb3445f72 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -891,7 +891,7 @@ void drbd_gen_and_send_sync_uuid(struct drbd_device *device)
struct p_rs_uuid *p;
u64 uuid;
- D_ASSERT(device->state.disk == D_UP_TO_DATE);
+ D_ASSERT(device, device->state.disk == D_UP_TO_DATE);
uuid = device->ldev->md.uuid[UI_BITMAP];
if (uuid && uuid != UUID_JUST_CREATED)
@@ -919,7 +919,7 @@ int drbd_send_sizes(struct drbd_device *device, int trigger_reply, enum dds_flag
unsigned int max_bio_size;
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- D_ASSERT(device->ldev->backing_bdev);
+ D_ASSERT(device, device->ldev->backing_bdev);
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -1974,7 +1974,7 @@ void drbd_device_cleanup(struct drbd_device *device)
device->rs_mark_left[i] = 0;
device->rs_mark_time[i] = 0;
}
- D_ASSERT(first_peer_device(device)->connection->net_conf == NULL);
+ D_ASSERT(device, first_peer_device(device)->connection->net_conf == NULL);
drbd_set_my_capacity(device, 0);
if (device->bitmap) {
@@ -1988,16 +1988,16 @@ void drbd_device_cleanup(struct drbd_device *device)
clear_bit(AL_SUSPENDED, &device->flags);
- D_ASSERT(list_empty(&device->active_ee));
- D_ASSERT(list_empty(&device->sync_ee));
- D_ASSERT(list_empty(&device->done_ee));
- D_ASSERT(list_empty(&device->read_ee));
- D_ASSERT(list_empty(&device->net_ee));
- D_ASSERT(list_empty(&device->resync_reads));
- D_ASSERT(list_empty(&first_peer_device(device)->connection->sender_work.q));
- D_ASSERT(list_empty(&device->resync_work.list));
- D_ASSERT(list_empty(&device->unplug_work.list));
- D_ASSERT(list_empty(&device->go_diskless.list));
+ D_ASSERT(device, list_empty(&device->active_ee));
+ D_ASSERT(device, list_empty(&device->sync_ee));
+ D_ASSERT(device, list_empty(&device->done_ee));
+ D_ASSERT(device, list_empty(&device->read_ee));
+ D_ASSERT(device, list_empty(&device->net_ee));
+ D_ASSERT(device, list_empty(&device->resync_reads));
+ D_ASSERT(device, list_empty(&first_peer_device(device)->connection->sender_work.q));
+ D_ASSERT(device, list_empty(&device->resync_work.list));
+ D_ASSERT(device, list_empty(&device->unplug_work.list));
+ D_ASSERT(device, list_empty(&device->go_diskless.list));
drbd_set_defaults(device);
}
@@ -2014,7 +2014,7 @@ static void drbd_destroy_mempools(void)
drbd_pp_vacant--;
}
- /* D_ASSERT(atomic_read(&drbd_pp_vacant)==0); */
+ /* D_ASSERT(device, atomic_read(&drbd_pp_vacant)==0); */
if (drbd_md_io_bio_set)
bioset_free(drbd_md_io_bio_set);
@@ -2169,7 +2169,7 @@ void drbd_destroy_device(struct kref *kref)
del_timer_sync(&device->request_timer);
/* paranoia asserts */
- D_ASSERT(device->open_cnt == 0);
+ D_ASSERT(device, device->open_cnt == 0);
/* end paranoia asserts */
/* cleanup stuff that may have been allocated during
@@ -3006,7 +3006,7 @@ void drbd_md_write(struct drbd_device *device, void *b)
buffer->al_stripes = cpu_to_be32(device->ldev->md.al_stripes);
buffer->al_stripe_size_4k = cpu_to_be32(device->ldev->md.al_stripe_size_4k);
- D_ASSERT(drbd_md_ss(device->ldev) == device->ldev->md.md_offset);
+ D_ASSERT(device, drbd_md_ss(device->ldev) == device->ldev->md.md_offset);
sector = device->ldev->md.md_offset;
if (drbd_md_sync_page_io(device, device->ldev, sector, WRITE)) {
@@ -3459,7 +3459,7 @@ static int w_bitmap_io(struct drbd_work *w, int unused)
struct drbd_device *device = w->device;
int rv = -EIO;
- D_ASSERT(atomic_read(&device->ap_bio_cnt) == 0);
+ D_ASSERT(device, atomic_read(&device->ap_bio_cnt) == 0);
if (get_ldev(device)) {
drbd_bm_lock(device, work->why, work->flags);
@@ -3498,7 +3498,7 @@ static int w_go_diskless(struct drbd_work *w, int unused)
{
struct drbd_device *device = w->device;
- D_ASSERT(device->state.disk == D_FAILED);
+ D_ASSERT(device, device->state.disk == D_FAILED);
/* we cannot assert local_cnt == 0 here, as get_ldev_if_state will
* inc/dec it frequently. Once we are D_DISKLESS, no one will touch
* the protected members anymore, though, so once put_ldev reaches zero
@@ -3552,11 +3552,11 @@ void drbd_queue_bitmap_io(struct drbd_device *device,
void (*done)(struct drbd_device *, int),
char *why, enum bm_flag flags)
{
- D_ASSERT(current == first_peer_device(device)->connection->worker.task);
+ D_ASSERT(device, current == first_peer_device(device)->connection->worker.task);
- D_ASSERT(!test_bit(BITMAP_IO_QUEUED, &device->flags));
- D_ASSERT(!test_bit(BITMAP_IO, &device->flags));
- D_ASSERT(list_empty(&device->bm_io_work.w.list));
+ D_ASSERT(device, !test_bit(BITMAP_IO_QUEUED, &device->flags));
+ D_ASSERT(device, !test_bit(BITMAP_IO, &device->flags));
+ D_ASSERT(device, list_empty(&device->bm_io_work.w.list));
if (device->bm_io_work.why)
drbd_err(device, "FIXME going to queue '%s' but '%s' still pending?\n",
why, device->bm_io_work.why);
@@ -3589,7 +3589,7 @@ int drbd_bitmap_io(struct drbd_device *device, int (*io_fn)(struct drbd_device *
{
int rv;
- D_ASSERT(current != first_peer_device(device)->connection->worker.task);
+ D_ASSERT(device, current != first_peer_device(device)->connection->worker.task);
if ((flags & BM_LOCKED_SET_ALLOWED) == 0)
drbd_suspend_io(device);