aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
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)
891 struct p_rs_uuid *p; 891 struct p_rs_uuid *p;
892 u64 uuid; 892 u64 uuid;
893 893
894 D_ASSERT(device->state.disk == D_UP_TO_DATE); 894 D_ASSERT(device, device->state.disk == D_UP_TO_DATE);
895 895
896 uuid = device->ldev->md.uuid[UI_BITMAP]; 896 uuid = device->ldev->md.uuid[UI_BITMAP];
897 if (uuid && uuid != UUID_JUST_CREATED) 897 if (uuid && uuid != UUID_JUST_CREATED)
@@ -919,7 +919,7 @@ int drbd_send_sizes(struct drbd_device *device, int trigger_reply, enum dds_flag
919 unsigned int max_bio_size; 919 unsigned int max_bio_size;
920 920
921 if (get_ldev_if_state(device, D_NEGOTIATING)) { 921 if (get_ldev_if_state(device, D_NEGOTIATING)) {
922 D_ASSERT(device->ldev->backing_bdev); 922 D_ASSERT(device, device->ldev->backing_bdev);
923 d_size = drbd_get_max_capacity(device->ldev); 923 d_size = drbd_get_max_capacity(device->ldev);
924 rcu_read_lock(); 924 rcu_read_lock();
925 u_size = rcu_dereference(device->ldev->disk_conf)->disk_size; 925 u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -1974,7 +1974,7 @@ void drbd_device_cleanup(struct drbd_device *device)
1974 device->rs_mark_left[i] = 0; 1974 device->rs_mark_left[i] = 0;
1975 device->rs_mark_time[i] = 0; 1975 device->rs_mark_time[i] = 0;
1976 } 1976 }
1977 D_ASSERT(first_peer_device(device)->connection->net_conf == NULL); 1977 D_ASSERT(device, first_peer_device(device)->connection->net_conf == NULL);
1978 1978
1979 drbd_set_my_capacity(device, 0); 1979 drbd_set_my_capacity(device, 0);
1980 if (device->bitmap) { 1980 if (device->bitmap) {
@@ -1988,16 +1988,16 @@ void drbd_device_cleanup(struct drbd_device *device)
1988 1988
1989 clear_bit(AL_SUSPENDED, &device->flags); 1989 clear_bit(AL_SUSPENDED, &device->flags);
1990 1990
1991 D_ASSERT(list_empty(&device->active_ee)); 1991 D_ASSERT(device, list_empty(&device->active_ee));
1992 D_ASSERT(list_empty(&device->sync_ee)); 1992 D_ASSERT(device, list_empty(&device->sync_ee));
1993 D_ASSERT(list_empty(&device->done_ee)); 1993 D_ASSERT(device, list_empty(&device->done_ee));
1994 D_ASSERT(list_empty(&device->read_ee)); 1994 D_ASSERT(device, list_empty(&device->read_ee));
1995 D_ASSERT(list_empty(&device->net_ee)); 1995 D_ASSERT(device, list_empty(&device->net_ee));
1996 D_ASSERT(list_empty(&device->resync_reads)); 1996 D_ASSERT(device, list_empty(&device->resync_reads));
1997 D_ASSERT(list_empty(&first_peer_device(device)->connection->sender_work.q)); 1997 D_ASSERT(device, list_empty(&first_peer_device(device)->connection->sender_work.q));
1998 D_ASSERT(list_empty(&device->resync_work.list)); 1998 D_ASSERT(device, list_empty(&device->resync_work.list));
1999 D_ASSERT(list_empty(&device->unplug_work.list)); 1999 D_ASSERT(device, list_empty(&device->unplug_work.list));
2000 D_ASSERT(list_empty(&device->go_diskless.list)); 2000 D_ASSERT(device, list_empty(&device->go_diskless.list));
2001 2001
2002 drbd_set_defaults(device); 2002 drbd_set_defaults(device);
2003} 2003}
@@ -2014,7 +2014,7 @@ static void drbd_destroy_mempools(void)
2014 drbd_pp_vacant--; 2014 drbd_pp_vacant--;
2015 } 2015 }
2016 2016
2017 /* D_ASSERT(atomic_read(&drbd_pp_vacant)==0); */ 2017 /* D_ASSERT(device, atomic_read(&drbd_pp_vacant)==0); */
2018 2018
2019 if (drbd_md_io_bio_set) 2019 if (drbd_md_io_bio_set)
2020 bioset_free(drbd_md_io_bio_set); 2020 bioset_free(drbd_md_io_bio_set);
@@ -2169,7 +2169,7 @@ void drbd_destroy_device(struct kref *kref)
2169 del_timer_sync(&device->request_timer); 2169 del_timer_sync(&device->request_timer);
2170 2170
2171 /* paranoia asserts */ 2171 /* paranoia asserts */
2172 D_ASSERT(device->open_cnt == 0); 2172 D_ASSERT(device, device->open_cnt == 0);
2173 /* end paranoia asserts */ 2173 /* end paranoia asserts */
2174 2174
2175 /* cleanup stuff that may have been allocated during 2175 /* cleanup stuff that may have been allocated during
@@ -3006,7 +3006,7 @@ void drbd_md_write(struct drbd_device *device, void *b)
3006 buffer->al_stripes = cpu_to_be32(device->ldev->md.al_stripes); 3006 buffer->al_stripes = cpu_to_be32(device->ldev->md.al_stripes);
3007 buffer->al_stripe_size_4k = cpu_to_be32(device->ldev->md.al_stripe_size_4k); 3007 buffer->al_stripe_size_4k = cpu_to_be32(device->ldev->md.al_stripe_size_4k);
3008 3008
3009 D_ASSERT(drbd_md_ss(device->ldev) == device->ldev->md.md_offset); 3009 D_ASSERT(device, drbd_md_ss(device->ldev) == device->ldev->md.md_offset);
3010 sector = device->ldev->md.md_offset; 3010 sector = device->ldev->md.md_offset;
3011 3011
3012 if (drbd_md_sync_page_io(device, device->ldev, sector, WRITE)) { 3012 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)
3459 struct drbd_device *device = w->device; 3459 struct drbd_device *device = w->device;
3460 int rv = -EIO; 3460 int rv = -EIO;
3461 3461
3462 D_ASSERT(atomic_read(&device->ap_bio_cnt) == 0); 3462 D_ASSERT(device, atomic_read(&device->ap_bio_cnt) == 0);
3463 3463
3464 if (get_ldev(device)) { 3464 if (get_ldev(device)) {
3465 drbd_bm_lock(device, work->why, work->flags); 3465 drbd_bm_lock(device, work->why, work->flags);
@@ -3498,7 +3498,7 @@ static int w_go_diskless(struct drbd_work *w, int unused)
3498{ 3498{
3499 struct drbd_device *device = w->device; 3499 struct drbd_device *device = w->device;
3500 3500
3501 D_ASSERT(device->state.disk == D_FAILED); 3501 D_ASSERT(device, device->state.disk == D_FAILED);
3502 /* we cannot assert local_cnt == 0 here, as get_ldev_if_state will 3502 /* we cannot assert local_cnt == 0 here, as get_ldev_if_state will
3503 * inc/dec it frequently. Once we are D_DISKLESS, no one will touch 3503 * inc/dec it frequently. Once we are D_DISKLESS, no one will touch
3504 * the protected members anymore, though, so once put_ldev reaches zero 3504 * the protected members anymore, though, so once put_ldev reaches zero
@@ -3552,11 +3552,11 @@ void drbd_queue_bitmap_io(struct drbd_device *device,
3552 void (*done)(struct drbd_device *, int), 3552 void (*done)(struct drbd_device *, int),
3553 char *why, enum bm_flag flags) 3553 char *why, enum bm_flag flags)
3554{ 3554{
3555 D_ASSERT(current == first_peer_device(device)->connection->worker.task); 3555 D_ASSERT(device, current == first_peer_device(device)->connection->worker.task);
3556 3556
3557 D_ASSERT(!test_bit(BITMAP_IO_QUEUED, &device->flags)); 3557 D_ASSERT(device, !test_bit(BITMAP_IO_QUEUED, &device->flags));
3558 D_ASSERT(!test_bit(BITMAP_IO, &device->flags)); 3558 D_ASSERT(device, !test_bit(BITMAP_IO, &device->flags));
3559 D_ASSERT(list_empty(&device->bm_io_work.w.list)); 3559 D_ASSERT(device, list_empty(&device->bm_io_work.w.list));
3560 if (device->bm_io_work.why) 3560 if (device->bm_io_work.why)
3561 drbd_err(device, "FIXME going to queue '%s' but '%s' still pending?\n", 3561 drbd_err(device, "FIXME going to queue '%s' but '%s' still pending?\n",
3562 why, device->bm_io_work.why); 3562 why, device->bm_io_work.why);
@@ -3589,7 +3589,7 @@ int drbd_bitmap_io(struct drbd_device *device, int (*io_fn)(struct drbd_device *
3589{ 3589{
3590 int rv; 3590 int rv;
3591 3591
3592 D_ASSERT(current != first_peer_device(device)->connection->worker.task); 3592 D_ASSERT(device, current != first_peer_device(device)->connection->worker.task);
3593 3593
3594 if ((flags & BM_LOCKED_SET_ALLOWED) == 0) 3594 if ((flags & BM_LOCKED_SET_ALLOWED) == 0)
3595 drbd_suspend_io(device); 3595 drbd_suspend_io(device);