[PATCH] dm: remove SECTOR_FORMAT

We don't know what type sector_t has.  Sometimes it's unsigned long, sometimes
it's unsigned long long.  For example on ppc64 it's unsigned long with
CONFIG_LBD=n and on x86_64 it's unsigned long long with CONFIG_LBD=n.

The way to handle all of this is to always use unsigned long long and to
always typecast the sector_t when printing it.

Acked-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Andrew Morton
2006-03-27 01:17:48 -08:00
committed by Linus Torvalds
parent 930d332a23
commit 4ee218cd67
6 changed files with 32 additions and 34 deletions

View File

@@ -959,9 +959,9 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
snap->store.fraction_full(&snap->store,
&numerator,
&denominator);
snprintf(result, maxlen,
SECTOR_FORMAT "/" SECTOR_FORMAT,
numerator, denominator);
snprintf(result, maxlen, "%llu/%llu",
(unsigned long long)numerator,
(unsigned long long)denominator);
}
else
snprintf(result, maxlen, "Unknown");
@@ -974,9 +974,10 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
* to make private copies if the output is to
* make sense.
*/
snprintf(result, maxlen, "%s %s %c " SECTOR_FORMAT,
snprintf(result, maxlen, "%s %s %c %llu",
snap->origin->name, snap->cow->name,
snap->type, snap->chunk_size);
snap->type,
(unsigned long long)snap->chunk_size);
break;
}