2
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
4
* Inspired by libvolume_id by
5
* Kay Sievers <kay.sievers@vrfy.org>
7
* This file may be redistributed under the terms of the
8
* GNU Lesser General Public License.
17
#include "superblocks.h"
21
uint8_t minor_version;
22
uint8_t major_version;
26
#define JM_SIGNATURE "JM"
28
static int probe_jmraid(blkid_probe pr, const struct blkid_idmag *mag)
31
struct jm_metadata *jm;
33
if (pr->size < 0x10000)
35
if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
38
off = ((pr->size / 0x200) - 1) * 0x200;
39
jm = (struct jm_metadata *)
40
blkid_probe_get_buffer(pr,
42
sizeof(struct jm_metadata));
45
if (memcmp(jm->signature, JM_SIGNATURE, sizeof(JM_SIGNATURE) - 1) != 0)
47
if (blkid_probe_sprintf_version(pr, "%u.%u",
48
jm->major_version, jm->minor_version) != 0)
50
if (blkid_probe_set_magic(pr, off, sizeof(jm->signature),
51
(unsigned char *) jm->signature))
56
const struct blkid_idinfo jmraid_idinfo = {
57
.name = "jmicron_raid_member",
58
.usage = BLKID_USAGE_RAID,
59
.probefunc = probe_jmraid,
60
.magics = BLKID_NONE_MAGIC