diff options
author | Andreas Gruenbacher <andreas.gruenbacher@gmail.com> | 2014-09-11 08:29:09 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-11 10:41:29 -0400 |
commit | d1b8085356391d1d5151670ab96baae6234d1e20 (patch) | |
tree | cf3c716ef05aed6582fbeca281a5529cf34c7ae8 /drivers/block/drbd | |
parent | 8d4ba3f0fa53044b8b597caaa7d8e291e6e84642 (diff) |
drbd: Get rid of the __no_warn and __cond_lock macros
These macros can easily be replaced with its definition.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 11 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 9 |
2 files changed, 12 insertions, 8 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index f424dc0c582d..9b22f8f01b57 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -61,8 +61,6 @@ | |||
61 | # define __must_hold(x) | 61 | # define __must_hold(x) |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #define __no_warn(lock, stmt) do { __acquire(lock); stmt; __release(lock); } while (0) | ||
65 | |||
66 | /* module parameter, defined in drbd_main.c */ | 64 | /* module parameter, defined in drbd_main.c */ |
67 | extern unsigned int minor_count; | 65 | extern unsigned int minor_count; |
68 | extern bool disable_sendpage; | 66 | extern bool disable_sendpage; |
@@ -2100,12 +2098,15 @@ static inline bool is_sync_state(enum drbd_conns connection_state) | |||
2100 | 2098 | ||
2101 | /** | 2099 | /** |
2102 | * get_ldev() - Increase the ref count on device->ldev. Returns 0 if there is no ldev | 2100 | * get_ldev() - Increase the ref count on device->ldev. Returns 0 if there is no ldev |
2103 | * @M: DRBD device. | 2101 | * @_device: DRBD device. |
2102 | * @_min_state: Minimum device state required for success. | ||
2104 | * | 2103 | * |
2105 | * You have to call put_ldev() when finished working with device->ldev. | 2104 | * You have to call put_ldev() when finished working with device->ldev. |
2106 | */ | 2105 | */ |
2107 | #define get_ldev(M) __cond_lock(local, _get_ldev_if_state(M,D_INCONSISTENT)) | 2106 | #define get_ldev_if_state(_device, _min_state) \ |
2108 | #define get_ldev_if_state(M,MINS) __cond_lock(local, _get_ldev_if_state(M,MINS)) | 2107 | (_get_ldev_if_state((_device), (_min_state)) ? \ |
2108 | ({ __acquire(x); true; }) : false) | ||
2109 | #define get_ldev(_device) get_ldev_if_state(_device, D_INCONSISTENT) | ||
2109 | 2110 | ||
2110 | static inline void put_ldev(struct drbd_device *device) | 2111 | static inline void put_ldev(struct drbd_device *device) |
2111 | { | 2112 | { |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 6e01e62c58a0..b20cd214d371 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1853,9 +1853,12 @@ static void drbd_ldev_destroy(struct drbd_device *device) | |||
1853 | device->resync = NULL; | 1853 | device->resync = NULL; |
1854 | lc_destroy(device->act_log); | 1854 | lc_destroy(device->act_log); |
1855 | device->act_log = NULL; | 1855 | device->act_log = NULL; |
1856 | __no_warn(local, | 1856 | |
1857 | drbd_free_ldev(device->ldev); | 1857 | __acquire(local); |
1858 | device->ldev = NULL;); | 1858 | drbd_free_ldev(device->ldev); |
1859 | device->ldev = NULL; | ||
1860 | __release(local); | ||
1861 | |||
1859 | clear_bit(GOING_DISKLESS, &device->flags); | 1862 | clear_bit(GOING_DISKLESS, &device->flags); |
1860 | wake_up(&device->misc_wait); | 1863 | wake_up(&device->misc_wait); |
1861 | } | 1864 | } |