Commit 841faa00 authored by Alasdair G. Kergon's avatar Alasdair G. Kergon Committed by Linus Torvalds

[PATCH] device-mapper: rename emit macro

Rename EMIT macro to DMEMIT and move to header file.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e1a373db
......@@ -1185,32 +1185,29 @@ static int mirror_status(struct dm_target *ti, status_type_t type,
unsigned int m, sz = 0;
struct mirror_set *ms = (struct mirror_set *) ti->private;
#define EMIT(x...) sz += ((sz >= maxlen) ? \
0 : scnprintf(result + sz, maxlen - sz, x))
switch (type) {
case STATUSTYPE_INFO:
EMIT("%d ", ms->nr_mirrors);
DMEMIT("%d ", ms->nr_mirrors);
for (m = 0; m < ms->nr_mirrors; m++) {
format_dev_t(buffer, ms->mirror[m].dev->bdev->bd_dev);
EMIT("%s ", buffer);
DMEMIT("%s ", buffer);
}
EMIT(SECTOR_FORMAT "/" SECTOR_FORMAT,
ms->rh.log->type->get_sync_count(ms->rh.log),
ms->nr_regions);
DMEMIT(SECTOR_FORMAT "/" SECTOR_FORMAT,
ms->rh.log->type->get_sync_count(ms->rh.log),
ms->nr_regions);
break;
case STATUSTYPE_TABLE:
EMIT("%s 1 " SECTOR_FORMAT " %d ",
ms->rh.log->type->name, ms->rh.region_size,
ms->nr_mirrors);
DMEMIT("%s 1 " SECTOR_FORMAT " %d ",
ms->rh.log->type->name, ms->rh.region_size,
ms->nr_mirrors);
for (m = 0; m < ms->nr_mirrors; m++) {
format_dev_t(buffer, ms->mirror[m].dev->bdev->bd_dev);
EMIT("%s " SECTOR_FORMAT " ",
buffer, ms->mirror[m].offset);
DMEMIT("%s " SECTOR_FORMAT " ",
buffer, ms->mirror[m].offset);
}
}
......
......@@ -191,20 +191,17 @@ static int stripe_status(struct dm_target *ti,
unsigned int i;
char buffer[32];
#define EMIT(x...) sz += ((sz >= maxlen) ? \
0 : scnprintf(result + sz, maxlen - sz, x))
switch (type) {
case STATUSTYPE_INFO:
result[0] = '\0';
break;
case STATUSTYPE_TABLE:
EMIT("%d " SECTOR_FORMAT, sc->stripes, sc->chunk_mask + 1);
DMEMIT("%d " SECTOR_FORMAT, sc->stripes, sc->chunk_mask + 1);
for (i = 0; i < sc->stripes; i++) {
format_dev_t(buffer, sc->stripe[i].dev->bdev->bd_dev);
EMIT(" %s " SECTOR_FORMAT, buffer,
sc->stripe[i].physical_start);
DMEMIT(" %s " SECTOR_FORMAT, buffer,
sc->stripe[i].physical_start);
}
break;
}
......
......@@ -19,6 +19,9 @@
#define DMERR(f, x...) printk(KERN_ERR DM_NAME ": " f "\n" , ## x)
#define DMINFO(f, x...) printk(KERN_INFO DM_NAME ": " f "\n" , ## x)
#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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment