/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2006 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
-struct adaptec_meta {
+struct adaptec_metadata {
uint32_t b0idcode;
uint8_t lunsave[8];
uint16_t sdtype;
#define AD_SIGNATURE "DPTM"
#define AD_MAGIC 0x37FC4D1E
-
static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct adaptec_meta *ad;
+ uint64_t off;
+ struct adaptec_metadata *ad;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200)-1) * 0x200;
- ad = (struct adaptec_meta *) blkid_probe_get_buffer(pr, meta_off, 0x200);
+ off = ((pr->size / 0x200)-1) * 0x200;
+ ad = (struct adaptec_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct adaptec_metadata));
if (!ad)
return -1;
-
if (memcmp(ad->smagic, AD_SIGNATURE, sizeof(AD_SIGNATURE)) != 0)
return -1;
-
if (ad->b0idcode != be32_to_cpu(AD_MAGIC))
return -1;
-
if (blkid_probe_sprintf_version(pr, "%u", ad->resver) != 0)
return -1;
/*
+ * Copyright (C) 1999 by Andries Brouwer
+ * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
+ * Copyright (C) 2001 by Andreas Dilger
+ * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2004-2007 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static int probe_ddf(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t ddf_off;
+ uint64_t off;
struct ddf_header *ddf;
if (pr->size < 0x10000)
return -1;
- ddf_off = ((pr->size / 0x200) - 1) * 0x200;
- ddf = (struct ddf_header *) blkid_probe_get_buffer(pr, ddf_off, 0x200);
+ off = ((pr->size / 0x200) - 1) * 0x200;
+ ddf = (struct ddf_header *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct ddf_header));
if (!ddf)
return -1;
if (ddf->signature != cpu_to_be32(DDF_HEADER))
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
/*
- * Copyright (C) 1999, 2001 by Andries Brouwer
+ * Copyright (C) 1999 by Andries Brouwer
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
+ * Copyright (C) 2001 by Andreas Dilger
+ * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
/* Common gfs/gfs2 constants: */
-#define GFS_MAGIC 0x01161970
-#define GFS_DEFAULT_BSIZE 4096
-#define GFS_SUPERBLOCK_OFFSET (0x10 * GFS_DEFAULT_BSIZE)
-#define GFS_METATYPE_SB 1
-#define GFS_FORMAT_SB 100
#define GFS_LOCKNAME_LEN 64
/* gfs1 constants: */
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <inttypes.h>
#include "blkidP.h"
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "blkidP.h"
-struct hpt45x_meta {
+struct hpt45x_metadata {
uint32_t magic;
};
static int probe_highpoint45x(blkid_probe pr, const struct blkid_idmag *mag)
{
- const uint8_t *buf;
- struct hpt45x_meta *hpt;
- uint64_t meta_off;
+ struct hpt45x_metadata *hpt;
+ uint64_t off;
uint32_t magic;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200) - 11) * 0x200;
- buf = blkid_probe_get_buffer(pr, meta_off, 0x200);
- if (buf == NULL)
+ off = ((pr->size / 0x200) - 11) * 0x200;
+ hpt = (struct hpt45x_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct hpt45x_metadata));
+ if (!hpt)
return -1;
-
- hpt = (struct hpt45x_meta *) buf;
magic = le32_to_cpu(hpt->magic);
if (magic != HPT45X_MAGIC_OK && magic != HPT45X_MAGIC_BAD)
return -1;
/*
- * Copyright (C) 1999, 2001 by Andries Brouwer
- * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
uint8_t magic[2];
};
-struct hpfs_super
+struct hpfs_super_block
{
uint8_t magic[4];
uint8_t magic1[4];
static int probe_hpfs(blkid_probe pr, const struct blkid_idmag *mag)
{
- struct hpfs_super *hs;
+ struct hpfs_super_block *hs;
struct hpfs_spare_super *hss;
struct hpfs_boot_block *hbb;
uint8_t version;
/* super block */
- hs = blkid_probe_get_sb(pr, mag, struct hpfs_super);
+ hs = blkid_probe_get_sb(pr, mag, struct hpfs_super_block);
if (!hs)
return -1;
version = hs->version;
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired also by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
struct iso_volume_descriptor *iso;
unsigned char label[32];
int i;
- int vd_offset;
+ int off;
if (strcmp(mag->magic, "CDROM") == 0)
return probe_iso9660_hsfs(pr, mag);
memcpy(label, iso->volume_id, sizeof(label));
/* Joliet Extension */
- vd_offset = ISO_VD_OFFSET;
+ off = ISO_VD_OFFSET;
for (i = 0; i < ISO_VD_MAX; i++) {
uint8_t svd_label[64];
iso = (struct iso_volume_descriptor *)
blkid_probe_get_buffer(pr,
- vd_offset,
+ off,
sizeof(struct iso_volume_descriptor));
if (iso == NULL || iso->vd_type == ISO_VD_END)
blkid_probe_set_version(pr, "Joliet Extension");
goto has_label;
}
- vd_offset += ISO_SECTOR_SIZE;
+ off += ISO_SECTOR_SIZE;
}
/* Joliet not found, let use standard iso label */
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "blkidP.h"
-struct isw_meta {
+struct isw_metadata {
uint8_t sig[32];
uint32_t check_sum;
uint32_t mpb_size;
static int probe_iswraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct isw_meta *isw;
+ uint64_t off;
+ struct isw_metadata *isw;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200) - 2) * 0x200;
-
- if (pr->size < 0x10000)
- return -1;
-
- isw = (struct isw_meta *) blkid_probe_get_buffer(pr, meta_off, 0x200);
+ off = ((pr->size / 0x200) - 2) * 0x200;
+ isw = (struct isw_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct isw_metadata));
if (!isw)
return -1;
-
if (memcmp(isw->sig, ISW_SIGNATURE, sizeof(ISW_SIGNATURE)-1) != 0)
return -1;
-
if (blkid_probe_sprintf_version(pr, "%6s",
&isw->sig[sizeof(ISW_SIGNATURE)-1]) != 0)
return -1;
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
js = blkid_probe_get_sb(pr, mag, struct jfs_super_block);
if (!js)
return -1;
-
if (le32_to_cpu(js->js_bsize) != (1 << le16_to_cpu(js->js_l2bsize)))
return 1;
-
if (le32_to_cpu(js->js_pbsize) != (1 << le16_to_cpu(js->js_l2pbsize)))
return 1;
-
if ((le16_to_cpu(js->js_l2bsize) - le16_to_cpu(js->js_l2pbsize)) !=
le16_to_cpu(js->js_l2bfactor))
return 1;
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2006 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
-
-struct jmicron_meta {
+struct jm_metadata {
int8_t signature[2];
uint8_t minor_version;
uint8_t major_version;
static int probe_jmraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct jmicron_meta *jm;
+ uint64_t off;
+ struct jm_metadata *jm;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200) - 1) * 0x200;
- jm = (struct jmicron_meta *) blkid_probe_get_buffer(pr, meta_off, 0x200);
+ off = ((pr->size / 0x200) - 1) * 0x200;
+ jm = (struct jm_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct jm_metadata));
if (!jm)
return -1;
-
if (memcmp(jm->signature, JM_SIGNATURE, sizeof(JM_SIGNATURE) - 1) != 0)
return -1;
-
-
if (blkid_probe_sprintf_version(pr, "%u.%u",
jm->major_version, jm->minor_version) != 0)
return -1;
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
if (pr->size < 0x10000)
return -1;
mdp0 = (struct mdp0_super_block *)
- blkid_probe_get_buffer(pr, off, 0x800);
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct mdp0_super_block));
if (!mdp0)
return -1;
struct mdp1_super_block *mdp1;
mdp1 = (struct mdp1_super_block *)
- blkid_probe_get_buffer(pr, off, 0x800);
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct mdp1_super_block));
if (!mdp1)
return -1;
if (le32_to_cpu(mdp1->magic) != MD_SB_MAGIC)
return -1;
if (blkid_probe_set_uuid(pr, (unsigned char *) mdp1->set_uuid) != 0)
return -1;
- if (blkid_probe_set_label(pr, mdp1->set_name, sizeof(mdp1->set_name)) != 0)
+ if (blkid_probe_set_label(pr, mdp1->set_name,
+ sizeof(mdp1->set_name)) != 0)
return -1;
return 0;
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include "blkidP.h"
-struct lsi_meta {
+struct lsi_metadata {
uint8_t sig[6];
};
static int probe_lsiraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct lsi_meta *lsi;
+ uint64_t off;
+ struct lsi_metadata *lsi;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200) - 1) * 0x200;
- lsi = (struct lsi_meta *) blkid_probe_get_buffer(pr, meta_off, 0x200);
+ off = ((pr->size / 0x200) - 1) * 0x200;
+ lsi = (struct lsi_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct lsi_metadata));
if (!lsi)
return -1;
/*
- * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "blkidP.h"
-/* TODO: add lvm1 support -- magic string detection required only */
-
#define LVM2_ID_LEN 32
struct lvm2_pv_label_header {
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include "blkidP.h"
return 0;
}
-
const struct blkid_idinfo minix_idinfo =
{
.name = "minix",
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <inttypes.h>
#include "blkidP.h"
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
-struct nvidia_meta {
+struct nv_metadata {
uint8_t vendor[8];
uint32_t size;
uint32_t chksum;
static int probe_nvraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct nvidia_meta *nv;
+ uint64_t off;
+ struct nv_metadata *nv;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200) - 2) * 0x200;
- nv = (struct nvidia_meta *) blkid_probe_get_buffer(pr, meta_off, 0x200);
+ off = ((pr->size / 0x200) - 2) * 0x200;
+ nv = (struct nv_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct nv_metadata));
if (!nv)
return -1;
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
#define ocfslabellen(o) ((__u32)o.label_len[0] + (((__u32) o.label_len[1]) << 8))
#define ocfsmountlen(o) ((__u32)o.mount_len[0] + (((__u32) o.mount_len[1]) << 8))
-#define OCFS_MAGIC "OracleCFS"
-
struct ocfs2_super_block {
unsigned char signature[8];
unsigned char s_dummy1[184];
unsigned char s_uuid[16];
};
-#define OCFS2_MIN_BLOCKSIZE 512
-#define OCFS2_MAX_BLOCKSIZE 4096
-
-#define OCFS2_SUPER_BLOCK_BLKNO 2
-
-#define OCFS2_SUPER_BLOCK_SIGNATURE "OCFSV2"
-
struct oracle_asm_disk_label {
char dummy[32];
char dl_tag[8];
char dl_id[24];
};
-#define ORACLE_ASM_DISK_LABEL_MARKED "ORCLDISK"
-#define ORACLE_ASM_DISK_LABEL_OFFSET 32
-
static int probe_ocfs(blkid_probe pr, const struct blkid_idmag *mag)
{
unsigned char *buf;
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "blkidP.h"
-struct promise_meta {
+struct promise_metadata {
uint8_t sig[24];
};
return -1;
for (i = 0; sectors[i] != 0; i++) {
- uint64_t meta_off;
- struct promise_meta *pdc;
-
- meta_off = ((pr->size / 0x200) - sectors[i]) * 0x200;
- pdc = (struct promise_meta *)
- blkid_probe_get_buffer(pr, meta_off, 0x200);
+ uint64_t off;
+ struct promise_metadata *pdc;
+
+ off = ((pr->size / 0x200) - sectors[i]) * 0x200;
+ pdc = (struct promise_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct promise_metadata));
if (!pdc)
return -1;
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
-#include <ctype.h>
#include <stdint.h>
#include "blkidP.h"
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "blkidP.h"
-struct silicon_meta {
+struct silicon_metadata {
uint8_t unknown0[0x2E];
uint8_t ascii_version[0x36 - 0x2E];
uint8_t diskname[0x56 - 0x36];
static int probe_silraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct silicon_meta *sil;
+ uint64_t off;
+ struct silicon_metadata *sil;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200) - 1) * 0x200;
+ off = ((pr->size / 0x200) - 1) * 0x200;
- sil = (struct silicon_meta *) blkid_probe_get_buffer(pr,
- meta_off, 0x200);
+ sil = (struct silicon_metadata *)
+ blkid_probe_get_buffer(pr, off,
+ sizeof(struct silicon_metadata));
if (!sil)
return -1;
/*
- * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- *
- * This is a derivative work from libvolume_id (udev) and libblkid (e2fsprogs).
- *
- * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 1999 by Andries Brouwer
* Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
* Copyright (C) 2001 by Andreas Dilger
+ * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
uint8_t type;
uint8_t id[5];
uint8_t version;
-} PACKED;
+};
#define UDF_VSD_OFFSET 0x8000
/*
- * Copyright (C) 1999 by Andries Brouwer
- * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
- * Copyright (C) 2001 by Andreas Dilger
- * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2004-2006 Heinz Mauelshagen, Red Hat GmbH
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Inspired by libvolume_id by
+ * Kay Sievers <kay.sievers@vrfy.org>
*
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include "blkidP.h"
-struct via_meta {
+struct via_metadata {
uint16_t signature;
uint8_t version_number;
struct via_array {
#define VIA_SIGNATURE 0xAA55
/* 8 bit checksum on first 50 bytes of metadata. */
-static uint8_t meta_checksum(struct via_meta *via)
+static uint8_t via_checksum(struct via_metadata *v)
{
- uint8_t i = 50, sum = 0;
+ uint8_t i = 50, cs = 0;
while (i--)
- sum += ((uint8_t*) via)[i];
+ cs += ((uint8_t*) v)[i];
- return sum == via->checksum;
+ return cs == v->checksum;
}
static int probe_viaraid(blkid_probe pr, const struct blkid_idmag *mag)
{
- uint64_t meta_off;
- struct via_meta *via;
+ uint64_t off;
+ struct via_metadata *v;
if (pr->size < 0x10000)
return -1;
- meta_off = ((pr->size / 0x200)-1) * 0x200;
+ off = ((pr->size / 0x200)-1) * 0x200;
- via = (struct via_meta *) blkid_probe_get_buffer(pr, meta_off, 0x200);
- if (!via)
+ v = (struct via_metadata *)
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct via_metadata));
+ if (!v)
return -1;
- if (le16_to_cpu(via->signature) != VIA_SIGNATURE)
+ if (le16_to_cpu(v->signature) != VIA_SIGNATURE)
return -1;
- if (via->version_number > 1)
+ if (v->version_number > 1)
return -1;
- if (!meta_checksum(via))
+ if (!via_checksum(v))
return -1;
- if (blkid_probe_sprintf_version(pr, "%u", via->version_number) != 0)
+ if (blkid_probe_sprintf_version(pr, "%u", v->version_number) != 0)
return -1;
return 0;
}
/*
- * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
- * Copyright (C) 2001 by Andreas Dilger
- * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
#include "blkidP.h"
-struct vxfs_super {
+struct vxfs_super_block {
uint32_t vs_magic;
int32_t vs_version;
};
static int probe_vxfs(blkid_probe pr, const struct blkid_idmag *mag)
{
- struct vxfs_super *vxs;
+ struct vxfs_super_block *vxs;
- vxs = blkid_probe_get_sb(pr, mag, struct vxfs_super);
+ vxs = blkid_probe_get_sb(pr, mag, struct vxfs_super_block);
if (!vxs)
return -1;
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
*/
#include <stdio.h>
/*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*
- * %Begin-Header%
* This file may be redistributed under the terms of the
* GNU Lesser General Public License.
- * %End-Header%
*/
#include <stdio.h>