Commit 96422281 authored by Heinz Mauelshagen's avatar Heinz Mauelshagen Committed by Mike Snitzer

dm: address space issues relative to switch/while/for/...

Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent 2f06cd12
...@@ -195,7 +195,7 @@ static bool __put(struct dm_bio_prison_v2 *prison, ...@@ -195,7 +195,7 @@ static bool __put(struct dm_bio_prison_v2 *prison,
// FIXME: shared locks granted above the lock level could starve this // FIXME: shared locks granted above the lock level could starve this
if (!cell->shared_count) { if (!cell->shared_count) {
if (cell->exclusive_lock){ if (cell->exclusive_lock) {
if (cell->quiesce_continuation) { if (cell->quiesce_continuation) {
queue_work(prison->wq, cell->quiesce_continuation); queue_work(prison->wq, cell->quiesce_continuation);
cell->quiesce_continuation = NULL; cell->quiesce_continuation = NULL;
......
...@@ -1010,13 +1010,13 @@ static bool cmd_write_lock(struct dm_cache_metadata *cmd) ...@@ -1010,13 +1010,13 @@ static bool cmd_write_lock(struct dm_cache_metadata *cmd)
do { \ do { \
if (!cmd_write_lock((cmd))) \ if (!cmd_write_lock((cmd))) \
return -EINVAL; \ return -EINVAL; \
} while(0) } while (0)
#define WRITE_LOCK_VOID(cmd) \ #define WRITE_LOCK_VOID(cmd) \
do { \ do { \
if (!cmd_write_lock((cmd))) \ if (!cmd_write_lock((cmd))) \
return; \ return; \
} while(0) } while (0)
#define WRITE_UNLOCK(cmd) \ #define WRITE_UNLOCK(cmd) \
up_write(&(cmd)->root_lock) up_write(&(cmd)->root_lock)
...@@ -1035,13 +1035,13 @@ static bool cmd_read_lock(struct dm_cache_metadata *cmd) ...@@ -1035,13 +1035,13 @@ static bool cmd_read_lock(struct dm_cache_metadata *cmd)
do { \ do { \
if (!cmd_read_lock((cmd))) \ if (!cmd_read_lock((cmd))) \
return -EINVAL; \ return -EINVAL; \
} while(0) } while (0)
#define READ_LOCK_VOID(cmd) \ #define READ_LOCK_VOID(cmd) \
do { \ do { \
if (!cmd_read_lock((cmd))) \ if (!cmd_read_lock((cmd))) \
return; \ return; \
} while(0) } while (0)
#define READ_UNLOCK(cmd) \ #define READ_UNLOCK(cmd) \
up_read(&(cmd)->root_lock) up_read(&(cmd)->root_lock)
......
...@@ -784,7 +784,7 @@ static int core_status(struct dm_dirty_log *log, status_type_t status, ...@@ -784,7 +784,7 @@ static int core_status(struct dm_dirty_log *log, status_type_t status,
int sz = 0; int sz = 0;
struct log_c *lc = log->context; struct log_c *lc = log->context;
switch(status) { switch (status) {
case STATUSTYPE_INFO: case STATUSTYPE_INFO:
DMEMIT("1 %s", log->type->name); DMEMIT("1 %s", log->type->name);
break; break;
...@@ -809,7 +809,7 @@ static int disk_status(struct dm_dirty_log *log, status_type_t status, ...@@ -809,7 +809,7 @@ static int disk_status(struct dm_dirty_log *log, status_type_t status,
int sz = 0; int sz = 0;
struct log_c *lc = log->context; struct log_c *lc = log->context;
switch(status) { switch (status) {
case STATUSTYPE_INFO: case STATUSTYPE_INFO:
DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name, DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name,
lc->log_dev_flush_failed ? 'F' : lc->log_dev_flush_failed ? 'F' :
......
...@@ -1822,7 +1822,7 @@ static void multipath_status(struct dm_target *ti, status_type_t type, ...@@ -1822,7 +1822,7 @@ static void multipath_status(struct dm_target *ti, status_type_t type,
if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags)) if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags))
DMEMIT("retain_attached_hw_handler "); DMEMIT("retain_attached_hw_handler ");
if (m->queue_mode != DM_TYPE_REQUEST_BASED) { if (m->queue_mode != DM_TYPE_REQUEST_BASED) {
switch(m->queue_mode) { switch (m->queue_mode) {
case DM_TYPE_BIO_BASED: case DM_TYPE_BIO_BASED:
DMEMIT("queue_mode bio "); DMEMIT("queue_mode bio ");
break; break;
......
...@@ -162,7 +162,7 @@ static int ioa_status(struct path_selector *ps, struct dm_path *path, ...@@ -162,7 +162,7 @@ static int ioa_status(struct path_selector *ps, struct dm_path *path,
return sz; return sz;
} }
switch(type) { switch (type) {
case STATUSTYPE_INFO: case STATUSTYPE_INFO:
DMEMIT("%d ", atomic_read(&s->map_misses)); DMEMIT("%d ", atomic_read(&s->map_misses));
break; break;
......
...@@ -94,7 +94,7 @@ static int rr_status(struct path_selector *ps, struct dm_path *path, ...@@ -94,7 +94,7 @@ static int rr_status(struct path_selector *ps, struct dm_path *path,
if (!path) if (!path)
DMEMIT("0 "); DMEMIT("0 ");
else { else {
switch(type) { switch (type) {
case STATUSTYPE_INFO: case STATUSTYPE_INFO:
break; break;
case STATUSTYPE_TABLE: case STATUSTYPE_TABLE:
......
...@@ -1430,7 +1430,7 @@ static int dmz_emulate_zones(struct dmz_metadata *zmd, struct dmz_dev *dev) ...@@ -1430,7 +1430,7 @@ static int dmz_emulate_zones(struct dmz_metadata *zmd, struct dmz_dev *dev)
int idx; int idx;
sector_t zone_offset = 0; sector_t zone_offset = 0;
for(idx = 0; idx < dev->nr_zones; idx++) { for (idx = 0; idx < dev->nr_zones; idx++) {
struct dm_zone *zone; struct dm_zone *zone;
zone = dmz_insert(zmd, idx, dev); zone = dmz_insert(zmd, idx, dev);
...@@ -1457,7 +1457,7 @@ static void dmz_drop_zones(struct dmz_metadata *zmd) ...@@ -1457,7 +1457,7 @@ static void dmz_drop_zones(struct dmz_metadata *zmd)
{ {
int idx; int idx;
for(idx = 0; idx < zmd->nr_zones; idx++) { for (idx = 0; idx < zmd->nr_zones; idx++) {
struct dm_zone *zone = xa_load(&zmd->zones, idx); struct dm_zone *zone = xa_load(&zmd->zones, idx);
kfree(zone); kfree(zone);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment