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. Signed-off-by: Mikulas Patocka --- drivers/md/dm-exception-store.c | 2 +- drivers/md/dm-snap.c | 6 +++--- drivers/md/dm-snap.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) Index: linux-2.6.28-rc5-devel/drivers/md/dm-snap.c =================================================================== --- linux-2.6.28-rc5-devel.orig/drivers/md/dm-snap.c 2008-11-25 16:10:30.000000000 +0100 +++ linux-2.6.28-rc5-devel/drivers/md/dm-snap.c 2008-11-25 16:10:37.000000000 +0100 @@ -495,7 +495,7 @@ static int init_hash_tables(struct dm_sn return 0; } -char *dm_snapshot_set_chunk_size(struct dm_snapshot *s, chunk_t chunk_size) +char *dm_snapshot_set_chunk_size(struct dm_snapshot *s, unsigned chunk_size) { if (!is_power_of_2(chunk_size)) { return "Chunk size is not a power of 2"; @@ -924,7 +924,7 @@ static void start_copy(struct dm_snap_pe src.bdev = bdev; src.sector = chunk_to_sector(s, pe->e.old_chunk); - src.count = min(s->chunk_size, dev_size - src.sector); + src.count = min((sector_t)s->chunk_size, dev_size - src.sector); dest.bdev = s->cow->bdev; dest.sector = chunk_to_sector(s, pe->e.new_chunk); @@ -1317,7 +1317,7 @@ static void origin_resume(struct dm_targ 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); Index: linux-2.6.28-rc5-devel/drivers/md/dm-snap.h =================================================================== --- linux-2.6.28-rc5-devel.orig/drivers/md/dm-snap.h 2008-11-25 16:10:34.000000000 +0100 +++ linux-2.6.28-rc5-devel/drivers/md/dm-snap.h 2008-11-25 16:10:37.000000000 +0100 @@ -145,9 +145,9 @@ struct dm_snapshot { struct list_head list; /* Size of data blocks saved - must be a power of 2 */ - chunk_t chunk_size; - chunk_t chunk_mask; - chunk_t chunk_shift; + unsigned chunk_size; + unsigned chunk_mask; + unsigned chunk_shift; /* You can't use a snapshot if this is 0 (e.g. if full) */ int valid; @@ -208,7 +208,7 @@ static inline sector_t chunk_to_sector(s return chunk << s->chunk_shift; } -char *dm_snapshot_set_chunk_size(struct dm_snapshot *s, chunk_t chunk_size); +char *dm_snapshot_set_chunk_size(struct dm_snapshot *s, unsigned chunk_size); static inline int bdev_equal(struct block_device *lhs, struct block_device *rhs) { Index: linux-2.6.28-rc5-devel/drivers/md/dm-exception-store.c =================================================================== --- linux-2.6.28-rc5-devel.orig/drivers/md/dm-exception-store.c 2008-11-25 16:10:30.000000000 +0100 +++ linux-2.6.28-rc5-devel/drivers/md/dm-exception-store.c 2008-11-25 16:10:37.000000000 +0100 @@ -275,7 +275,7 @@ static int read_header(struct pstore *ps int r; char *e; struct disk_header *dh; - chunk_t chunk_size; + unsigned chunk_size; int chunk_size_supplied = 1; /*