Skip to content

Commit

Permalink
dm integrity: allow large ranges to be described
Browse files Browse the repository at this point in the history
Change n_sectors data type from unsigned to sector_t.  Following commits
will need to lock large ranges.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Mike Snitzer committed May 7, 2019
1 parent d5027e0 commit 4f43446
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/md/dm-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct dm_integrity_c {

struct dm_integrity_range {
sector_t logical_sector;
unsigned n_sectors;
sector_t n_sectors;
bool waiting;
union {
struct rb_node node;
Expand Down Expand Up @@ -1695,7 +1695,7 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_map
unsigned ws, we, range_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 (from_map)
goto offload_to_thread;
Expand Down Expand Up @@ -2153,7 +2153,7 @@ static void integrity_recalc(struct work_struct *w)
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);
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)))
wait_and_add_new_range(ic, &range);
Expand Down

0 comments on commit 4f43446

Please sign in to comment.