aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/blkid/probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/blkid/probe.c')
-rw-r--r--e2fsprogs/blkid/probe.c98
1 files changed, 49 insertions, 49 deletions
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)
struct mdp_superblock_s *md;
blkid_loff_t offset;
char buf[4096];
-
+
if (fd < 0)
return -BLKID_ERR_PARAM;
@@ -83,7 +83,7 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf)
struct ext2_super_block *es = (struct ext2_super_block *) buf;
const char *label = 0;
- DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n",
+ DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n",
blkid_le32(es->s_feature_compat),
blkid_le32(es->s_feature_incompat),
blkid_le32(es->s_feature_ro_compat)));
@@ -95,8 +95,8 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf)
set_uuid(dev, es->s_uuid);
}
-static int probe_ext3(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_ext3(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
const struct blkid_magic *id, unsigned char *buf)
{
@@ -105,7 +105,7 @@ static int probe_ext3(int fd __BLKID_ATTR((unused)),
es = (struct ext2_super_block *)buf;
/* Distinguish between jbd and ext2/3 fs */
- if (blkid_le32(es->s_feature_incompat) &
+ if (blkid_le32(es->s_feature_incompat) &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
return -BLKID_ERR_PARAM;
@@ -121,8 +121,8 @@ static int probe_ext3(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_ext2(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_ext2(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
const struct blkid_magic *id, unsigned char *buf)
{
@@ -132,7 +132,7 @@ static int probe_ext2(int fd __BLKID_ATTR((unused)),
es = (struct ext2_super_block *)buf;
/* Distinguish between jbd and ext2/3 fs */
- if (blkid_le32(es->s_feature_incompat) &
+ if (blkid_le32(es->s_feature_incompat) &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
return -BLKID_ERR_PARAM;
@@ -141,10 +141,10 @@ static int probe_ext2(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_jbd(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
- blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+static int probe_jbd(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
+ blkid_dev dev,
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct ext2_super_block *es = (struct ext2_super_block *) buf;
@@ -158,10 +158,10 @@ static int probe_jbd(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_vfat(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_vfat(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct vfat_super_block *vs;
@@ -191,10 +191,10 @@ static int probe_vfat(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_msdos(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_msdos(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct msdos_super_block *ms = (struct msdos_super_block *) buf;
@@ -223,10 +223,10 @@ static int probe_msdos(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_xfs(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_xfs(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct xfs_super_block *xs;
@@ -241,8 +241,8 @@ static int probe_xfs(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_reiserfs(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_reiserfs(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
const struct blkid_magic *id, unsigned char *buf)
{
@@ -268,10 +268,10 @@ static int probe_reiserfs(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_jfs(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_jfs(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct jfs_super_block *js;
@@ -286,10 +286,10 @@ static int probe_jfs(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_romfs(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_romfs(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct romfs_super_block *ros;
@@ -340,7 +340,7 @@ static int probe_swap1(int fd,
/* arbitrary sanity check.. is there any garbage down there? */
if (sws->sws_pad[32] == 0 && sws->sws_pad[33] == 0) {
if (sws->sws_volume[0])
- blkid_set_tag(dev, "LABEL", sws->sws_volume,
+ blkid_set_tag(dev, "LABEL", sws->sws_volume,
sizeof(sws->sws_volume));
if (sws->sws_uuid[0])
set_uuid(dev, sws->sws_uuid);
@@ -354,9 +354,9 @@ static const char
* const udf_magic[] = { "BEA01", "BOOT2", "CD001", "CDW02", "NSR02",
"NSR03", "TEA01", 0 };
-static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev __BLKID_ATTR((unused)),
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf __BLKID_ATTR((unused)))
{
int j, bs;
@@ -396,10 +396,10 @@ static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)),
return 1;
}
-static int probe_ocfs(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_ocfs(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct ocfs_volume_header ovh;
@@ -414,17 +414,17 @@ static int probe_ocfs(int fd __BLKID_ATTR((unused)),
blkid_set_tag(dev,"SEC_TYPE","ocfs1",sizeof("ocfs1"));
else if (major >= 9)
blkid_set_tag(dev,"SEC_TYPE","ntocfs",sizeof("ntocfs"));
-
+
blkid_set_tag(dev, "LABEL", ovl.label, ocfslabellen(ovl));
blkid_set_tag(dev, "MOUNT", ovh.mount, ocfsmountlen(ovh));
set_uuid(dev, ovl.vol_id);
return 0;
}
-static int probe_ocfs2(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_ocfs2(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct ocfs2_super_block *osb;
@@ -436,10 +436,10 @@ static int probe_ocfs2(int fd __BLKID_ATTR((unused)),
return 0;
}
-static int probe_oracleasm(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
+static int probe_oracleasm(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
blkid_dev dev,
- const struct blkid_magic *id __BLKID_ATTR((unused)),
+ const struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf)
{
struct oracle_asm_disk_label *dl;
@@ -548,13 +548,13 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
diff = now - dev->bid_time;
if ((now < dev->bid_time) ||
- (diff < BLKID_PROBE_MIN) ||
+ (diff < BLKID_PROBE_MIN) ||
(dev->bid_flags & BLKID_BID_FL_VERIFIED &&
diff < BLKID_PROBE_INTERVAL))
return dev;
DBG(DEBUG_PROBE,
- printf("need to revalidate %s (time since last check %lu)\n",
+ printf("need to revalidate %s (time since last check %lu)\n",
dev->bid_name, diff));
if (((fd = open(dev->bid_name, O_RDONLY)) < 0) ||
@@ -571,12 +571,12 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
}
memset(bufs, 0, sizeof(bufs));
-
+
/*
* Iterate over the type array. If we already know the type,
* then try that first. If it doesn't work, then blow away
* the type information, and try again.
- *
+ *
*/
try_again:
type = 0;
@@ -637,7 +637,7 @@ try_again:
blkid_free_dev(dev);
return NULL;
}
-
+
found_type:
if (dev && type) {
dev->bid_devno = st.st_rdev;
@@ -646,7 +646,7 @@ found_type:
cache->bic_flags |= BLKID_BIC_FL_CHANGED;
blkid_set_tag(dev, "TYPE", type, 0);
-
+
DBG(DEBUG_PROBE, printf("%s: devno 0x%04Lx, type %s\n",
dev->bid_name, st.st_rdev, type));
}
@@ -696,7 +696,7 @@ int main(int argc, char **argv)
printf("\tlabel is '%s'\n", dev->bid_label);
if (dev->bid_uuid)
printf("\tuuid is %s\n", dev->bid_uuid);
-
+
blkid_free_dev(dev);
return (0);
}