From da73b38d1a55b1ae6ba368d99fc6227069ec2d33 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 20 Jan 2005 18:12:41 +0000 Subject: [PATCH] Split out pool sptype_names to avoid unused const. --- WHATS_NEW | 1 + lib/format_pool/disk_rep.h | 23 ------------------ lib/format_pool/import_export.c | 1 + lib/format_pool/sptype_names.h | 42 +++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 lib/format_pool/sptype_names.h diff --git a/WHATS_NEW b/WHATS_NEW index e118c6731..86773d74e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.01.02 - =================================== + Split out pool sptype_names to avoid unused const. Always fail if random id generation fails. Recognise gnbd devices. diff --git a/lib/format_pool/disk_rep.h b/lib/format_pool/disk_rep.h index 8d09d9617..bf8983b61 100644 --- a/lib/format_pool/disk_rep.h +++ b/lib/format_pool/disk_rep.h @@ -66,29 +66,6 @@ struct pool_list; struct user_subpool; struct user_device; -/* This must be kept up to date with sistina/pool/module/pool_sptypes.h */ - -/* Generic Labels */ -#define SPTYPE_DATA (0x00000000) - -/* GFS specific labels */ -#define SPTYPE_GFS_DATA (0x68011670) -#define SPTYPE_GFS_JOURNAL (0x69011670) - -struct sptype_name { - const char *name; - uint32_t label; -}; - -static const struct sptype_name sptype_names[] = { - {"data", SPTYPE_DATA}, - - {"gfs_data", SPTYPE_GFS_DATA}, - {"gfs_journal", SPTYPE_GFS_JOURNAL}, - - {"", 0x0} /* This must be the last flag. */ -}; - struct pool_disk { uint64_t pl_magic; /* Pool magic number */ uint64_t pl_pool_id; /* Unique pool identifier */ diff --git a/lib/format_pool/import_export.c b/lib/format_pool/import_export.c index 58be67302..f67e955ec 100644 --- a/lib/format_pool/import_export.c +++ b/lib/format_pool/import_export.c @@ -19,6 +19,7 @@ #include "metadata.h" #include "lvmcache.h" #include "disk_rep.h" +#include "sptype_names.h" #include "lv_alloc.h" #include "str_list.h" #include "display.h" diff --git a/lib/format_pool/sptype_names.h b/lib/format_pool/sptype_names.h new file mode 100644 index 000000000..b6d2692b0 --- /dev/null +++ b/lib/format_pool/sptype_names.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved. + * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * + * This copyrighted material is made available to anyone wishing to use, + * modify, copy, or redistribute it subject to the terms and conditions + * of the GNU General Public License v.2. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef SPTYPE_NAMES_H +#define SPTYPE_NAMES_H + +/* This must be kept up to date with sistina/pool/module/pool_sptypes.h */ + +/* Generic Labels */ +#define SPTYPE_DATA (0x00000000) + +/* GFS specific labels */ +#define SPTYPE_GFS_DATA (0x68011670) +#define SPTYPE_GFS_JOURNAL (0x69011670) + +struct sptype_name { + const char *name; + uint32_t label; +}; + +static const struct sptype_name sptype_names[] = { + {"data", SPTYPE_DATA}, + + {"gfs_data", SPTYPE_GFS_DATA}, + {"gfs_journal", SPTYPE_GFS_JOURNAL}, + + {"", 0x0} /* This must be the last flag. */ +}; + +#endif