aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/blkid
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/blkid')
-rw-r--r--e2fsprogs/blkid/blkid.h8
-rw-r--r--e2fsprogs/blkid/blkid_getsize.c2
-rw-r--r--e2fsprogs/blkid/cache.c10
-rw-r--r--e2fsprogs/blkid/dev.c2
-rw-r--r--e2fsprogs/blkid/devname.c4
-rw-r--r--e2fsprogs/blkid/devno.c4
-rw-r--r--e2fsprogs/blkid/probe.c98
-rw-r--r--e2fsprogs/blkid/probe.h12
-rw-r--r--e2fsprogs/blkid/read.c4
-rw-r--r--e2fsprogs/blkid/resolve.c4
-rw-r--r--e2fsprogs/blkid/save.c2
-rw-r--r--e2fsprogs/blkid/tag.c18
12 files changed, 84 insertions, 84 deletions
diff --git a/e2fsprogs/blkid/blkid.h b/e2fsprogs/blkid/blkid.h
index 3ea94ac80..3bb0e78d8 100644
--- a/e2fsprogs/blkid/blkid.h
+++ b/e2fsprogs/blkid/blkid.h
@@ -34,13 +34,13 @@ typedef struct blkid_struct_dev_iterate *blkid_dev_iterate;
34 * Flags for blkid_get_dev 34 * Flags for blkid_get_dev
35 * 35 *
36 * BLKID_DEV_CREATE Create an empty device structure if not found 36 * BLKID_DEV_CREATE Create an empty device structure if not found
37 * in the cache. 37 * in the cache.
38 * BLKID_DEV_VERIFY Make sure the device structure corresponds 38 * BLKID_DEV_VERIFY Make sure the device structure corresponds
39 * with reality. 39 * with reality.
40 * BLKID_DEV_FIND Just look up a device entry, and return NULL 40 * BLKID_DEV_FIND Just look up a device entry, and return NULL
41 * if it is not found. 41 * if it is not found.
42 * BLKID_DEV_NORMAL Get a valid device structure, either from the 42 * BLKID_DEV_NORMAL Get a valid device structure, either from the
43 * cache or by probing the device. 43 * cache or by probing the device.
44 */ 44 */
45#define BLKID_DEV_FIND 0x0000 45#define BLKID_DEV_FIND 0x0000
46#define BLKID_DEV_CREATE 0x0001 46#define BLKID_DEV_CREATE 0x0001
diff --git a/e2fsprogs/blkid/blkid_getsize.c b/e2fsprogs/blkid/blkid_getsize.c
index 9458c08bf..58cc7352a 100644
--- a/e2fsprogs/blkid/blkid_getsize.c
+++ b/e2fsprogs/blkid/blkid_getsize.c
@@ -70,7 +70,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
70{ 70{
71 int valid_blkgetsize64 = 1; 71 int valid_blkgetsize64 = 1;
72#ifdef __linux__ 72#ifdef __linux__
73 struct utsname ut; 73 struct utsname ut;
74#endif 74#endif
75 unsigned long long size64; 75 unsigned long long size64;
76 unsigned long size; 76 unsigned long size;
diff --git a/e2fsprogs/blkid/cache.c b/e2fsprogs/blkid/cache.c
index 0dd1b6286..87be1269f 100644
--- a/e2fsprogs/blkid/cache.c
+++ b/e2fsprogs/blkid/cache.c
@@ -47,9 +47,9 @@ int blkid_get_cache(blkid_cache *ret_cache, const char *filename)
47 if (!filename) 47 if (!filename)
48 filename = BLKID_CACHE_FILE; 48 filename = BLKID_CACHE_FILE;
49 cache->bic_filename = blkid_strdup(filename); 49 cache->bic_filename = blkid_strdup(filename);
50 50
51 blkid_read_cache(cache); 51 blkid_read_cache(cache);
52 52
53 *ret_cache = cache; 53 *ret_cache = cache;
54 return 0; 54 return 0;
55} 55}
@@ -62,7 +62,7 @@ void blkid_put_cache(blkid_cache cache)
62 (void) blkid_flush_cache(cache); 62 (void) blkid_flush_cache(cache);
63 63
64 DBG(DEBUG_CACHE, printf("freeing cache struct\n")); 64 DBG(DEBUG_CACHE, printf("freeing cache struct\n"));
65 65
66 /* DEB_DUMP_CACHE(cache); */ 66 /* DEB_DUMP_CACHE(cache); */
67 67
68 while (!list_empty(&cache->bic_devs)) { 68 while (!list_empty(&cache->bic_devs)) {
@@ -79,7 +79,7 @@ void blkid_put_cache(blkid_cache cache)
79 79
80 while (!list_empty(&tag->bit_names)) { 80 while (!list_empty(&tag->bit_names)) {
81 blkid_tag bad = list_entry(tag->bit_names.next, 81 blkid_tag bad = list_entry(tag->bit_names.next,
82 struct blkid_struct_tag, 82 struct blkid_struct_tag,
83 bit_names); 83 bit_names);
84 84
85 DBG(DEBUG_CACHE, printf("warning: unfreed tag %s=%s\n", 85 DBG(DEBUG_CACHE, printf("warning: unfreed tag %s=%s\n",
@@ -90,7 +90,7 @@ void blkid_put_cache(blkid_cache cache)
90 } 90 }
91 if (cache->bic_filename) 91 if (cache->bic_filename)
92 free(cache->bic_filename); 92 free(cache->bic_filename);
93 93
94 free(cache); 94 free(cache);
95} 95}
96 96
diff --git a/e2fsprogs/blkid/dev.c b/e2fsprogs/blkid/dev.c
index 0e2b4e1bc..d2e468304 100644
--- a/e2fsprogs/blkid/dev.c
+++ b/e2fsprogs/blkid/dev.c
@@ -73,7 +73,7 @@ extern const char *blkid_dev_devname(blkid_dev dev)
73 * This series of functions iterate over all devices in a blkid cache 73 * This series of functions iterate over all devices in a blkid cache
74 */ 74 */
75#define DEV_ITERATE_MAGIC 0x01a5284c 75#define DEV_ITERATE_MAGIC 0x01a5284c
76 76
77struct blkid_struct_dev_iterate { 77struct blkid_struct_dev_iterate {
78 int magic; 78 int magic;
79 blkid_cache cache; 79 blkid_cache cache;
diff --git a/e2fsprogs/blkid/devname.c b/e2fsprogs/blkid/devname.c
index b5db29e30..1e016a55d 100644
--- a/e2fsprogs/blkid/devname.c
+++ b/e2fsprogs/blkid/devname.c
@@ -54,7 +54,7 @@ blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags)
54 if (strcmp(tmp->bid_name, devname)) 54 if (strcmp(tmp->bid_name, devname))
55 continue; 55 continue;
56 56
57 DBG(DEBUG_DEVNAME, 57 DBG(DEBUG_DEVNAME,
58 printf("found devname %s in cache\n", tmp->bid_name)); 58 printf("found devname %s in cache\n", tmp->bid_name));
59 dev = tmp; 59 dev = tmp;
60 break; 60 break;
@@ -113,7 +113,7 @@ static void probe_one(blkid_cache cache, const char *ptname,
113 dev->bid_devno == devno) 113 dev->bid_devno == devno)
114 goto set_pri; 114 goto set_pri;
115 115
116 if (stat(device, &st) == 0 && S_ISBLK(st.st_mode) && 116 if (stat(device, &st) == 0 && S_ISBLK(st.st_mode) &&
117 st.st_rdev == devno) { 117 st.st_rdev == devno) {
118 devname = blkid_strdup(device); 118 devname = blkid_strdup(device);
119 break; 119 break;
diff --git a/e2fsprogs/blkid/devno.c b/e2fsprogs/blkid/devno.c
index 93a57fd86..7d083e76f 100644
--- a/e2fsprogs/blkid/devno.c
+++ b/e2fsprogs/blkid/devno.c
@@ -171,13 +171,13 @@ char *blkid_devno_to_devname(dev_t devno)
171 171
172 if (!devname) { 172 if (!devname) {
173 DBG(DEBUG_DEVNO, 173 DBG(DEBUG_DEVNO,
174 printf("blkid: couldn't find devno 0x%04lx\n", 174 printf("blkid: couldn't find devno 0x%04lx\n",
175 (unsigned long) devno)); 175 (unsigned long) devno));
176 } else { 176 } else {
177 DBG(DEBUG_DEVNO, 177 DBG(DEBUG_DEVNO,
178 printf("found devno 0x%04Lx as %s\n", devno, devname)); 178 printf("found devno 0x%04Lx as %s\n", devno, devname));
179 } 179 }
180 180
181 181
182 return devname; 182 return devname;
183} 183}
diff --git a/e2fsprogs/blkid/probe.c b/e2fsprogs/blkid/probe.c
index cb21c1070..2aaa50885 100644
--- a/e2fsprogs/blkid/probe.c
+++ b/e2fsprogs/blkid/probe.c
@@ -41,7 +41,7 @@ static int check_mdraid(int fd, unsigned char *ret_uuid)
41 struct mdp_superblock_s *md; 41 struct mdp_superblock_s *md;
42 blkid_loff_t offset; 42 blkid_loff_t offset;
43 char buf[4096]; 43 char buf[4096];
44 44
45 if (fd < 0) 45 if (fd < 0)
46 return -BLKID_ERR_PARAM; 46 return -BLKID_ERR_PARAM;
47 47
@@ -83,7 +83,7 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf)
83 struct ext2_super_block *es = (struct ext2_super_block *) buf; 83 struct ext2_super_block *es = (struct ext2_super_block *) buf;
84 const char *label = 0; 84 const char *label = 0;
85 85
86 DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n", 86 DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n",
87 blkid_le32(es->s_feature_compat), 87 blkid_le32(es->s_feature_compat),
88 blkid_le32(es->s_feature_incompat), 88 blkid_le32(es->s_feature_incompat),
89 blkid_le32(es->s_feature_ro_compat))); 89 blkid_le32(es->s_feature_ro_compat)));
@@ -95,8 +95,8 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf)
95 set_uuid(dev, es->s_uuid); 95 set_uuid(dev, es->s_uuid);
96} 96}
97 97
98static int probe_ext3(int fd __BLKID_ATTR((unused)), 98static int probe_ext3(int fd __BLKID_ATTR((unused)),
99 blkid_cache cache __BLKID_ATTR((unused)), 99 blkid_cache cache __BLKID_ATTR((unused)),
100 blkid_dev dev, 100 blkid_dev dev,
101 const struct blkid_magic *id, unsigned char *buf) 101 const struct blkid_magic *id, unsigned char *buf)
102{ 102{
@@ -105,7 +105,7 @@ static int probe_ext3(int fd __BLKID_ATTR((unused)),
105 es = (struct ext2_super_block *)buf; 105 es = (struct ext2_super_block *)buf;
106 106
107 /* Distinguish between jbd and ext2/3 fs */ 107 /* Distinguish between jbd and ext2/3 fs */
108 if (blkid_le32(es->s_feature_incompat) & 108 if (blkid_le32(es->s_feature_incompat) &
109 EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) 109 EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
110 return -BLKID_ERR_PARAM; 110 return -BLKID_ERR_PARAM;
111 111
@@ -121,8 +121,8 @@ static int probe_ext3(int fd __BLKID_ATTR((unused)),
121 return 0; 121 return 0;
122} 122}
123 123
124static int probe_ext2(int fd __BLKID_ATTR((unused)), 124static int probe_ext2(int fd __BLKID_ATTR((unused)),
125 blkid_cache cache __BLKID_ATTR((unused)), 125 blkid_cache cache __BLKID_ATTR((unused)),
126 blkid_dev dev, 126 blkid_dev dev,
127 const struct blkid_magic *id, unsigned char *buf) 127 const struct blkid_magic *id, unsigned char *buf)
128{ 128{
@@ -132,7 +132,7 @@ static int probe_ext2(int fd __BLKID_ATTR((unused)),
132 es = (struct ext2_super_block *)buf; 132 es = (struct ext2_super_block *)buf;
133 133
134 /* Distinguish between jbd and ext2/3 fs */ 134 /* Distinguish between jbd and ext2/3 fs */
135 if (blkid_le32(es->s_feature_incompat) & 135 if (blkid_le32(es->s_feature_incompat) &
136 EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) 136 EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
137 return -BLKID_ERR_PARAM; 137 return -BLKID_ERR_PARAM;
138 138
@@ -141,10 +141,10 @@ static int probe_ext2(int fd __BLKID_ATTR((unused)),
141 return 0; 141 return 0;
142} 142}
143 143
144static int probe_jbd(int fd __BLKID_ATTR((unused)), 144static int probe_jbd(int fd __BLKID_ATTR((unused)),
145 blkid_cache cache __BLKID_ATTR((unused)), 145 blkid_cache cache __BLKID_ATTR((unused)),
146 blkid_dev dev, 146 blkid_dev dev,
147 const struct blkid_magic *id __BLKID_ATTR((unused)), 147 const struct blkid_magic *id __BLKID_ATTR((unused)),
148 unsigned char *buf) 148 unsigned char *buf)
149{ 149{
150 struct ext2_super_block *es = (struct ext2_super_block *) buf; 150 struct ext2_super_block *es = (struct ext2_super_block *) buf;
@@ -158,10 +158,10 @@ static int probe_jbd(int fd __BLKID_ATTR((unused)),
158 return 0; 158 return 0;
159} 159}
160 160
161static int probe_vfat(int fd __BLKID_ATTR((unused)), 161static int probe_vfat(int fd __BLKID_ATTR((unused)),
162 blkid_cache cache __BLKID_ATTR((unused)), 162 blkid_cache cache __BLKID_ATTR((unused)),
163 blkid_dev dev, 163 blkid_dev dev,
164 const struct blkid_magic *id __BLKID_ATTR((unused)), 164 const struct blkid_magic *id __BLKID_ATTR((unused)),
165 unsigned char *buf) 165 unsigned char *buf)
166{ 166{
167 struct vfat_super_block *vs; 167 struct vfat_super_block *vs;
@@ -191,10 +191,10 @@ static int probe_vfat(int fd __BLKID_ATTR((unused)),
191 return 0; 191 return 0;
192} 192}
193 193
194static int probe_msdos(int fd __BLKID_ATTR((unused)), 194static int probe_msdos(int fd __BLKID_ATTR((unused)),
195 blkid_cache cache __BLKID_ATTR((unused)), 195 blkid_cache cache __BLKID_ATTR((unused)),
196 blkid_dev dev, 196 blkid_dev dev,
197 const struct blkid_magic *id __BLKID_ATTR((unused)), 197 const struct blkid_magic *id __BLKID_ATTR((unused)),
198 unsigned char *buf) 198 unsigned char *buf)
199{ 199{
200 struct msdos_super_block *ms = (struct msdos_super_block *) buf; 200 struct msdos_super_block *ms = (struct msdos_super_block *) buf;
@@ -223,10 +223,10 @@ static int probe_msdos(int fd __BLKID_ATTR((unused)),
223 return 0; 223 return 0;
224} 224}
225 225
226static int probe_xfs(int fd __BLKID_ATTR((unused)), 226static int probe_xfs(int fd __BLKID_ATTR((unused)),
227 blkid_cache cache __BLKID_ATTR((unused)), 227 blkid_cache cache __BLKID_ATTR((unused)),
228 blkid_dev dev, 228 blkid_dev dev,
229 const struct blkid_magic *id __BLKID_ATTR((unused)), 229 const struct blkid_magic *id __BLKID_ATTR((unused)),
230 unsigned char *buf) 230 unsigned char *buf)
231{ 231{
232 struct xfs_super_block *xs; 232 struct xfs_super_block *xs;
@@ -241,8 +241,8 @@ static int probe_xfs(int fd __BLKID_ATTR((unused)),
241 return 0; 241 return 0;
242} 242}
243 243
244static int probe_reiserfs(int fd __BLKID_ATTR((unused)), 244static int probe_reiserfs(int fd __BLKID_ATTR((unused)),
245 blkid_cache cache __BLKID_ATTR((unused)), 245 blkid_cache cache __BLKID_ATTR((unused)),
246 blkid_dev dev, 246 blkid_dev dev,
247 const struct blkid_magic *id, unsigned char *buf) 247 const struct blkid_magic *id, unsigned char *buf)
248{ 248{
@@ -268,10 +268,10 @@ static int probe_reiserfs(int fd __BLKID_ATTR((unused)),
268 return 0; 268 return 0;
269} 269}
270 270
271static int probe_jfs(int fd __BLKID_ATTR((unused)), 271static int probe_jfs(int fd __BLKID_ATTR((unused)),
272 blkid_cache cache __BLKID_ATTR((unused)), 272 blkid_cache cache __BLKID_ATTR((unused)),
273 blkid_dev dev, 273 blkid_dev dev,
274 const struct blkid_magic *id __BLKID_ATTR((unused)), 274 const struct blkid_magic *id __BLKID_ATTR((unused)),
275 unsigned char *buf) 275 unsigned char *buf)
276{ 276{
277 struct jfs_super_block *js; 277 struct jfs_super_block *js;
@@ -286,10 +286,10 @@ static int probe_jfs(int fd __BLKID_ATTR((unused)),
286 return 0; 286 return 0;
287} 287}
288 288
289static int probe_romfs(int fd __BLKID_ATTR((unused)), 289static int probe_romfs(int fd __BLKID_ATTR((unused)),
290 blkid_cache cache __BLKID_ATTR((unused)), 290 blkid_cache cache __BLKID_ATTR((unused)),
291 blkid_dev dev, 291 blkid_dev dev,
292 const struct blkid_magic *id __BLKID_ATTR((unused)), 292 const struct blkid_magic *id __BLKID_ATTR((unused)),
293 unsigned char *buf) 293 unsigned char *buf)
294{ 294{
295 struct romfs_super_block *ros; 295 struct romfs_super_block *ros;
@@ -340,7 +340,7 @@ static int probe_swap1(int fd,
340 /* arbitrary sanity check.. is there any garbage down there? */ 340 /* arbitrary sanity check.. is there any garbage down there? */
341 if (sws->sws_pad[32] == 0 && sws->sws_pad[33] == 0) { 341 if (sws->sws_pad[32] == 0 && sws->sws_pad[33] == 0) {
342 if (sws->sws_volume[0]) 342 if (sws->sws_volume[0])
343 blkid_set_tag(dev, "LABEL", sws->sws_volume, 343 blkid_set_tag(dev, "LABEL", sws->sws_volume,
344 sizeof(sws->sws_volume)); 344 sizeof(sws->sws_volume));
345 if (sws->sws_uuid[0]) 345 if (sws->sws_uuid[0])
346 set_uuid(dev, sws->sws_uuid); 346 set_uuid(dev, sws->sws_uuid);
@@ -354,9 +354,9 @@ static const char
354* const udf_magic[] = { "BEA01", "BOOT2", "CD001", "CDW02", "NSR02", 354* const udf_magic[] = { "BEA01", "BOOT2", "CD001", "CDW02", "NSR02",
355 "NSR03", "TEA01", 0 }; 355 "NSR03", "TEA01", 0 };
356 356
357static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)), 357static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)),
358 blkid_dev dev __BLKID_ATTR((unused)), 358 blkid_dev dev __BLKID_ATTR((unused)),
359 const struct blkid_magic *id __BLKID_ATTR((unused)), 359 const struct blkid_magic *id __BLKID_ATTR((unused)),
360 unsigned char *buf __BLKID_ATTR((unused))) 360 unsigned char *buf __BLKID_ATTR((unused)))
361{ 361{
362 int j, bs; 362 int j, bs;
@@ -396,10 +396,10 @@ static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)),
396 return 1; 396 return 1;
397} 397}
398 398
399static int probe_ocfs(int fd __BLKID_ATTR((unused)), 399static int probe_ocfs(int fd __BLKID_ATTR((unused)),
400 blkid_cache cache __BLKID_ATTR((unused)), 400 blkid_cache cache __BLKID_ATTR((unused)),
401 blkid_dev dev, 401 blkid_dev dev,
402 const struct blkid_magic *id __BLKID_ATTR((unused)), 402 const struct blkid_magic *id __BLKID_ATTR((unused)),
403 unsigned char *buf) 403 unsigned char *buf)
404{ 404{
405 struct ocfs_volume_header ovh; 405 struct ocfs_volume_header ovh;
@@ -414,17 +414,17 @@ static int probe_ocfs(int fd __BLKID_ATTR((unused)),
414 blkid_set_tag(dev,"SEC_TYPE","ocfs1",sizeof("ocfs1")); 414 blkid_set_tag(dev,"SEC_TYPE","ocfs1",sizeof("ocfs1"));
415 else if (major >= 9) 415 else if (major >= 9)
416 blkid_set_tag(dev,"SEC_TYPE","ntocfs",sizeof("ntocfs")); 416 blkid_set_tag(dev,"SEC_TYPE","ntocfs",sizeof("ntocfs"));
417 417
418 blkid_set_tag(dev, "LABEL", ovl.label, ocfslabellen(ovl)); 418 blkid_set_tag(dev, "LABEL", ovl.label, ocfslabellen(ovl));
419 blkid_set_tag(dev, "MOUNT", ovh.mount, ocfsmountlen(ovh)); 419 blkid_set_tag(dev, "MOUNT", ovh.mount, ocfsmountlen(ovh));
420 set_uuid(dev, ovl.vol_id); 420 set_uuid(dev, ovl.vol_id);
421 return 0; 421 return 0;
422} 422}
423 423
424static int probe_ocfs2(int fd __BLKID_ATTR((unused)), 424static int probe_ocfs2(int fd __BLKID_ATTR((unused)),
425 blkid_cache cache __BLKID_ATTR((unused)), 425 blkid_cache cache __BLKID_ATTR((unused)),
426 blkid_dev dev, 426 blkid_dev dev,
427 const struct blkid_magic *id __BLKID_ATTR((unused)), 427 const struct blkid_magic *id __BLKID_ATTR((unused)),
428 unsigned char *buf) 428 unsigned char *buf)
429{ 429{
430 struct ocfs2_super_block *osb; 430 struct ocfs2_super_block *osb;
@@ -436,10 +436,10 @@ static int probe_ocfs2(int fd __BLKID_ATTR((unused)),
436 return 0; 436 return 0;
437} 437}
438 438
439static int probe_oracleasm(int fd __BLKID_ATTR((unused)), 439static int probe_oracleasm(int fd __BLKID_ATTR((unused)),
440 blkid_cache cache __BLKID_ATTR((unused)), 440 blkid_cache cache __BLKID_ATTR((unused)),
441 blkid_dev dev, 441 blkid_dev dev,
442 const struct blkid_magic *id __BLKID_ATTR((unused)), 442 const struct blkid_magic *id __BLKID_ATTR((unused)),
443 unsigned char *buf) 443 unsigned char *buf)
444{ 444{
445 struct oracle_asm_disk_label *dl; 445 struct oracle_asm_disk_label *dl;
@@ -548,13 +548,13 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
548 diff = now - dev->bid_time; 548 diff = now - dev->bid_time;
549 549
550 if ((now < dev->bid_time) || 550 if ((now < dev->bid_time) ||
551 (diff < BLKID_PROBE_MIN) || 551 (diff < BLKID_PROBE_MIN) ||
552 (dev->bid_flags & BLKID_BID_FL_VERIFIED && 552 (dev->bid_flags & BLKID_BID_FL_VERIFIED &&
553 diff < BLKID_PROBE_INTERVAL)) 553 diff < BLKID_PROBE_INTERVAL))
554 return dev; 554 return dev;
555 555
556 DBG(DEBUG_PROBE, 556 DBG(DEBUG_PROBE,
557 printf("need to revalidate %s (time since last check %lu)\n", 557 printf("need to revalidate %s (time since last check %lu)\n",
558 dev->bid_name, diff)); 558 dev->bid_name, diff));
559 559
560 if (((fd = open(dev->bid_name, O_RDONLY)) < 0) || 560 if (((fd = open(dev->bid_name, O_RDONLY)) < 0) ||
@@ -571,12 +571,12 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
571 } 571 }
572 572
573 memset(bufs, 0, sizeof(bufs)); 573 memset(bufs, 0, sizeof(bufs));
574 574
575 /* 575 /*
576 * Iterate over the type array. If we already know the type, 576 * Iterate over the type array. If we already know the type,
577 * then try that first. If it doesn't work, then blow away 577 * then try that first. If it doesn't work, then blow away
578 * the type information, and try again. 578 * the type information, and try again.
579 * 579 *
580 */ 580 */
581try_again: 581try_again:
582 type = 0; 582 type = 0;
@@ -637,7 +637,7 @@ try_again:
637 blkid_free_dev(dev); 637 blkid_free_dev(dev);
638 return NULL; 638 return NULL;
639 } 639 }
640 640
641found_type: 641found_type:
642 if (dev && type) { 642 if (dev && type) {
643 dev->bid_devno = st.st_rdev; 643 dev->bid_devno = st.st_rdev;
@@ -646,7 +646,7 @@ found_type:
646 cache->bic_flags |= BLKID_BIC_FL_CHANGED; 646 cache->bic_flags |= BLKID_BIC_FL_CHANGED;
647 647
648 blkid_set_tag(dev, "TYPE", type, 0); 648 blkid_set_tag(dev, "TYPE", type, 0);
649 649
650 DBG(DEBUG_PROBE, printf("%s: devno 0x%04Lx, type %s\n", 650 DBG(DEBUG_PROBE, printf("%s: devno 0x%04Lx, type %s\n",
651 dev->bid_name, st.st_rdev, type)); 651 dev->bid_name, st.st_rdev, type));
652 } 652 }
@@ -696,7 +696,7 @@ int main(int argc, char **argv)
696 printf("\tlabel is '%s'\n", dev->bid_label); 696 printf("\tlabel is '%s'\n", dev->bid_label);
697 if (dev->bid_uuid) 697 if (dev->bid_uuid)
698 printf("\tuuid is %s\n", dev->bid_uuid); 698 printf("\tuuid is %s\n", dev->bid_uuid);
699 699
700 blkid_free_dev(dev); 700 blkid_free_dev(dev);
701 return (0); 701 return (0);
702} 702}
diff --git a/e2fsprogs/blkid/probe.h b/e2fsprogs/blkid/probe.h
index 10af5d518..530b8efe2 100644
--- a/e2fsprogs/blkid/probe.h
+++ b/e2fsprogs/blkid/probe.h
@@ -18,7 +18,7 @@
18 18
19struct blkid_magic; 19struct blkid_magic;
20 20
21typedef int (*blkid_probe_t)(int fd, blkid_cache cache, blkid_dev dev, 21typedef int (*blkid_probe_t)(int fd, blkid_cache cache, blkid_dev dev,
22 const struct blkid_magic *id, unsigned char *buf); 22 const struct blkid_magic *id, unsigned char *buf);
23 23
24struct blkid_magic { 24struct blkid_magic {
@@ -222,16 +222,16 @@ struct ocfs_volume_header {
222 222
223struct ocfs_volume_label { 223struct ocfs_volume_label {
224 unsigned char disk_lock[48]; 224 unsigned char disk_lock[48];
225 unsigned char label[64]; 225 unsigned char label[64];
226 unsigned char label_len[2]; 226 unsigned char label_len[2];
227 unsigned char vol_id[16]; 227 unsigned char vol_id[16];
228 unsigned char vol_id_len[2]; 228 unsigned char vol_id_len[2];
229}; 229};
230 230
231#define ocfsmajor(o) ((__u32)o.major_version[0] \ 231#define ocfsmajor(o) ((__u32)o.major_version[0] \
232 + (((__u32) o.major_version[1]) << 8) \ 232 + (((__u32) o.major_version[1]) << 8) \
233 + (((__u32) o.major_version[2]) << 16) \ 233 + (((__u32) o.major_version[2]) << 16) \
234 + (((__u32) o.major_version[3]) << 24)) 234 + (((__u32) o.major_version[3]) << 24))
235#define ocfslabellen(o) ((__u32)o.label_len[0] + (((__u32) o.label_len[1]) << 8)) 235#define ocfslabellen(o) ((__u32)o.label_len[0] + (((__u32) o.label_len[1]) << 8))
236#define ocfsmountlen(o) ((__u32)o.mount_len[0] + (((__u32) o.mount_len[1])<<8)) 236#define ocfsmountlen(o) ((__u32)o.mount_len[0] + (((__u32) o.mount_len[1])<<8))
237 237
@@ -334,7 +334,7 @@ _INLINE_ __u64 blkid_swab64(__u64 val)
334 return (blkid_swab32(val >> 32) | 334 return (blkid_swab32(val >> 32) |
335 (((__u64) blkid_swab32(val & 0xFFFFFFFFUL)) << 32)); 335 (((__u64) blkid_swab32(val & 0xFFFFFFFFUL)) << 32));
336} 336}
337#endif 337#endif
338 338
339 339
340 340
diff --git a/e2fsprogs/blkid/read.c b/e2fsprogs/blkid/read.c
index 78464145d..08a3162f3 100644
--- a/e2fsprogs/blkid/read.c
+++ b/e2fsprogs/blkid/read.c
@@ -302,7 +302,7 @@ static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp)
302 return ret; 302 return ret;
303 303
304 /* Some tags are stored directly in the device struct */ 304 /* Some tags are stored directly in the device struct */
305 if (!strcmp(name, "DEVNO")) 305 if (!strcmp(name, "DEVNO"))
306 dev->bid_devno = STRTOULL(value, 0, 0); 306 dev->bid_devno = STRTOULL(value, 0, 0);
307 else if (!strcmp(name, "PRI")) 307 else if (!strcmp(name, "PRI"))
308 dev->bid_pri = strtol(value, 0, 0); 308 dev->bid_pri = strtol(value, 0, 0);
@@ -389,7 +389,7 @@ void blkid_read_cache(blkid_cache cache)
389 cache->bic_filename)); 389 cache->bic_filename));
390 goto errout; 390 goto errout;
391 } 391 }
392 392
393 DBG(DEBUG_CACHE, printf("reading cache file %s\n", 393 DBG(DEBUG_CACHE, printf("reading cache file %s\n",
394 cache->bic_filename)); 394 cache->bic_filename));
395 395
diff --git a/e2fsprogs/blkid/resolve.c b/e2fsprogs/blkid/resolve.c
index 625782d44..591b63057 100644
--- a/e2fsprogs/blkid/resolve.c
+++ b/e2fsprogs/blkid/resolve.c
@@ -69,7 +69,7 @@ char *blkid_get_devname(blkid_cache cache, const char *token,
69 69
70 if (!token) 70 if (!token)
71 return NULL; 71 return NULL;
72 72
73 if (!cache) { 73 if (!cache) {
74 if (blkid_get_cache(&c, NULL) < 0) 74 if (blkid_get_cache(&c, NULL) < 0)
75 return NULL; 75 return NULL;
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
125 fprintf(stderr, "Couldn't get blkid cache\n"); 125 fprintf(stderr, "Couldn't get blkid cache\n");
126 exit(1); 126 exit(1);
127 } 127 }
128 128
129 if (argv[2]) { 129 if (argv[2]) {
130 value = blkid_get_tag_value(cache, argv[1], argv[2]); 130 value = blkid_get_tag_value(cache, argv[1], argv[2]);
131 printf("%s has tag %s=%s\n", argv[2], argv[1], 131 printf("%s has tag %s=%s\n", argv[2], argv[1],
diff --git a/e2fsprogs/blkid/save.c b/e2fsprogs/blkid/save.c
index 3fba2450a..cc406ebfb 100644
--- a/e2fsprogs/blkid/save.c
+++ b/e2fsprogs/blkid/save.c
@@ -176,7 +176,7 @@ int main(int argc, char **argv)
176 exit(1); 176 exit(1);
177 } 177 }
178 cache->bic_filename = blkid_strdup(argv[1]); 178 cache->bic_filename = blkid_strdup(argv[1]);
179 179
180 if ((ret = blkid_flush_cache(cache)) < 0) { 180 if ((ret = blkid_flush_cache(cache)) < 0) {
181 fprintf(stderr, "error (%d) saving cache\n", ret); 181 fprintf(stderr, "error (%d) saving cache\n", ret);
182 exit(1); 182 exit(1);
diff --git a/e2fsprogs/blkid/tag.c b/e2fsprogs/blkid/tag.c
index 699d0fb46..e2c785cf0 100644
--- a/e2fsprogs/blkid/tag.c
+++ b/e2fsprogs/blkid/tag.c
@@ -96,7 +96,7 @@ static blkid_tag blkid_find_head_cache(blkid_cache cache, const char *type)
96 96
97/* 97/*
98 * Set a tag on an existing device. 98 * Set a tag on an existing device.
99 * 99 *
100 * If value is NULL, then delete the tagsfrom the device. 100 * If value is NULL, then delete the tagsfrom the device.
101 */ 101 */
102int blkid_set_tag(blkid_dev dev, const char *name, 102int blkid_set_tag(blkid_dev dev, const char *name,
@@ -131,7 +131,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
131 t->bit_dev = dev; 131 t->bit_dev = dev;
132 132
133 list_add_tail(&t->bit_tags, &dev->bid_tags); 133 list_add_tail(&t->bit_tags, &dev->bid_tags);
134 134
135 if (dev->bid_cache) { 135 if (dev->bid_cache) {
136 head = blkid_find_head_cache(dev->bid_cache, 136 head = blkid_find_head_cache(dev->bid_cache,
137 t->bit_name); 137 t->bit_name);
@@ -151,7 +151,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
151 list_add_tail(&t->bit_names, &head->bit_names); 151 list_add_tail(&t->bit_names, &head->bit_names);
152 } 152 }
153 } 153 }
154 154
155 /* Link common tags directly to the device struct */ 155 /* Link common tags directly to the device struct */
156 if (!strcmp(name, "TYPE")) 156 if (!strcmp(name, "TYPE"))
157 dev->bid_type = val; 157 dev->bid_type = val;
@@ -159,7 +159,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
159 dev->bid_label = val; 159 dev->bid_label = val;
160 else if (!strcmp(name, "UUID")) 160 else if (!strcmp(name, "UUID"))
161 dev->bid_uuid = val; 161 dev->bid_uuid = val;
162 162
163 if (dev->bid_cache) 163 if (dev->bid_cache)
164 dev->bid_cache->bic_flags |= BLKID_BIC_FL_CHANGED; 164 dev->bid_cache->bic_flags |= BLKID_BIC_FL_CHANGED;
165 return 0; 165 return 0;
@@ -235,7 +235,7 @@ errout:
235 * This series of functions iterate over all tags in a device 235 * This series of functions iterate over all tags in a device
236 */ 236 */
237#define TAG_ITERATE_MAGIC 0x01a5284c 237#define TAG_ITERATE_MAGIC 0x01a5284c
238 238
239struct blkid_struct_tag_iterate { 239struct blkid_struct_tag_iterate {
240 int magic; 240 int magic;
241 blkid_dev dev; 241 blkid_dev dev;
@@ -260,7 +260,7 @@ extern int blkid_tag_next(blkid_tag_iterate iter,
260 const char **type, const char **value) 260 const char **type, const char **value)
261{ 261{
262 blkid_tag tag; 262 blkid_tag tag;
263 263
264 *type = 0; 264 *type = 0;
265 *value = 0; 265 *value = 0;
266 if (!iter || iter->magic != TAG_ITERATE_MAGIC || 266 if (!iter || iter->magic != TAG_ITERATE_MAGIC ||
@@ -303,9 +303,9 @@ extern blkid_dev blkid_find_dev_with_tag(blkid_cache cache,
303 return NULL; 303 return NULL;
304 304
305 blkid_read_cache(cache); 305 blkid_read_cache(cache);
306 306
307 DBG(DEBUG_TAG, printf("looking for %s=%s in cache\n", type, value)); 307 DBG(DEBUG_TAG, printf("looking for %s=%s in cache\n", type, value));
308 308
309try_again: 309try_again:
310 pri = -1; 310 pri = -1;
311 dev = 0; 311 dev = 0;
@@ -313,7 +313,7 @@ try_again:
313 313
314 if (head) { 314 if (head) {
315 list_for_each(p, &head->bit_names) { 315 list_for_each(p, &head->bit_names) {
316 blkid_tag tmp = list_entry(p, struct blkid_struct_tag, 316 blkid_tag tmp = list_entry(p, struct blkid_struct_tag,
317 bit_names); 317 bit_names);
318 318
319 if (!strcmp(tmp->bit_val, value) && 319 if (!strcmp(tmp->bit_val, value) &&