chiark / gitweb /
[PATCH] udev_volume_id: volume_id version 034
[elogind.git] / extras / volume_id / volume_id / linux_raid / linux_raid.c
index b55c6ca6e84fc1e408c816f31e23155a1569fe99..ca03030ee4803c253d1bfc77f9c3c9d98856d1cc 100644 (file)
 #include "../util.h"
 #include "linux_raid.h"
 
+struct mdp_super_block {
+       __u32   md_magic;
+       __u32   major_version;
+       __u32   minor_version;
+       __u32   patch_version;
+       __u32   gvalid_words;
+       __u32   set_uuid0;
+       __u32   ctime;
+       __u32   level;
+       __u32   size;
+       __u32   nr_disks;
+       __u32   raid_disks;
+       __u32   md_minor;
+       __u32   not_persistent;
+       __u32   set_uuid1;
+       __u32   set_uuid2;
+       __u32   set_uuid3;
+} __attribute__((packed)) *mdp;
+
 #define MD_RESERVED_BYTES              0x10000
 #define MD_MAGIC                       0xa92b4efc
 
 int volume_id_probe_linux_raid(struct volume_id *id, __u64 off, __u64 size)
 {
-       struct mdp_super_block {
-               __u32   md_magic;
-               __u32   major_version;
-               __u32   minor_version;
-               __u32   patch_version;
-               __u32   gvalid_words;
-               __u32   set_uuid0;
-               __u32   ctime;
-               __u32   level;
-               __u32   size;
-               __u32   nr_disks;
-               __u32   raid_disks;
-               __u32   md_minor;
-               __u32   not_persistent;
-               __u32   set_uuid1;
-               __u32   set_uuid2;
-               __u32   set_uuid3;
-       } __attribute__((packed)) *mdp;
-
        const __u8 *buf;
        __u64 sboff;
        __u8 uuid[16];
 
+       dbg("probing at offset %llu", off);
+
        if (size < 0x10000)
                return -1;