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,31 +1185,28 @@ static int mirror_status(struct dm_target *ti, status_type_t type, ...@@ -1185,31 +1185,28 @@ static int mirror_status(struct dm_target *ti, status_type_t type,
unsigned int m, sz = 0; unsigned int m, sz = 0;
struct mirror_set *ms = (struct mirror_set *) ti->private; struct mirror_set *ms = (struct mirror_set *) ti->private;
#define EMIT(x...) sz += ((sz >= maxlen) ? \
0 : scnprintf(result + sz, maxlen - sz, x))
switch (type) { switch (type) {
case STATUSTYPE_INFO: case STATUSTYPE_INFO:
EMIT("%d ", ms->nr_mirrors); DMEMIT("%d ", ms->nr_mirrors);
for (m = 0; m < ms->nr_mirrors; m++) { for (m = 0; m < ms->nr_mirrors; m++) {
format_dev_t(buffer, ms->mirror[m].dev->bdev->bd_dev); format_dev_t(buffer, ms->mirror[m].dev->bdev->bd_dev);
EMIT("%s ", buffer); DMEMIT("%s ", buffer);
} }
EMIT(SECTOR_FORMAT "/" SECTOR_FORMAT, DMEMIT(SECTOR_FORMAT "/" SECTOR_FORMAT,
ms->rh.log->type->get_sync_count(ms->rh.log), ms->rh.log->type->get_sync_count(ms->rh.log),
ms->nr_regions); ms->nr_regions);
break; break;
case STATUSTYPE_TABLE: case STATUSTYPE_TABLE:
EMIT("%s 1 " SECTOR_FORMAT " %d ", DMEMIT("%s 1 " SECTOR_FORMAT " %d ",
ms->rh.log->type->name, ms->rh.region_size, ms->rh.log->type->name, ms->rh.region_size,
ms->nr_mirrors); ms->nr_mirrors);
for (m = 0; m < ms->nr_mirrors; m++) { for (m = 0; m < ms->nr_mirrors; m++) {
format_dev_t(buffer, ms->mirror[m].dev->bdev->bd_dev); format_dev_t(buffer, ms->mirror[m].dev->bdev->bd_dev);
EMIT("%s " SECTOR_FORMAT " ", DMEMIT("%s " SECTOR_FORMAT " ",
buffer, ms->mirror[m].offset); buffer, ms->mirror[m].offset);
} }
} }
......
...@@ -191,19 +191,16 @@ static int stripe_status(struct dm_target *ti, ...@@ -191,19 +191,16 @@ static int stripe_status(struct dm_target *ti,
unsigned int i; unsigned int i;
char buffer[32]; char buffer[32];
#define EMIT(x...) sz += ((sz >= maxlen) ? \
0 : scnprintf(result + sz, maxlen - sz, x))
switch (type) { switch (type) {
case STATUSTYPE_INFO: case STATUSTYPE_INFO:
result[0] = '\0'; result[0] = '\0';
break; break;
case STATUSTYPE_TABLE: 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++) { for (i = 0; i < sc->stripes; i++) {
format_dev_t(buffer, sc->stripe[i].dev->bdev->bd_dev); format_dev_t(buffer, sc->stripe[i].dev->bdev->bd_dev);
EMIT(" %s " SECTOR_FORMAT, buffer, DMEMIT(" %s " SECTOR_FORMAT, buffer,
sc->stripe[i].physical_start); sc->stripe[i].physical_start);
} }
break; break;
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
#define DMERR(f, x...) printk(KERN_ERR DM_NAME ": " f "\n" , ## x) #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 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 * FIXME: I think this should be with the definition of sector_t
* in types.h. * 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