From c29368b46c694688ca227b56e0ac24b031a68532 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 25 Nov 2008 13:11:59 +0100 Subject: blkid: add vxfs Signed-off-by: Karel Zak --- libs/blkid/src/probers/Makefile.am | 1 + libs/blkid/src/probers/probers.h | 1 + libs/blkid/src/probers/vxfs.c | 51 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 libs/blkid/src/probers/vxfs.c (limited to 'libs/blkid/src/probers') diff --git a/libs/blkid/src/probers/Makefile.am b/libs/blkid/src/probers/Makefile.am index 06fcdd9c6..fe13031b9 100644 --- a/libs/blkid/src/probers/Makefile.am +++ b/libs/blkid/src/probers/Makefile.am @@ -31,6 +31,7 @@ libprobers_a_SOURCES = probers.h \ vfat.c \ luks.c \ highpoint_raid.c \ + vxfs.c \ lvm.c all-local: $(lib_LIBRARIES) diff --git a/libs/blkid/src/probers/probers.h b/libs/blkid/src/probers/probers.h index 74c2d34e6..394607085 100644 --- a/libs/blkid/src/probers/probers.h +++ b/libs/blkid/src/probers/probers.h @@ -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 index 000000000..2a6502a3f --- /dev/null +++ b/libs/blkid/src/probers/vxfs.c @@ -0,0 +1,51 @@ +/* + * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o + * Copyright (C) 2001 by Andreas Dilger + * Copyright (C) 2004 Kay Sievers + * Copyright (C) 2008 Karel Zak + * + * 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 + +#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 } + } +}; + -- cgit v1.2.3-55-g7522