aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-12-30 00:40:11 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-12-30 00:40:11 +0100
commit90615a0c5c326fa3cf78fc719f7b16207f47395a (patch)
treebdfee5d8916cc60e9e171b15b7adcc1f5460769a
parent2272129a93d9492a42ef43987f829940d26dc862 (diff)
downloadbusybox-w32-90615a0c5c326fa3cf78fc719f7b16207f47395a.tar.gz
busybox-w32-90615a0c5c326fa3cf78fc719f7b16207f47395a.tar.bz2
busybox-w32-90615a0c5c326fa3cf78fc719f7b16207f47395a.zip
blkid: optional support for TYPE="fstype"
Adapted from patch created by T4ndeta <t4ndeta@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/volume_id.h1
-rw-r--r--util-linux/Config.src7
-rw-r--r--util-linux/blkid.c7
-rw-r--r--util-linux/volume_id/cramfs.c2
-rw-r--r--util-linux/volume_id/ext.c10
-rw-r--r--util-linux/volume_id/fat.c2
-rw-r--r--util-linux/volume_id/get_devname.c59
-rw-r--r--util-linux/volume_id/hfs.c2
-rw-r--r--util-linux/volume_id/iso9660.c2
-rw-r--r--util-linux/volume_id/jfs.c2
-rw-r--r--util-linux/volume_id/linux_raid.c2
-rw-r--r--util-linux/volume_id/linux_swap.c2
-rw-r--r--util-linux/volume_id/luks.c2
-rw-r--r--util-linux/volume_id/ntfs.c2
-rw-r--r--util-linux/volume_id/ocfs2.c2
-rw-r--r--util-linux/volume_id/reiserfs.c2
-rw-r--r--util-linux/volume_id/romfs.c2
-rw-r--r--util-linux/volume_id/sysv.c4
-rw-r--r--util-linux/volume_id/udf.c3
-rw-r--r--util-linux/volume_id/volume_id_internal.h4
-rw-r--r--util-linux/volume_id/xfs.c2
21 files changed, 84 insertions, 37 deletions
diff --git a/include/volume_id.h b/include/volume_id.h
index 77e874d40..4a78cd1e4 100644
--- a/include/volume_id.h
+++ b/include/volume_id.h
@@ -28,3 +28,4 @@ void display_uuid_cache(void);
28 * *fsname is replaced if device with such UUID or LABEL is found 28 * *fsname is replaced if device with such UUID or LABEL is found
29 */ 29 */
30int resolve_mount_spec(char **fsname); 30int resolve_mount_spec(char **fsname);
31int add_to_uuid_cache(const char *device);
diff --git a/util-linux/Config.src b/util-linux/Config.src
index c71b4de38..dbf2b0d85 100644
--- a/util-linux/Config.src
+++ b/util-linux/Config.src
@@ -40,6 +40,13 @@ config BLKID
40 WARNING: 40 WARNING:
41 With all submodules selected, it will add ~8k to busybox. 41 With all submodules selected, it will add ~8k to busybox.
42 42
43config FEATURE_BLKID_TYPE
44 bool "Print filesystem type"
45 default n
46 depends on BLKID
47 help
48 Show TYPE="filesystem type"
49
43config DMESG 50config DMESG
44 bool "dmesg" 51 bool "dmesg"
45 default y 52 default y
diff --git a/util-linux/blkid.c b/util-linux/blkid.c
index 53f13a99c..fe88fb31d 100644
--- a/util-linux/blkid.c
+++ b/util-linux/blkid.c
@@ -13,8 +13,13 @@
13//TODO: extend to take BLOCKDEV args, and show TYPE="fstype" 13//TODO: extend to take BLOCKDEV args, and show TYPE="fstype"
14 14
15int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16int blkid_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 16int blkid_main(int argc UNUSED_PARAM, char **argv)
17{ 17{
18 while (*++argv) {
19 /* Note: bogus device names don't cause any error messages */
20 add_to_uuid_cache(*argv);
21 }
22
18 display_uuid_cache(); 23 display_uuid_cache();
19 return 0; 24 return 0;
20} 25}
diff --git a/util-linux/volume_id/cramfs.c b/util-linux/volume_id/cramfs.c
index b84a6f0b2..28e997043 100644
--- a/util-linux/volume_id/cramfs.c
+++ b/util-linux/volume_id/cramfs.c
@@ -51,7 +51,7 @@ int FAST_FUNC volume_id_probe_cramfs(struct volume_id *id /*,uint64_t off*/)
51 volume_id_set_label_string(id, cs->name, 16); 51 volume_id_set_label_string(id, cs->name, 16);
52 52
53// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 53// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
54// id->type = "cramfs"; 54 IF_FEATURE_BLKID_TYPE(id->type = "cramfs";)
55 return 0; 55 return 0;
56 } 56 }
57 57
diff --git a/util-linux/volume_id/ext.c b/util-linux/volume_id/ext.c
index 80c217f98..b5194a7b5 100644
--- a/util-linux/volume_id/ext.c
+++ b/util-linux/volume_id/ext.c
@@ -65,10 +65,12 @@ int FAST_FUNC volume_id_probe_ext(struct volume_id *id /*,uint64_t off*/)
65 volume_id_set_uuid(id, es->uuid, UUID_DCE); 65 volume_id_set_uuid(id, es->uuid, UUID_DCE);
66 dbg("ext: label '%s' uuid '%s'", id->label, id->uuid); 66 dbg("ext: label '%s' uuid '%s'", id->label, id->uuid);
67 67
68// if ((le32_to_cpu(es->feature_compat) & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) 68#if ENABLE_FEATURE_BLKID_TYPE
69// id->type = "ext3"; 69 if ((le32_to_cpu(es->feature_compat) & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0)
70// else 70 id->type = "ext3";
71// id->type = "ext2"; 71 else
72 id->type = "ext2";
73#endif
72 74
73 return 0; 75 return 0;
74} 76}
diff --git a/util-linux/volume_id/fat.c b/util-linux/volume_id/fat.c
index b0f427c74..904fbb201 100644
--- a/util-linux/volume_id/fat.c
+++ b/util-linux/volume_id/fat.c
@@ -332,7 +332,7 @@ int FAST_FUNC volume_id_probe_vfat(struct volume_id *id /*,uint64_t fat_partitio
332 332
333 ret: 333 ret:
334// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 334// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
335// id->type = "vfat"; 335 IF_FEATURE_BLKID_TYPE(id->type = "vfat";)
336 336
337 return 0; 337 return 0;
338} 338}
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c
index bf32e6a8c..7c9930543 100644
--- a/util-linux/volume_id/get_devname.c
+++ b/util-linux/volume_id/get_devname.c
@@ -19,14 +19,22 @@ static struct uuidCache_s {
19 char *device; 19 char *device;
20 char *label; 20 char *label;
21 char *uc_uuid; /* prefix makes it easier to grep for */ 21 char *uc_uuid; /* prefix makes it easier to grep for */
22 IF_FEATURE_BLKID_TYPE(const char *type;)
22} *uuidCache; 23} *uuidCache;
23 24
25#if !ENABLE_FEATURE_BLKID_TYPE
26#define get_label_uuid(fd, label, uuid, type) \
27 get_label_uuid(fd, label, uuid)
28#define uuidcache_addentry(device, label, uuid, type) \
29 uuidcache_addentry(device, label, uuid)
30#endif
31
24/* Returns !0 on error. 32/* Returns !0 on error.
25 * Otherwise, returns malloc'ed strings for label and uuid 33 * Otherwise, returns malloc'ed strings for label and uuid
26 * (and they can't be NULL, although they can be ""). 34 * (and they can't be NULL, although they can be "").
27 * NB: closes fd. */ 35 * NB: closes fd. */
28static int 36static int
29get_label_uuid(int fd, char **label, char **uuid) 37get_label_uuid(int fd, char **label, char **uuid, const char **type)
30{ 38{
31 int rv = 1; 39 int rv = 1;
32 uint64_t size; 40 uint64_t size;
@@ -44,7 +52,12 @@ get_label_uuid(int fd, char **label, char **uuid)
44 if (vid->label[0] != '\0' || vid->uuid[0] != '\0') { 52 if (vid->label[0] != '\0' || vid->uuid[0] != '\0') {
45 *label = xstrndup(vid->label, sizeof(vid->label)); 53 *label = xstrndup(vid->label, sizeof(vid->label));
46 *uuid = xstrndup(vid->uuid, sizeof(vid->uuid)); 54 *uuid = xstrndup(vid->uuid, sizeof(vid->uuid));
55#if ENABLE_FEATURE_BLKID_TYPE
56 *type = vid->type;
57 dbg("found label '%s', uuid '%s', type '%s'", *label, *uuid, *type);
58#else
47 dbg("found label '%s', uuid '%s'", *label, *uuid); 59 dbg("found label '%s', uuid '%s'", *label, *uuid);
60#endif
48 rv = 0; 61 rv = 0;
49 } 62 }
50 ret: 63 ret:
@@ -54,7 +67,7 @@ get_label_uuid(int fd, char **label, char **uuid)
54 67
55/* NB: we take ownership of (malloc'ed) label and uuid */ 68/* NB: we take ownership of (malloc'ed) label and uuid */
56static void 69static void
57uuidcache_addentry(char *device, /*int major, int minor,*/ char *label, char *uuid) 70uuidcache_addentry(char *device, /*int major, int minor,*/ char *label, char *uuid, const char *type)
58{ 71{
59 struct uuidCache_s *last; 72 struct uuidCache_s *last;
60 73
@@ -72,6 +85,7 @@ uuidcache_addentry(char *device, /*int major, int minor,*/ char *label, char *uu
72 last->device = device; 85 last->device = device;
73 last->label = label; 86 last->label = label;
74 last->uc_uuid = uuid; 87 last->uc_uuid = uuid;
88 IF_FEATURE_BLKID_TYPE(last->type = type;)
75} 89}
76 90
77/* If get_label_uuid() on device_name returns success, 91/* If get_label_uuid() on device_name returns success,
@@ -83,10 +97,6 @@ uuidcache_check_device(const char *device,
83 void *userData UNUSED_PARAM, 97 void *userData UNUSED_PARAM,
84 int depth UNUSED_PARAM) 98 int depth UNUSED_PARAM)
85{ 99{
86 char *uuid = uuid; /* for compiler */
87 char *label = label;
88 int fd;
89
90 /* note: this check rejects links to devices, among other nodes */ 100 /* note: this check rejects links to devices, among other nodes */
91 if (!S_ISBLK(statbuf->st_mode)) 101 if (!S_ISBLK(statbuf->st_mode))
92 return TRUE; 102 return TRUE;
@@ -99,21 +109,15 @@ uuidcache_check_device(const char *device,
99 if (major(statbuf->st_rdev) == 2) 109 if (major(statbuf->st_rdev) == 2)
100 return TRUE; 110 return TRUE;
101 111
102 fd = open(device, O_RDONLY); 112 add_to_uuid_cache(device);
103 if (fd < 0)
104 return TRUE;
105 113
106 /* get_label_uuid() closes fd in all cases (success & failure) */
107 if (get_label_uuid(fd, &label, &uuid) == 0) {
108 /* uuidcache_addentry() takes ownership of all three params */
109 uuidcache_addentry(xstrdup(device), /*ma, mi,*/ label, uuid);
110 }
111 return TRUE; 114 return TRUE;
112} 115}
113 116
114static void 117static void
115uuidcache_init(void) 118uuidcache_init(void)
116{ 119{
120 dbg("DBG: uuidCache=%x, uuidCache");
117 if (uuidCache) 121 if (uuidCache)
118 return; 122 return;
119 123
@@ -223,11 +227,38 @@ void display_uuid_cache(void)
223 printf(" LABEL=\"%s\"", u->label); 227 printf(" LABEL=\"%s\"", u->label);
224 if (u->uc_uuid[0]) 228 if (u->uc_uuid[0])
225 printf(" UUID=\"%s\"", u->uc_uuid); 229 printf(" UUID=\"%s\"", u->uc_uuid);
230#if ENABLE_FEATURE_BLKID_TYPE
231 if (u->type)
232 printf(" TYPE=\"%s\"", u->type);
233#endif
226 bb_putchar('\n'); 234 bb_putchar('\n');
227 u = u->next; 235 u = u->next;
228 } 236 }
229} 237}
230 238
239int add_to_uuid_cache(const char *device)
240{
241 char *uuid = uuid; /* for compiler */
242 char *label = label;
243#if ENABLE_FEATURE_BLKID_TYPE
244 const char *type = type;
245#endif
246 int fd;
247
248 fd = open(device, O_RDONLY);
249 if (fd < 0)
250 return 0;
251
252 /* get_label_uuid() closes fd in all cases (success & failure) */
253 if (get_label_uuid(fd, &label, &uuid, &type) == 0) {
254 /* uuidcache_addentry() takes ownership of all four params */
255 uuidcache_addentry(xstrdup(device), /*ma, mi,*/ label, uuid, type);
256 return 1;
257 }
258 return 0;
259}
260
261
231/* Used by mount and findfs */ 262/* Used by mount and findfs */
232 263
233char *get_devname_from_label(const char *spec) 264char *get_devname_from_label(const char *spec)
diff --git a/util-linux/volume_id/hfs.c b/util-linux/volume_id/hfs.c
index cf7585138..f3f19dba7 100644
--- a/util-linux/volume_id/hfs.c
+++ b/util-linux/volume_id/hfs.c
@@ -195,7 +195,7 @@ int FAST_FUNC volume_id_probe_hfs_hfsplus(struct volume_id *id /*,uint64_t off*/
195 195
196 volume_id_set_uuid(id, hfs->finder_info.id, UUID_HFS); 196 volume_id_set_uuid(id, hfs->finder_info.id, UUID_HFS);
197// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 197// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
198// id->type = "hfs"; 198 IF_FEATURE_BLKID_TYPE(id->type = "hfs";)
199 199
200 return 0; 200 return 0;
201 201
diff --git a/util-linux/volume_id/iso9660.c b/util-linux/volume_id/iso9660.c
index 1519de496..1d7693a9c 100644
--- a/util-linux/volume_id/iso9660.c
+++ b/util-linux/volume_id/iso9660.c
@@ -114,7 +114,7 @@ int FAST_FUNC volume_id_probe_iso9660(struct volume_id *id /*,uint64_t off*/)
114 114
115 found: 115 found:
116// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 116// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
117// id->type = "iso9660"; 117 IF_FEATURE_BLKID_TYPE(id->type = "iso9660";)
118 118
119 return 0; 119 return 0;
120} 120}
diff --git a/util-linux/volume_id/jfs.c b/util-linux/volume_id/jfs.c
index eb7a44872..5333af2c3 100644
--- a/util-linux/volume_id/jfs.c
+++ b/util-linux/volume_id/jfs.c
@@ -54,7 +54,7 @@ int FAST_FUNC volume_id_probe_jfs(struct volume_id *id /*,uint64_t off*/)
54 volume_id_set_uuid(id, js->uuid, UUID_DCE); 54 volume_id_set_uuid(id, js->uuid, UUID_DCE);
55 55
56// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 56// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
57// id->type = "jfs"; 57 IF_FEATURE_BLKID_TYPE(id->type = "jfs";)
58 58
59 return 0; 59 return 0;
60} 60}
diff --git a/util-linux/volume_id/linux_raid.c b/util-linux/volume_id/linux_raid.c
index e1c86369d..761e54f9f 100644
--- a/util-linux/volume_id/linux_raid.c
+++ b/util-linux/volume_id/linux_raid.c
@@ -75,7 +75,7 @@ int FAST_FUNC volume_id_probe_linux_raid(struct volume_id *id /*,uint64_t off*/,
75 75
76 dbg("found raid signature"); 76 dbg("found raid signature");
77// volume_id_set_usage(id, VOLUME_ID_RAID); 77// volume_id_set_usage(id, VOLUME_ID_RAID);
78// id->type = "linux_raid_member"; 78 IF_FEATURE_BLKID_TYPE(id->type = "linux_raid_member";)
79 79
80 return 0; 80 return 0;
81} 81}
diff --git a/util-linux/volume_id/linux_swap.c b/util-linux/volume_id/linux_swap.c
index 0aa43f3de..62d588522 100644
--- a/util-linux/volume_id/linux_swap.c
+++ b/util-linux/volume_id/linux_swap.c
@@ -73,7 +73,7 @@ int FAST_FUNC volume_id_probe_linux_swap(struct volume_id *id /*,uint64_t off*/)
73 73
74found: 74found:
75// volume_id_set_usage(id, VOLUME_ID_OTHER); 75// volume_id_set_usage(id, VOLUME_ID_OTHER);
76// id->type = "swap"; 76 IF_FEATURE_BLKID_TYPE(id->type = "swap";)
77 77
78 return 0; 78 return 0;
79} 79}
diff --git a/util-linux/volume_id/luks.c b/util-linux/volume_id/luks.c
index 8ab09e381..f9b376672 100644
--- a/util-linux/volume_id/luks.c
+++ b/util-linux/volume_id/luks.c
@@ -94,7 +94,7 @@ int FAST_FUNC volume_id_probe_luks(struct volume_id *id /*,uint64_t off*/)
94 94
95// volume_id_set_usage(id, VOLUME_ID_CRYPTO); 95// volume_id_set_usage(id, VOLUME_ID_CRYPTO);
96 volume_id_set_uuid(id, header->uuid, UUID_DCE_STRING); 96 volume_id_set_uuid(id, header->uuid, UUID_DCE_STRING);
97// id->type = "crypto_LUKS"; 97 IF_FEATURE_BLKID_TYPE(id->type = "crypto_LUKS";)
98 98
99 return 0; 99 return 0;
100} 100}
diff --git a/util-linux/volume_id/ntfs.c b/util-linux/volume_id/ntfs.c
index 17b1fe8b3..547f141c9 100644
--- a/util-linux/volume_id/ntfs.c
+++ b/util-linux/volume_id/ntfs.c
@@ -188,7 +188,7 @@ int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/)
188 188
189 found: 189 found:
190// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 190// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
191// id->type = "ntfs"; 191 IF_FEATURE_BLKID_TYPE(id->type = "ntfs";)
192 192
193 return 0; 193 return 0;
194} 194}
diff --git a/util-linux/volume_id/ocfs2.c b/util-linux/volume_id/ocfs2.c
index e6c455965..fcdb15192 100644
--- a/util-linux/volume_id/ocfs2.c
+++ b/util-linux/volume_id/ocfs2.c
@@ -101,6 +101,6 @@ int FAST_FUNC volume_id_probe_ocfs2(struct volume_id *id /*,uint64_t off*/)
101 volume_id_set_label_string(id, os->s_label, OCFS2_MAX_VOL_LABEL_LEN < VOLUME_ID_LABEL_SIZE ? 101 volume_id_set_label_string(id, os->s_label, OCFS2_MAX_VOL_LABEL_LEN < VOLUME_ID_LABEL_SIZE ?
102 OCFS2_MAX_VOL_LABEL_LEN : VOLUME_ID_LABEL_SIZE); 102 OCFS2_MAX_VOL_LABEL_LEN : VOLUME_ID_LABEL_SIZE);
103 volume_id_set_uuid(id, os->s_uuid, UUID_DCE); 103 volume_id_set_uuid(id, os->s_uuid, UUID_DCE);
104// id->type = "ocfs2"; 104 IF_FEATURE_BLKID_TYPE(id->type = "ocfs2";)
105 return 0; 105 return 0;
106} 106}
diff --git a/util-linux/volume_id/reiserfs.c b/util-linux/volume_id/reiserfs.c
index 3120b29a0..67b4a1877 100644
--- a/util-linux/volume_id/reiserfs.c
+++ b/util-linux/volume_id/reiserfs.c
@@ -107,7 +107,7 @@ int FAST_FUNC volume_id_probe_reiserfs(struct volume_id *id /*,uint64_t off*/)
107 107
108 found: 108 found:
109// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 109// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
110// id->type = "reiserfs"; 110 IF_FEATURE_BLKID_TYPE(id->type = "reiserfs";)
111 111
112 return 0; 112 return 0;
113} 113}
diff --git a/util-linux/volume_id/romfs.c b/util-linux/volume_id/romfs.c
index 228e77a41..15653bedf 100644
--- a/util-linux/volume_id/romfs.c
+++ b/util-linux/volume_id/romfs.c
@@ -47,7 +47,7 @@ int FAST_FUNC volume_id_probe_romfs(struct volume_id *id /*,uint64_t off*/)
47 } 47 }
48 48
49// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 49// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
50// id->type = "romfs"; 50 IF_FEATURE_BLKID_TYPE(id->type = "romfs";)
51 return 0; 51 return 0;
52 } 52 }
53 53
diff --git a/util-linux/volume_id/sysv.c b/util-linux/volume_id/sysv.c
index e0fa20a8c..6eb96464d 100644
--- a/util-linux/volume_id/sysv.c
+++ b/util-linux/volume_id/sysv.c
@@ -99,7 +99,7 @@ int FAST_FUNC volume_id_probe_sysv(struct volume_id *id /*,uint64_t off*/)
99 if (vs->s_magic == cpu_to_le32(SYSV_MAGIC) || vs->s_magic == cpu_to_be32(SYSV_MAGIC)) { 99 if (vs->s_magic == cpu_to_le32(SYSV_MAGIC) || vs->s_magic == cpu_to_be32(SYSV_MAGIC)) {
100// volume_id_set_label_raw(id, vs->s_fname, 6); 100// volume_id_set_label_raw(id, vs->s_fname, 6);
101 volume_id_set_label_string(id, vs->s_fname, 6); 101 volume_id_set_label_string(id, vs->s_fname, 6);
102// id->type = "sysv"; 102 IF_FEATURE_BLKID_TYPE(id->type = "sysv");
103 goto found; 103 goto found;
104 } 104 }
105 } 105 }
@@ -112,7 +112,7 @@ int FAST_FUNC volume_id_probe_sysv(struct volume_id *id /*,uint64_t off*/)
112 if (xs->s_magic == cpu_to_le32(XENIX_MAGIC) || xs->s_magic == cpu_to_be32(XENIX_MAGIC)) { 112 if (xs->s_magic == cpu_to_le32(XENIX_MAGIC) || xs->s_magic == cpu_to_be32(XENIX_MAGIC)) {
113// volume_id_set_label_raw(id, xs->s_fname, 6); 113// volume_id_set_label_raw(id, xs->s_fname, 6);
114 volume_id_set_label_string(id, xs->s_fname, 6); 114 volume_id_set_label_string(id, xs->s_fname, 6);
115// id->type = "xenix"; 115 IF_FEATURE_BLKID_TYPE(id->type = "xenix";)
116 goto found; 116 goto found;
117 } 117 }
118 } 118 }
diff --git a/util-linux/volume_id/udf.c b/util-linux/volume_id/udf.c
index dd2573171..cd63c8d8a 100644
--- a/util-linux/volume_id/udf.c
+++ b/util-linux/volume_id/udf.c
@@ -167,7 +167,6 @@ anchor:
167 167
168 found: 168 found:
169// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 169// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
170// id->type = "udf"; 170 IF_FEATURE_BLKID_TYPE(id->type = "udf";)
171
172 return 0; 171 return 0;
173} 172}
diff --git a/util-linux/volume_id/volume_id_internal.h b/util-linux/volume_id/volume_id_internal.h
index 9b808ff6b..1c64046e5 100644
--- a/util-linux/volume_id/volume_id_internal.h
+++ b/util-linux/volume_id/volume_id_internal.h
@@ -80,7 +80,9 @@ struct volume_id {
80// char type_version[VOLUME_ID_FORMAT_SIZE]; 80// char type_version[VOLUME_ID_FORMAT_SIZE];
81// smallint usage_id; 81// smallint usage_id;
82// const char *usage; 82// const char *usage;
83// const char *type; 83#if ENABLE_FEATURE_BLKID_TYPE
84 const char *type;
85#endif
84}; 86};
85 87
86struct volume_id* FAST_FUNC volume_id_open_node(int fd); 88struct volume_id* FAST_FUNC volume_id_open_node(int fd);
diff --git a/util-linux/volume_id/xfs.c b/util-linux/volume_id/xfs.c
index 1017d077b..84746020e 100644
--- a/util-linux/volume_id/xfs.c
+++ b/util-linux/volume_id/xfs.c
@@ -54,7 +54,7 @@ int FAST_FUNC volume_id_probe_xfs(struct volume_id *id /*,uint64_t off*/)
54 volume_id_set_uuid(id, xs->uuid, UUID_DCE); 54 volume_id_set_uuid(id, xs->uuid, UUID_DCE);
55 55
56// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 56// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
57// id->type = "xfs"; 57 IF_FEATURE_BLKID_TYPE(id->type = "xfs";)
58 58
59 return 0; 59 return 0;
60} 60}