Commit 4f43446d authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer

dm integrity: allow large ranges to be described

Change n_sectors data type from unsigned to sector_t.  Following commits
will need to lock large ranges.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent d5027e03
...@@ -246,7 +246,7 @@ struct dm_integrity_c { ...@@ -246,7 +246,7 @@ struct dm_integrity_c {
struct dm_integrity_range { struct dm_integrity_range {
sector_t logical_sector; sector_t logical_sector;
unsigned n_sectors; sector_t n_sectors;
bool waiting; bool waiting;
union { union {
struct rb_node node; struct rb_node node;
...@@ -1695,7 +1695,7 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_map ...@@ -1695,7 +1695,7 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_map
unsigned ws, we, range_sectors; unsigned ws, we, range_sectors;
dio->range.n_sectors = min(dio->range.n_sectors, dio->range.n_sectors = min(dio->range.n_sectors,
ic->free_sectors << ic->sb->log2_sectors_per_block); (sector_t)ic->free_sectors << ic->sb->log2_sectors_per_block);
if (unlikely(!dio->range.n_sectors)) { if (unlikely(!dio->range.n_sectors)) {
if (from_map) if (from_map)
goto offload_to_thread; goto offload_to_thread;
...@@ -2153,7 +2153,7 @@ static void integrity_recalc(struct work_struct *w) ...@@ -2153,7 +2153,7 @@ static void integrity_recalc(struct work_struct *w)
get_area_and_offset(ic, range.logical_sector, &area, &offset); get_area_and_offset(ic, range.logical_sector, &area, &offset);
range.n_sectors = min((sector_t)RECALC_SECTORS, ic->provided_data_sectors - range.logical_sector); range.n_sectors = min((sector_t)RECALC_SECTORS, ic->provided_data_sectors - range.logical_sector);
if (!ic->meta_dev) if (!ic->meta_dev)
range.n_sectors = min(range.n_sectors, (1U << ic->sb->log2_interleave_sectors) - (unsigned)offset); range.n_sectors = min(range.n_sectors, ((sector_t)1U << ic->sb->log2_interleave_sectors) - (unsigned)offset);
if (unlikely(!add_new_range(ic, &range, true))) if (unlikely(!add_new_range(ic, &range, true)))
wait_and_add_new_range(ic, &range); wait_and_add_new_range(ic, &range);
......
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