On Sun, Jan 06, 2013 at 07:28:55PM +0100, Goffredo Baroncelli wrote:
> +const struct blkid_idinfo btrfs_idinfo1 =
> +{
> + .name = "btrfs [bak #1]",
> + .usage = BLKID_USAGE_FILESYSTEM,
> + .probefunc = probe_btrfs,
> + .minsz = 64 * 1024 * 1024 + 4 * 1024,
> + .magics =
> + {
> + { .magic = "_BHRfS_M",
> + .len = 8,
> + .kboff = 64 * 1024,
> + .sboff = 0x40 },
> + { NULL }
> + }
> +};
> +
> +const struct blkid_idinfo btrfs_idinfo2 =
> +{
> + .name = "btrfs [bak #2]",
> + .usage = BLKID_USAGE_FILESYSTEM,
> + .probefunc = probe_btrfs,
> + .minsz = 256 * 1024 * 1024 * 1024 + 4 *1024,
> + .magics =
> + {
> + { .magic = "_BHRfS_M",
> + .len = 8,
> + .kboff = 256 * 1024 * 1024,
> + .sboff = 0x40 },
> + { NULL }
> + }
> +};
You can specify more than one magic strings for the same filesystem,
the .magics = { } is array.
.magics = {
/* backup #1 */
{ .magic = "_BHRfS_M",
.len = 8,
.kboff = 64 * 1024,
.sboff = 0x40 },
},
/* backup #2 */
{ .magic = "_BHRfS_M",
.len = 8,
.kboff = 256 * 1024 * 1024,
.sboff = 0x40
},
...
}
see for example libblkid/src/superblocks/reiserfs.c
Karel
--
Karel Zak <kzak@xxxxxxxxxx>
http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html