Commit 03b18887 authored by Heinz Mauelshagen's avatar Heinz Mauelshagen Committed by Mike Snitzer

dm: fix trailing statements

Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent 43be9c74
...@@ -357,8 +357,7 @@ static int flakey_map(struct dm_target *ti, struct bio *bio) ...@@ -357,8 +357,7 @@ static int flakey_map(struct dm_target *ti, struct bio *bio)
if (test_bit(DROP_WRITES, &fc->flags)) { if (test_bit(DROP_WRITES, &fc->flags)) {
bio_endio(bio); bio_endio(bio);
return DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
} } else if (test_bit(ERROR_WRITES, &fc->flags)) {
else if (test_bit(ERROR_WRITES, &fc->flags)) {
bio_io_error(bio); bio_io_error(bio);
return DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
} }
......
...@@ -679,16 +679,18 @@ static bool block_bitmap_op(struct dm_integrity_c *ic, struct page_list *bitmap, ...@@ -679,16 +679,18 @@ static bool block_bitmap_op(struct dm_integrity_c *ic, struct page_list *bitmap,
} else if (mode == BITMAP_OP_CLEAR) { } else if (mode == BITMAP_OP_CLEAR) {
if (!bit && this_end_bit == PAGE_SIZE * 8 - 1) if (!bit && this_end_bit == PAGE_SIZE * 8 - 1)
clear_page(data); clear_page(data);
else while (bit <= this_end_bit) { else {
if (!(bit % BITS_PER_LONG) && this_end_bit >= bit + BITS_PER_LONG - 1) { while (bit <= this_end_bit) {
do { if (!(bit % BITS_PER_LONG) && this_end_bit >= bit + BITS_PER_LONG - 1) {
data[bit / BITS_PER_LONG] = 0; do {
bit += BITS_PER_LONG; data[bit / BITS_PER_LONG] = 0;
} while (this_end_bit >= bit + BITS_PER_LONG - 1); bit += BITS_PER_LONG;
continue; } while (this_end_bit >= bit + BITS_PER_LONG - 1);
continue;
}
__clear_bit(bit, data);
bit++;
} }
__clear_bit(bit, data);
bit++;
} }
} else { } else {
BUG(); BUG();
...@@ -2010,23 +2012,23 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio, ...@@ -2010,23 +2012,23 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
unsigned int tag_todo = ic->tag_size; unsigned int tag_todo = ic->tag_size;
char *tag_ptr = journal_entry_tag(ic, je); char *tag_ptr = journal_entry_tag(ic, je);
if (bip) do { if (bip) {
struct bio_vec biv = bvec_iter_bvec(bip->bip_vec, bip->bip_iter); do {
unsigned int tag_now = min(biv.bv_len, tag_todo); struct bio_vec biv = bvec_iter_bvec(bip->bip_vec, bip->bip_iter);
char *tag_addr; unsigned int tag_now = min(biv.bv_len, tag_todo);
BUG_ON(PageHighMem(biv.bv_page)); char *tag_addr;
tag_addr = bvec_virt(&biv); BUG_ON(PageHighMem(biv.bv_page));
if (likely(dio->op == REQ_OP_WRITE)) tag_addr = bvec_virt(&biv);
memcpy(tag_ptr, tag_addr, tag_now); if (likely(dio->op == REQ_OP_WRITE))
else memcpy(tag_ptr, tag_addr, tag_now);
memcpy(tag_addr, tag_ptr, tag_now); else
bvec_iter_advance(bip->bip_vec, &bip->bip_iter, tag_now); memcpy(tag_addr, tag_ptr, tag_now);
tag_ptr += tag_now; bvec_iter_advance(bip->bip_vec, &bip->bip_iter, tag_now);
tag_todo -= tag_now; tag_ptr += tag_now;
} while (unlikely(tag_todo)); else { tag_todo -= tag_now;
if (likely(dio->op == REQ_OP_WRITE)) } while (unlikely(tag_todo));
memset(tag_ptr, 0, tag_todo); } else if (likely(dio->op == REQ_OP_WRITE))
} memset(tag_ptr, 0, tag_todo);
} }
if (likely(dio->op == REQ_OP_WRITE)) { if (likely(dio->op == REQ_OP_WRITE)) {
......
...@@ -359,18 +359,20 @@ static void do_region(const blk_opf_t opf, unsigned int region, ...@@ -359,18 +359,20 @@ static void do_region(const blk_opf_t opf, unsigned int region,
num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining); num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining);
bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT; bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
remaining -= num_sectors; remaining -= num_sectors;
} else while (remaining) { } else {
/* while (remaining) {
* Try and add as many pages as possible. /*
*/ * Try and add as many pages as possible.
dp->get_page(dp, &page, &len, &offset); */
len = min(len, to_bytes(remaining)); dp->get_page(dp, &page, &len, &offset);
if (!bio_add_page(bio, page, len, offset)) len = min(len, to_bytes(remaining));
break; if (!bio_add_page(bio, page, len, offset))
break;
offset = 0;
remaining -= to_sector(len); offset = 0;
dp->next_page(dp); remaining -= to_sector(len);
dp->next_page(dp);
}
} }
atomic_inc(&io->count); atomic_inc(&io->count);
......
...@@ -518,15 +518,17 @@ static int read_exceptions(struct pstore *ps, ...@@ -518,15 +518,17 @@ static int read_exceptions(struct pstore *ps,
if (unlikely(prefetch_area < ps->current_area)) if (unlikely(prefetch_area < ps->current_area))
prefetch_area = ps->current_area; prefetch_area = ps->current_area;
if (DM_PREFETCH_CHUNKS) do { if (DM_PREFETCH_CHUNKS) {
chunk_t pf_chunk = area_location(ps, prefetch_area); do {
if (unlikely(pf_chunk >= dm_bufio_get_device_size(client))) chunk_t pf_chunk = area_location(ps, prefetch_area);
break; if (unlikely(pf_chunk >= dm_bufio_get_device_size(client)))
dm_bufio_prefetch(client, pf_chunk, 1); break;
prefetch_area++; dm_bufio_prefetch(client, pf_chunk, 1);
if (unlikely(!prefetch_area)) prefetch_area++;
break; if (unlikely(!prefetch_area))
} while (prefetch_area <= ps->current_area + DM_PREFETCH_CHUNKS); break;
} while (prefetch_area <= ps->current_area + DM_PREFETCH_CHUNKS);
}
chunk = area_location(ps, ps->current_area); chunk = area_location(ps, ps->current_area);
......
...@@ -2345,8 +2345,7 @@ static void snapshot_status(struct dm_target *ti, status_type_t type, ...@@ -2345,8 +2345,7 @@ static void snapshot_status(struct dm_target *ti, status_type_t type,
(unsigned long long)sectors_allocated, (unsigned long long)sectors_allocated,
(unsigned long long)total_sectors, (unsigned long long)total_sectors,
(unsigned long long)metadata_sectors); (unsigned long long)metadata_sectors);
} } else
else
DMEMIT("Unknown"); DMEMIT("Unknown");
} }
......
...@@ -1974,8 +1974,7 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, ...@@ -1974,8 +1974,7 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
blk_queue_flag_set(QUEUE_FLAG_DAX, q); blk_queue_flag_set(QUEUE_FLAG_DAX, q);
if (dm_table_supports_dax(t, device_not_dax_synchronous_capable)) if (dm_table_supports_dax(t, device_not_dax_synchronous_capable))
set_dax_synchronous(t->md->dax_dev); set_dax_synchronous(t->md->dax_dev);
} } else
else
blk_queue_flag_clear(QUEUE_FLAG_DAX, q); blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
if (dm_table_any_dev_attr(t, device_dax_write_cache_enabled, NULL)) if (dm_table_any_dev_attr(t, device_dax_write_cache_enabled, NULL))
......
...@@ -332,10 +332,8 @@ static int verity_verify_level(struct dm_verity *v, struct dm_verity_io *io, ...@@ -332,10 +332,8 @@ static int verity_verify_level(struct dm_verity *v, struct dm_verity_io *io,
*/ */
r = -EAGAIN; r = -EAGAIN;
goto release_ret_r; goto release_ret_r;
} } else if (verity_fec_decode(v, io, DM_VERITY_BLOCK_TYPE_METADATA,
else if (verity_fec_decode(v, io, hash_block, data, NULL) == 0)
DM_VERITY_BLOCK_TYPE_METADATA,
hash_block, data, NULL) == 0)
aux->hash_verified = 1; aux->hash_verified = 1;
else if (verity_handle_err(v, else if (verity_handle_err(v,
DM_VERITY_BLOCK_TYPE_METADATA, DM_VERITY_BLOCK_TYPE_METADATA,
......
...@@ -941,7 +941,8 @@ static void writecache_suspend(struct dm_target *ti) ...@@ -941,7 +941,8 @@ static void writecache_suspend(struct dm_target *ti)
wc_lock(wc); wc_lock(wc);
if (flush_on_suspend) if (flush_on_suspend)
wc->writeback_all--; wc->writeback_all--;
while (writecache_wait_for_writeback(wc)); while (writecache_wait_for_writeback(wc))
;
if (WC_MODE_PMEM(wc)) if (WC_MODE_PMEM(wc))
persistent_memory_flush_cache(wc->memory_map, wc->memory_map_size); persistent_memory_flush_cache(wc->memory_map, wc->memory_map_size);
...@@ -2090,7 +2091,8 @@ static void writecache_writeback(struct work_struct *work) ...@@ -2090,7 +2091,8 @@ static void writecache_writeback(struct work_struct *work)
if (unlikely(wc->writeback_all)) { if (unlikely(wc->writeback_all)) {
wc_lock(wc); wc_lock(wc);
while (writecache_wait_for_writeback(wc)); while (writecache_wait_for_writeback(wc))
;
wc_unlock(wc); wc_unlock(wc);
} }
} }
...@@ -2448,12 +2450,14 @@ static int writecache_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -2448,12 +2450,14 @@ static int writecache_ctr(struct dm_target *ti, unsigned int argc, char **argv)
if (WC_MODE_PMEM(wc)) { if (WC_MODE_PMEM(wc)) {
wc->writeback_fua = true; wc->writeback_fua = true;
wc->writeback_fua_set = true; wc->writeback_fua_set = true;
} else goto invalid_optional; } else
goto invalid_optional;
} else if (!strcasecmp(string, "nofua")) { } else if (!strcasecmp(string, "nofua")) {
if (WC_MODE_PMEM(wc)) { if (WC_MODE_PMEM(wc)) {
wc->writeback_fua = false; wc->writeback_fua = false;
wc->writeback_fua_set = true; wc->writeback_fua_set = true;
} else goto invalid_optional; } else
goto invalid_optional;
} else if (!strcasecmp(string, "metadata_only")) { } else if (!strcasecmp(string, "metadata_only")) {
wc->metadata_only = true; wc->metadata_only = true;
} else if (!strcasecmp(string, "pause_writeback") && opt_params >= 1) { } else if (!strcasecmp(string, "pause_writeback") && opt_params >= 1) {
......
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