From 4ee218cd67b385759993a6c840ea45f0ee0a8b30 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 27 Mar 2006 01:17:48 -0800 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/dm-stripe.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/md/dm-stripe.c') diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 697aacafb02..204f796ee9e 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -49,9 +49,9 @@ static inline struct stripe_c *alloc_context(unsigned int stripes) static int get_stripe(struct dm_target *ti, struct stripe_c *sc, unsigned int stripe, char **argv) { - sector_t start; + unsigned long long start; - if (sscanf(argv[1], SECTOR_FORMAT, &start) != 1) + if (sscanf(argv[1], "%llu", &start) != 1) return -EINVAL; if (dm_get_device(ti, argv[0], start, sc->stripe_width, @@ -201,10 +201,11 @@ static int stripe_status(struct dm_target *ti, break; case STATUSTYPE_TABLE: - DMEMIT("%d " SECTOR_FORMAT, sc->stripes, sc->chunk_mask + 1); + DMEMIT("%d %llu", sc->stripes, + (unsigned long long)sc->chunk_mask + 1); for (i = 0; i < sc->stripes; i++) - DMEMIT(" %s " SECTOR_FORMAT, sc->stripe[i].dev->name, - sc->stripe[i].physical_start); + DMEMIT(" %s %llu", sc->stripe[i].dev->name, + (unsigned long long)sc->stripe[i].physical_start); break; } return 0; -- cgit v1.2.3-70-g09d2