Upload Tizen:Base source
[framework/base/util-linux-ng.git] / shlibs / blkid / src / probers / vxfs.c
1 /*
2  * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
3  *
4  * This file may be redistributed under the terms of the
5  * GNU Lesser General Public License.
6  */
7
8 #include <stdio.h>
9
10 #include "blkidP.h"
11
12 struct vxfs_super_block {
13         uint32_t                vs_magic;
14         int32_t                 vs_version;
15 };
16
17 static int probe_vxfs(blkid_probe pr, const struct blkid_idmag *mag)
18 {
19         struct vxfs_super_block *vxs;
20
21         vxs = blkid_probe_get_sb(pr, mag, struct vxfs_super_block);
22         if (!vxs)
23                 return -1;
24
25         blkid_probe_sprintf_version(pr, "%u", (unsigned int) vxs->vs_version);
26         return 0;
27 }
28
29
30 const struct blkid_idinfo vxfs_idinfo =
31 {
32         .name           = "vxfs",
33         .usage          = BLKID_USAGE_FILESYSTEM,
34         .probefunc      = probe_vxfs,
35         .magics         =
36         {
37                 { .magic = "\365\374\001\245", .len = 4, .kboff = 1 },
38                 { NULL }
39         }
40 };
41