1 #define _FILE_OFFSET_BITS 64
2 #define __USE_FILE_OFFSET64
3 #define _XOPEN_SOURCE 500
12 #include <sys/ioctl.h>
13 #include <sys/types.h>
16 #include <uuid/uuid.h>
20 int main(int argc, char **argv)
28 while ((o = getopt(argc, argv, "o:")) != EOF)
31 if (strcmp("udev", optarg)) {
32 printf("Invalid output format %s\n", optarg);
43 for (i = 0; i < argc; i++) {
44 int fd = open(argv[i], O_RDONLY);
49 if (pread(fd, &sb, sizeof(sb), 4096) != sizeof(sb))
52 if (memcmp(sb.magic, bcache_magic, 16))
55 uuid_unparse(sb.uuid, uuid);
58 printf("ID_FS_UUID=%s\n"
60 "ID_FS_TYPE=bcache\n",
63 printf("%s: UUID=\"\" TYPE=\"bcache\"\n", uuid);