]> err.no Git - util-linux/commitdiff
blkid: add vxfs
authorKarel Zak <kzak@redhat.com>
Tue, 25 Nov 2008 12:11:59 +0000 (13:11 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:21:47 +0000 (23:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/probe.c
libs/blkid/src/probers/Makefile.am
libs/blkid/src/probers/probers.h
libs/blkid/src/probers/vxfs.c [new file with mode: 0644]

index 34d2e808c0da417ef1d391924c21d488340dd8e6..f1fb76ab7b1ab1c3661a17268ef62afaf267fa93 100644 (file)
@@ -83,7 +83,7 @@ static const struct blkid_idinfo *idinfos[] =
        &ocfs_idinfo,
        &ocfs2_idinfo,
        &oracleasm_idinfo,
-       /* TODO: vxfs */
+       &vxfs_idinfo,
        /* TODO: squashfs */
        /* TODO: netware */
 };
index 06fcdd9c6d84ec090fceb6a40e3b4a400cc77671..fe13031b9b7e519e2be57cc1df2f86374312a725 100644 (file)
@@ -31,6 +31,7 @@ libprobers_a_SOURCES =        probers.h \
                        vfat.c \
                        luks.c \
                        highpoint_raid.c \
+                       vxfs.c \
                        lvm.c
 
 all-local: $(lib_LIBRARIES)
index 74c2d34e68401e3eba7a60fa6093672f41d61aa3..3946070850339e9d2ea39c7c2b9b678ab43a2cd4 100644 (file)
@@ -48,6 +48,7 @@ extern const struct blkid_idinfo hfsplus_idinfo;
 extern const struct blkid_idinfo ntfs_idinfo;
 extern const struct blkid_idinfo iso9660_idinfo;
 extern const struct blkid_idinfo udf_idinfo;
+extern const struct blkid_idinfo vxfs_idinfo;
 extern const struct blkid_idinfo vfat_idinfo;
 extern const struct blkid_idinfo lvm2_idinfo;
 extern const struct blkid_idinfo lvm1_idinfo;
diff --git a/libs/blkid/src/probers/vxfs.c b/libs/blkid/src/probers/vxfs.c
new file mode 100644 (file)
index 0000000..2a6502a
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
+ * Copyright (C) 2001 by Andreas Dilger
+ * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <stdio.h>
+
+#include "blkidP.h"
+
+struct vxfs_super {
+       uint32_t                vs_magic;
+       int32_t                 vs_version;
+};
+
+static int probe_vxfs(blkid_probe pr, const struct blkid_idmag *mag)
+{
+       struct vxfs_super *vxs;
+
+       vxs = blkid_probe_get_sb(pr, mag, struct vxfs_super);
+       if (!vxs)
+               return -1;
+
+       blkid_probe_sprintf_version(pr, "%u", (unsigned int) vxs->vs_version);
+       return 0;
+}
+
+
+const struct blkid_idinfo vxfs_idinfo =
+{
+       .name           = "vxfs",
+       .usage          = BLKID_USAGE_FILESYSTEM,
+       .probefunc      = probe_vxfs,
+       .magics         =
+       {
+               { .magic = "\365\374\001\245", .len = 4, .kboff = 1 },
+               { NULL }
+       }
+};
+