From 40672152dcbd17ce41aa3f6670f9898402990a5c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 14 May 2009 15:38:50 +0200 Subject: build-sys: rename /libs to /shlibs On Wed, May 13, 2009 at 05:38:49AM -0400, Christoph Hellwig wrote: > Also the lib vs libs toplevel directories probably aren't a too good > choice. Signed-off-by: Karel Zak --- shlibs/blkid/src/probers/lsi_raid.c | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 shlibs/blkid/src/probers/lsi_raid.c (limited to 'shlibs/blkid/src/probers/lsi_raid.c') diff --git a/shlibs/blkid/src/probers/lsi_raid.c b/shlibs/blkid/src/probers/lsi_raid.c new file mode 100644 index 00000000..d9ac4e12 --- /dev/null +++ b/shlibs/blkid/src/probers/lsi_raid.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2008 Karel Zak + * + * Inspired by libvolume_id by + * Kay Sievers + * + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ + +#include +#include +#include +#include +#include + +#include "blkidP.h" + +struct lsi_metadata { + uint8_t sig[6]; +}; + + +#define LSI_SIGNATURE "$XIDE$" + +static int probe_lsiraid(blkid_probe pr, const struct blkid_idmag *mag) +{ + uint64_t off; + struct lsi_metadata *lsi; + + if (pr->size < 0x10000) + return -1; + + off = ((pr->size / 0x200) - 1) * 0x200; + lsi = (struct lsi_metadata *) + blkid_probe_get_buffer(pr, + off, + sizeof(struct lsi_metadata)); + if (!lsi) + return -1; + + if (memcmp(lsi->sig, LSI_SIGNATURE, sizeof(LSI_SIGNATURE)-1) != 0) + return -1; + + return 0; +} + +const struct blkid_idinfo lsiraid_idinfo = { + .name = "lsi_mega_raid_member", + .usage = BLKID_USAGE_RAID, + .probefunc = probe_lsiraid, + .magics = BLKID_NONE_MAGIC +}; + + -- cgit v1.2.3