drbd: Add explicit device parameter to D_ASSERT
[deliverable/linux.git] / drivers / block / drbd / drbd_int.h
index 417241a14b3e051369a410162b73c81661997229..4dcad12581bdef43513604ee62119832492357a3 100644 (file)
@@ -147,8 +147,10 @@ void drbd_printk_with_wrong_object_type(void);
 #define dynamic_drbd_dbg(device, fmt, args...) \
        dynamic_dev_dbg(disk_to_dev(device->vdisk), fmt, ## args)
 
-#define D_ASSERT(exp)  if (!(exp)) \
-        drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__)
+#define D_ASSERT(device, exp)  do { \
+       if (!(exp)) \
+               drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__); \
+       } while (0)
 
 /**
  * expect  -  Make an assertion
@@ -1863,7 +1865,7 @@ static inline void put_ldev(struct drbd_device *device)
         * so we must not sleep here. */
 
        __release(local);
-       D_ASSERT(i >= 0);
+       D_ASSERT(device, i >= 0);
        if (i == 0) {
                if (device->state.disk == D_DISKLESS)
                        /* even internal references gone, safe to destroy */
@@ -2094,7 +2096,7 @@ static inline void dec_ap_bio(struct drbd_device *device)
        int mxb = drbd_get_max_buffers(device);
        int ap_bio = atomic_dec_return(&device->ap_bio_cnt);
 
-       D_ASSERT(ap_bio >= 0);
+       D_ASSERT(device, ap_bio >= 0);
 
        if (ap_bio == 0 && test_bit(BITMAP_IO, &device->flags)) {
                if (!test_and_set_bit(BITMAP_IO_QUEUED, &device->flags))
This page took 0.024179 seconds and 5 git commands to generate.