Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24389
b: refs/heads/master
c: 4ee218c
h: refs/heads/master
i:
  24387: 07e50a7
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 27, 2006
1 parent fa59988 commit b0c2f61
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 930d332a23682202c07df0276dd665a57755b37d
refs/heads/master: 4ee218cd67b385759993a6c840ea45f0ee0a8b30
11 changes: 7 additions & 4 deletions trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
char *ivopts;
unsigned int crypto_flags;
unsigned int key_size;
unsigned long long tmpll;

if (argc != 5) {
ti->error = PFX "Not enough arguments";
Expand Down Expand Up @@ -633,15 +634,17 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad5;
}

if (sscanf(argv[2], SECTOR_FORMAT, &cc->iv_offset) != 1) {
if (sscanf(argv[2], "%llu", &tmpll) != 1) {
ti->error = PFX "Invalid iv_offset sector";
goto bad5;
}
cc->iv_offset = tmpll;

if (sscanf(argv[4], SECTOR_FORMAT, &cc->start) != 1) {
if (sscanf(argv[4], "%llu", &tmpll) != 1) {
ti->error = PFX "Invalid device sector";
goto bad5;
}
cc->start = tmpll;

if (dm_get_device(ti, argv[3], cc->start, ti->len,
dm_table_get_mode(ti->table), &cc->dev)) {
Expand Down Expand Up @@ -885,8 +888,8 @@ static int crypt_status(struct dm_target *ti, status_type_t type,
result[sz++] = '-';
}

DMEMIT(" " SECTOR_FORMAT " %s " SECTOR_FORMAT,
cc->iv_offset, cc->dev->name, cc->start);
DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
cc->dev->name, (unsigned long long)cc->start);
break;
}
return 0;
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/md/dm-linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 8 additions & 7 deletions trunk/drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,9 @@ static inline int _check_region_size(struct dm_target *ti, uint32_t size)
static int get_mirror(struct mirror_set *ms, struct dm_target *ti,
unsigned int mirror, char **argv)
{
sector_t offset;
unsigned long long offset;

if (sscanf(argv[1], SECTOR_FORMAT, &offset) != 1) {
if (sscanf(argv[1], "%llu", &offset) != 1) {
ti->error = "dm-mirror: Invalid offset";
return -EINVAL;
}
Expand Down Expand Up @@ -1203,16 +1203,17 @@ static int mirror_status(struct dm_target *ti, status_type_t type,
for (m = 0; m < ms->nr_mirrors; m++)
DMEMIT("%s ", ms->mirror[m].dev->name);

DMEMIT(SECTOR_FORMAT "/" SECTOR_FORMAT,
ms->rh.log->type->get_sync_count(ms->rh.log),
ms->nr_regions);
DMEMIT("%llu/%llu",
(unsigned long long)ms->rh.log->type->
get_sync_count(ms->rh.log),
(unsigned long long)ms->nr_regions);
break;

case STATUSTYPE_TABLE:
DMEMIT("%d ", ms->nr_mirrors);
for (m = 0; m < ms->nr_mirrors; m++)
DMEMIT("%s " SECTOR_FORMAT " ",
ms->mirror[m].dev->name, ms->mirror[m].offset);
DMEMIT("%s %llu ", ms->mirror[m].dev->name,
(unsigned long long)ms->mirror[m].offset);
}

return 0;
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
}

Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/md/dm-stripe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions trunk/drivers/md/dm.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@
#define DMEMIT(x...) sz += ((sz >= maxlen) ? \
0 : scnprintf(result + sz, maxlen - sz, x))

/*
* FIXME: I think this should be with the definition of sector_t
* in types.h.
*/
#ifdef CONFIG_LBD
#define SECTOR_FORMAT "%llu"
#else
#define SECTOR_FORMAT "%lu"
#endif

#define SECTOR_SHIFT 9

/*
Expand Down

0 comments on commit b0c2f61

Please sign in to comment.