diff options
author | Andrew Morton | 2006-03-27 01:17:48 -0800 |
---|---|---|
committer | Linus Torvalds | 2006-03-27 08:44:58 -0800 |
commit | 4ee218cd67b385759993a6c840ea45f0ee0a8b30 (patch) | |
tree | 788d33b31e9d008eeb2de2a7f874e45b09695719 /drivers/md/dm-linear.c | |
parent | 930d332a23682202c07df0276dd665a57755b37d (diff) |
[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>
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r-- | drivers/md/dm-linear.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 6a2cd5dc8a63..daf586c0898d 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -26,6 +26,7 @@ struct linear_c { static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv) { struct linear_c *lc; + unsigned long long tmp; if (argc != 2) { ti->error = "dm-linear: Invalid argument count"; @@ -38,10 +39,11 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -ENOMEM; } - if (sscanf(argv[1], SECTOR_FORMAT, &lc->start) != 1) { + if (sscanf(argv[1], "%llu", &tmp) != 1) { ti->error = "dm-linear: Invalid device sector"; goto bad; } + lc->start = tmp; if (dm_get_device(ti, argv[0], lc->start, ti->len, dm_table_get_mode(ti->table), &lc->dev)) { @@ -87,8 +89,8 @@ static int linear_status(struct dm_target *ti, status_type_t type, break; case STATUSTYPE_TABLE: - snprintf(result, maxlen, "%s " SECTOR_FORMAT, lc->dev->name, - lc->start); + snprintf(result, maxlen, "%s %llu", lc->dev->name, + (unsigned long long)lc->start); break; } return 0; |