]> sourceware.org Git - lvm2.git/commitdiff
Change and generalise struct format_instance for PV and VG use.
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 21 Feb 2011 12:01:22 +0000 (12:01 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 21 Feb 2011 12:01:22 +0000 (12:01 +0000)
lib/metadata/metadata-exported.h
lib/metadata/metadata.h

index 32f0ac3cc5347ba6dcdbb3f4f099c7eb869e0829..1bd5748dc3dc99b69af91cc66203bb1e3f6d40b7 100644 (file)
@@ -170,16 +170,48 @@ struct pv_segment {
 
 #define pvseg_is_allocated(pvseg) ((pvseg)->lvseg)
 
+/*
+ * These flags define the type of the format instance to be created.
+ * There are two basic types: a PV-based and a VG-based format instance.
+ * We can further control the format_instance initialisation and functionality
+ * by using the other flags. Today, the primary role of the format_instance
+ * is to temporarily store metadata area information we are working with. More
+ * flags can be defined to cover even more functionality in the future...
+ */
+
+/* PV-based format instance */
+#define FMT_INSTANCE_PV                0x00000000U
+
+/* VG-based format instance */
+#define FMT_INSTANCE_VG                0x00000001U
+
+/* Include any existing PV mdas during format_instance initialisation */
+#define FMT_INSTANCE_MDAS              0x00000002U
+
+/* Include any auxiliary mdas during format_instance intialisation */
+#define FMT_INSTANCE_AUX_MDAS          0x00000004U
+
+/* Include any other format-specific mdas during format_instance initialisation */
+#define FMT_INSTANCE_PRIVATE_MDAS      0x00000008U
+
 struct format_instance {
+       uint32_t type;
        const struct format_type *fmt;
+
        /*
         * Each mda in a vg is on exactly one of the below lists.
         * MDAs on the 'in_use' list will be read from / written to
         * disk, while MDAs on the 'ignored' list will not be read
         * or written to.
         */
+       /* FIXME: Try to use the index only. Remove these lists. */
        struct dm_list metadata_areas_in_use;
        struct dm_list metadata_areas_ignored;
+       union {
+               struct metadata_area **array;
+               struct dm_hash_table *hash;
+       } metadata_areas_index;
+
        void *private;
 };
 
index 3d51c5b80caf36c27ede9d6e740636c362e8dfc3..3e7f5a99711a5568b21b891400531601936707f6 100644 (file)
@@ -220,6 +220,18 @@ struct seg_list {
        struct lv_segment *seg;
 };
 
+struct format_instance_ctx {
+       uint32_t type;
+       union {
+               const char *pv_id;
+               struct {
+                       const char *vg_name;
+                       const char *vg_id;
+               } vg_ref;
+               void *private;
+       } context;
+};
+
 /*
  * Ownership of objects passes to caller.
  */
This page took 0.043129 seconds and 5 git commands to generate.