diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-10-17 00:18:17 +0200 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-10-17 00:18:17 +0200 |
commit | df96eee679ba28c98cf722fa7c9f4286ee1ed0bd (patch) | |
tree | 282c1368f3dff6ed0e0994210cc13c09b4680d66 /drivers/md/dm-snap.c | |
parent | dm snapshot: lock snapshot while supplying status (diff) | |
download | linux-df96eee679ba28c98cf722fa7c9f4286ee1ed0bd.tar.xz linux-df96eee679ba28c98cf722fa7c9f4286ee1ed0bd.zip |
dm snapshot: use unsigned integer chunk size
Use unsigned integer chunk size.
Maximum chunk size is 512kB, there won't ever be need to use 4GB chunk size,
so the number can be 32-bit. This fixes compiler failure on 32-bit systems
with large block devices.
Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 9bc814aa2bbd..3a3ba46e6d4b 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -961,7 +961,7 @@ static void start_copy(struct dm_snap_pending_exception *pe) src.bdev = bdev; src.sector = chunk_to_sector(s->store, pe->e.old_chunk); - src.count = min(s->store->chunk_size, dev_size - src.sector); + src.count = min((sector_t)s->store->chunk_size, dev_size - src.sector); dest.bdev = s->store->cow->bdev; dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); @@ -1402,7 +1402,7 @@ static void origin_resume(struct dm_target *ti) struct dm_dev *dev = ti->private; struct dm_snapshot *snap; struct origin *o; - chunk_t chunk_size = 0; + unsigned chunk_size = 0; down_read(&_origins_lock); o = __lookup_origin(dev->bdev); |