2
* Copyright (C) 1999 by Andries Brouwer
3
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
4
* Copyright (C) 2001 by Andreas Dilger
5
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
6
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
8
* This file may be redistributed under the terms of the
9
* GNU Lesser General Public License.
20
#include "superblocks.h"
22
struct xfs_super_block {
23
unsigned char xs_magic[4];
24
uint32_t xs_blocksize;
27
uint32_t xs_dummy1[2];
28
unsigned char xs_uuid[16];
29
uint32_t xs_dummy2[15];
31
uint32_t xs_dummy3[2];
35
} __attribute__((packed));
37
static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag)
39
struct xfs_super_block *xs;
41
xs = blkid_probe_get_sb(pr, mag, struct xfs_super_block);
45
if (strlen(xs->xs_fname))
46
blkid_probe_set_label(pr, (unsigned char *) xs->xs_fname,
47
sizeof(xs->xs_fname));
48
blkid_probe_set_uuid(pr, xs->xs_uuid);
52
const struct blkid_idinfo xfs_idinfo =
55
.usage = BLKID_USAGE_FILESYSTEM,
56
.probefunc = probe_xfs,
59
{ .magic = "XFSB", .len = 4 },