]> sourceware.org Git - lvm2.git/commitdiff
o change pv_read to take a name rather than a device
authorJoe Thornber <thornber@redhat.com>
Tue, 9 Oct 2001 16:05:34 +0000 (16:05 +0000)
committerJoe Thornber <thornber@redhat.com>
Tue, 9 Oct 2001 16:05:34 +0000 (16:05 +0000)
lib/activate/activate.c [new file with mode: 0644]
lib/activate/activate.h [new file with mode: 0644]
lib/format1/format1.c
lib/metadata/metadata.h
old-tests/format1/read_pv_t.c
old-tests/format1/read_vg_t.c

diff --git a/lib/activate/activate.c b/lib/activate/activate.c
new file mode 100644 (file)
index 0000000..a02514a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2001 Sistina Software (UK) Limited.
+ *
+ * This file is released under the GPL.
+ */
+
+#include "activate.h"
+
+struct kernel_interface {
+       int already_mounted;
+       char *mount_point;
+};
+
+/*
+ * Checks that device mapper has been compiled into the kernel.
+ */
+int _check_kernel(void)
+{
+       return 0;
+}
+
+int _find_mountpoint(char *buffer, int len)
+{
+       
+}
+
+
+
+int _
+
+int vg_activate(struct volume_group *vg)
+{
+       
+}
+
+int lv_activate(struct volume_group *vg, struct logical_volume *lv)
+{
+       
+}
+
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
new file mode 100644 (file)
index 0000000..34ff481
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2001 Sistina Software (UK) Limited.
+ *
+ * This file is released under the GPL.
+ */
+
+#ifndef ACTIVATE_H
+#define ACTIVATE_H
+
+int vg_activate(struct volume_group *vg);
+int lv_activate(struct volume_group *vg, struct logical_volume *lv);
+
+#endif
index 589fc202284fc6cbf7f3a8594a71fd7587a492e3..b8377bd31433573d7fbf2e6491076b2934e0d813 100644 (file)
@@ -166,17 +166,23 @@ static int _vg_write(struct io_space *is, struct volume_group *vg)
 }
 
 static struct physical_volume *_pv_read(struct io_space *is,
-                                       struct device *dev)
+                                       const char *name)
 {
        struct pool *mem = pool_create(1024);
        struct physical_volume *pv;
        struct disk_list *dl;
+       struct device *dev;
 
        if (!mem) {
                stack;
                return NULL;
        }
 
+       if (!(dev = dev_cache_get(name, is->filter))) {
+               stack;
+               goto bad;
+       }
+
        if (!(dl = read_pv(dev, mem, NULL))) {
                stack;
                goto bad;
index 7a250140179c0cd5c320ce4829e3701b5c630ba9..07d1241163ce444ca969dd03c76c1d59c651960e 100644 (file)
@@ -132,7 +132,7 @@ struct io_space {
        /* Return PV with given name (may be full
            or relative path) */
        struct physical_volume *(*pv_read)(struct io_space *is,
-                                          struct device *dev);
+                                          const char *name);
 
        /* Write a PV structure to disk. */
        /* Fails if the PV is in a VG ie
index 991d3835cb632d436b2e5c5aa0878f07c85c0a80..34cc74868228ad11e26b5f8d4ddfc465df611285 100644 (file)
@@ -50,12 +50,7 @@ int main(int argc, char **argv)
                exit(1);
        }
 
-       if (!(dev = dev_cache_get(argv[1], NULL))) {
-               fprintf(stderr, "couldn't get device %s\n", argv[1]);
-               exit(1);
-       }
-
-       pv = ios->pv_read(ios, dev);
+       pv = ios->pv_read(ios, argv[1]);
 
        if (!pv) {
                fprintf(stderr, "couldn't read pv %s\n", dev->name);
index a5c93a2a6afcd3f589e210d9d0ee637b89e00329..ca700b9ac4f2869c1e9d475bb05a929b7915c000 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
                exit(1);
        }
 
-       if (!dev_cache_add_dir("/dev/loop")) {
+       if (!dev_cache_add_dir("/dev/")) {
                fprintf(stderr, "couldn't add /dev to dir-cache\n");
                exit(1);
        }
This page took 0.036839 seconds and 5 git commands to generate.