diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-10-16 18:18:17 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-10-16 18:18:17 -0400 |
commit | df96eee679ba28c98cf722fa7c9f4286ee1ed0bd (patch) | |
tree | 282c1368f3dff6ed0e0994210cc13c09b4680d66 /drivers/md/dm-snap-persistent.c | |
parent | 4c6fff445d7aa753957856278d4d93bcad6e2c14 (diff) |
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-persistent.c')
-rw-r--r-- | drivers/md/dm-snap-persistent.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index d5b2e08750d5..0c746420c008 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
@@ -284,12 +284,13 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
284 | { | 284 | { |
285 | int r; | 285 | int r; |
286 | struct disk_header *dh; | 286 | struct disk_header *dh; |
287 | chunk_t chunk_size; | 287 | unsigned chunk_size; |
288 | int chunk_size_supplied = 1; | 288 | int chunk_size_supplied = 1; |
289 | char *chunk_err; | 289 | char *chunk_err; |
290 | 290 | ||
291 | /* | 291 | /* |
292 | * Use default chunk size (or hardsect_size, if larger) if none supplied | 292 | * Use default chunk size (or logical_block_size, if larger) |
293 | * if none supplied | ||
293 | */ | 294 | */ |
294 | if (!ps->store->chunk_size) { | 295 | if (!ps->store->chunk_size) { |
295 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, | 296 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, |
@@ -334,10 +335,9 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
334 | return 0; | 335 | return 0; |
335 | 336 | ||
336 | if (chunk_size_supplied) | 337 | if (chunk_size_supplied) |
337 | DMWARN("chunk size %llu in device metadata overrides " | 338 | DMWARN("chunk size %u in device metadata overrides " |
338 | "table chunk size of %llu.", | 339 | "table chunk size of %u.", |
339 | (unsigned long long)chunk_size, | 340 | chunk_size, ps->store->chunk_size); |
340 | (unsigned long long)ps->store->chunk_size); | ||
341 | 341 | ||
342 | /* We had a bogus chunk_size. Fix stuff up. */ | 342 | /* We had a bogus chunk_size. Fix stuff up. */ |
343 | free_area(ps); | 343 | free_area(ps); |
@@ -345,8 +345,8 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
345 | r = dm_exception_store_set_chunk_size(ps->store, chunk_size, | 345 | r = dm_exception_store_set_chunk_size(ps->store, chunk_size, |
346 | &chunk_err); | 346 | &chunk_err); |
347 | if (r) { | 347 | if (r) { |
348 | DMERR("invalid on-disk chunk size %llu: %s.", | 348 | DMERR("invalid on-disk chunk size %u: %s.", |
349 | (unsigned long long)chunk_size, chunk_err); | 349 | chunk_size, chunk_err); |
350 | return r; | 350 | return r; |
351 | } | 351 | } |
352 | 352 | ||