1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o Get format-text.c compiling.

This commit is contained in:
Joe Thornber 2002-01-07 09:16:20 +00:00
parent e59204fc22
commit 3eb1b74b29
3 changed files with 12 additions and 10 deletions

View File

@ -32,6 +32,7 @@ SOURCES=\
format_text/backup.c \ format_text/backup.c \
format_text/export.c \ format_text/export.c \
format_text/flags.c \ format_text/flags.c \
format_text/format-text.c \
format_text/import.c \ format_text/import.c \
label/label.c \ label/label.c \
log/log.c \ log/log.c \

View File

@ -5,6 +5,7 @@
*/ */
#include "format-text.h" #include "format-text.h"
#include "import-export.h"
#include "log.h" #include "log.h"
#include "pool.h" #include "pool.h"
@ -43,19 +44,19 @@ int _pv_setup(struct format_instance *fi, struct physical_volume *pv,
struct volume_group *vg) struct volume_group *vg)
{ {
_not_written("_get_vgs"); _not_written("_get_vgs");
return NULL; return 0;
} }
int _pv_write(struct format_instance *fi, struct physical_volume *pv) int _pv_write(struct format_instance *fi, struct physical_volume *pv)
{ {
_not_written("_get_vgs"); _not_written("_get_vgs");
return NULL; return 0;
} }
int _vg_setup(struct format_instance *fi, struct volume_group *vg) int _vg_setup(struct format_instance *fi, struct volume_group *vg)
{ {
_not_written("_get_vgs"); _not_written("_get_vgs");
return NULL; return 0;
} }
struct volume_group *_vg_read(struct format_instance *fi, struct volume_group *_vg_read(struct format_instance *fi,
@ -86,7 +87,7 @@ int _vg_write(struct format_instance *fi, struct volume_group *vg)
void _destroy(struct format_instance *fi) void _destroy(struct format_instance *fi)
{ {
pool_free(cmd->mem, fi); pool_free(fi->cmd->mem, fi);
} }
static struct format_handler _text_handler = { static struct format_handler _text_handler = {
@ -107,22 +108,22 @@ struct format_instance *text_format_create(struct cmd_context *cmd,
const char *no_alloc = "Couldn't allocate text format object."; const char *no_alloc = "Couldn't allocate text format object.";
struct format_instance *fi; struct format_instance *fi;
char *file; char *path;
if (!(fi = pool_alloc(cmd->mem, sizeof(*fi)))) { if (!(fi = pool_alloc(cmd->mem, sizeof(*fi)))) {
log_err(no_alloc); log_err(no_alloc);
return NULL; return NULL;
} }
if (!(file = pool_strdup(cmd->mem, file))) { if (!(path = pool_strdup(cmd->mem, file))) {
pool_free(fi); pool_free(fi->cmd->mem, fi);
log_err(no_alloc); log_err(no_alloc);
return NULL; return NULL;
} }
fi->cmd = cmd; fi->cmd = cmd;
fi->ops = _text_handler; fi->ops = &_text_handler;
fi->private = file; fi->private = path;
return fi; return fi;
} }

View File

@ -342,7 +342,7 @@ static char *_generate_lv_name(struct volume_group *vg,
{ {
struct list *lvh; struct list *lvh;
struct logical_volume *lv; struct logical_volume *lv;
int high = -1, i, s; int high = -1, i;
list_iterate(lvh, &vg->lvs) { list_iterate(lvh, &vg->lvs) {
lv = &(list_item(lvh, struct lv_list)->lv); lv = &(list_item(lvh, struct lv_list)->lv);