]> git.pld-linux.org Git - packages/gfs2.git/blame - gfs2-blkid.patch
- more notes
[packages/gfs2.git] / gfs2-blkid.patch
CommitLineData
25bbb966
JB
1--- cluster-2.03.10/gfs2/mkfs/main_mkfs.c.orig 2008-12-09 09:36:04.000000000 +0100
2+++ cluster-2.03.10/gfs2/mkfs/main_mkfs.c 2011-05-23 19:32:57.164084076 +0200
3@@ -12,10 +12,10 @@
4 #include <stdarg.h>
5 #include <mntent.h>
6
7+#include <blkid/blkid.h>
8 #include <linux/types.h>
9 #include "libgfs2.h"
10 #include "gfs2_mkfs.h"
11-#include "libvolume_id.h"
12
13 char *prog_name;
14
15@@ -258,33 +258,35 @@
16 static void are_you_sure(struct gfs2_sbd *sdp)
17 {
18 char input[32];
19- struct volume_id *vid = NULL;
20+ blkid_probe pr;
21 int fd;
22
23 fd = open(sdp->device_name, O_RDONLY);
24 if (fd < 0)
25 die("Error: device %s not found.\n", sdp->device_name);
26- vid = volume_id_open_fd(fd);
27- if (vid == NULL) {
28+ pr = blkid_new_probe();
29+ if (pr == NULL) {
30 close(fd);
31 die("error identifying the contents of %s: %s\n",
32 sdp->device_name, strerror(errno));
33 }
34 printf("This will destroy any data on %s.\n", sdp->device_name);
35- if (volume_id_probe_all(vid, 0, sdp->device_size) == 0) {
36+ blkid_probe_set_request(pr, BLKID_PROBREQ_TYPE | BLKID_PROBREQ_USAGE);
37+ if ((blkid_probe_set_device(pr, fd, 0, sdp->device_size) == 0) &&
38+ (blkid_do_safeprobe(pr) == 0)) {
39 const char *fstype, *fsusage;
40 int rc;
41
42- rc = volume_id_get_type(vid, &fstype);
43+ rc = blkid_probe_lookup_value(pr, "TYPE", &fstype, NULL);
44 if (rc) {
45- rc = volume_id_get_usage(vid, &fsusage);
46+ rc = blkid_probe_lookup_value(pr, "USAGE", &fsusage, NULL);
47 if (!rc || strncmp(fsusage, "other", 5) == 0)
48 fsusage = "partition";
49 printf(" It appears to contain a %s %s.\n", fstype,
50 fsusage);
51 }
52 }
53- volume_id_close(vid);
54+ blkid_free_probe(pr);
55 close(fd);
56 printf("\nAre you sure you want to proceed? [y/n] ");
57 fgets(input, 32, stdin);
58--- cluster-2.03.10/gfs2/mkfs/Makefile.orig 2011-05-23 18:20:05.000000000 +0200
59+++ cluster-2.03.10/gfs2/mkfs/Makefile 2011-05-23 18:21:26.757273752 +0200
60@@ -20,11 +20,10 @@
61 main_jadd.o
62
63 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
64-CFLAGS += -I${volidincdir}
65 CFLAGS += -I$(S)/../include -I$(S)/../libgfs2
66 CFLAGS += -I${incdir}
67
68-LDFLAGS += -L${volidlibdir} -lvolume_id
69+LDFLAGS += -lblkid
70 LDFLAGS += -L../libgfs2 -lgfs2
71
72
This page took 0.096834 seconds and 4 git commands to generate.