]>
Commit | Line | Data |
---|---|---|
4630a329 JB |
1 | --- cluster-2.03.10/gfs/gfs_mkfs/main.c.orig 2008-12-09 09:36:04.000000000 +0100 |
2 | +++ cluster-2.03.10/gfs/gfs_mkfs/main.c 2011-05-23 16:54:19.847098734 +0200 | |
3 | @@ -10,11 +10,11 @@ | |
4 | #include <assert.h> | |
5 | #include <time.h> | |
6 | #include <mntent.h> | |
7 | +#include <blkid/blkid.h> | |
8 | ||
9 | #include "global.h" | |
10 | #include "gfs_ondisk.h" | |
11 | #include "osi_list.h" | |
12 | -#include "libvolume_id.h" | |
13 | #include "libgfs.h" | |
14 | #include "copyright.cf" | |
15 | ||
16 | @@ -207,34 +207,36 @@ static void decode_arguments(int argc, c | |
17 | void are_you_sure(commandline_t *comline) | |
18 | { | |
19 | char input[32]; | |
20 | - struct volume_id *vid = NULL; | |
21 | + blkid_probe pr; | |
22 | int fd; | |
23 | ||
24 | fd = open(comline->device, O_RDONLY); | |
25 | if (fd < 0) | |
26 | die("Error: device %s not found.\n", comline->device); | |
27 | - vid = volume_id_open_fd(fd); | |
28 | - if (vid == NULL) { | |
29 | + pr = blkid_new_probe(); | |
30 | + if (pr == NULL) { | |
31 | close(fd); | |
32 | die("error identifying the contents of %s: %s\n", | |
33 | comline->device, strerror(errno)); | |
34 | } | |
35 | printf("This will destroy any data on %s.\n", | |
36 | comline->device); | |
37 | - if (volume_id_probe_all(vid, 0, MKFS_DEFAULT_BSIZE) == 0) { | |
38 | + blkid_probe_set_request(pr, BLKID_PROBREQ_TYPE | BLKID_PROBREQ_USAGE); | |
39 | + if ((blkid_probe_set_device(pr, fd, 0, MKFS_DEFAULT_BSIZE) == 0) && | |
40 | + (blkid_do_safeprobe(pr) == 0)) { | |
41 | const char *fstype, *fsusage; | |
42 | int rc; | |
43 | ||
44 | - rc = volume_id_get_type(vid, &fstype); | |
45 | + rc = blkid_probe_lookup_value(pr, "TYPE", &fstype, NULL); | |
46 | if (rc) { | |
47 | - rc = volume_id_get_usage(vid, &fsusage); | |
48 | + rc = blkid_probe_lookup_value(pr, "USAGE", &fsusage, NULL); | |
49 | if (!rc || strncmp(fsusage, "other", 5) == 0) | |
50 | fsusage = "partition"; | |
51 | printf(" It appears to contain a %s %s.\n", fstype, | |
52 | fsusage); | |
53 | } | |
54 | } | |
55 | - volume_id_close(vid); | |
56 | + blkid_free_probe(pr); | |
57 | close(fd); | |
58 | printf("\nAre you sure you want to proceed? [y/n] "); | |
59 | if (fgets(input, 32, stdin) == NULL || input[0] != 'y') | |
60 | --- cluster-2.03.10/gfs/gfs_mkfs/Makefile.orig 2008-12-09 09:36:04.000000000 +0100 | |
61 | +++ cluster-2.03.10/gfs/gfs_mkfs/Makefile 2011-05-23 16:54:37.883766007 +0200 | |
62 | @@ -24,7 +24,7 @@ CFLAGS += -I${gfskincdir} -I${volidincdi | |
63 | CFLAGS += -I$(S)/../include -I$(S)/../libgfs | |
64 | CFLAGS += -I${incdir} | |
65 | ||
66 | -LDFLAGS += -L${volidlibdir} -lvolume_id | |
67 | +LDFLAGS += -L${volidlibdir} -lblkid | |
68 | LDFLAGS += -L../libgfs -lgfs | |
69 | ||
70 |