uint8_t p_fstype; /* filesystem type, see below */
uint8_t p_frag; /* filesystem fragments per block */
uint16_t p_cpg; /* filesystem cylinders per group */
- } d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */
+ } __attribute__((packed)) d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */
} __attribute__((packed));
char processor[16]; /* identifies ISA of boot */
/* there is more stuff after this that we don't need */
-};
+} __attribute__((packed));
/*
* Driver descriptor structure, in block 0
uint32_t block_count; /* number of blocks on the device */
/* there is more stuff after this that we don't need */
-};
+} __attribute__((packed));
static inline unsigned char *get_mac_block(
blkid_probe pr,
uint16_t xylogics_gap2;
uint16_t xylogics_readgate;
uint16_t xylogics_writecont;
-};
+} __attribute__((packed));
struct sgi_disklabel {
uint32_t magic; /* magic number */
unsigned char name[8]; /* name of volume */
uint32_t block_num; /* logical block number */
uint32_t num_bytes; /* how big, in bytes */
- } volume[15];
+ } __attribute__((packed)) volume[15];
struct sgi_partition {
uint32_t num_blocks; /* size in logical blocks */
uint32_t first_block; /* first logical block */
uint32_t type; /* type of this partition */
- } partitions[SGI_MAXPARTITIONS];
+ } __attribute__((packed)) partitions[SGI_MAXPARTITIONS];
/* checksum is the 32bit 2's complement sum of the disklabel */
uint32_t csum; /* disk label checksum */
uint32_t padding; /* padding */
-};
+} __attribute__((packed));
static uint32_t count_checksum(struct sgi_disklabel *label)
{
uint16_t s_flag; /* permission flags */
uint32_t s_start; /* start sector no of partition */
uint32_t s_size; /* # of blocks in partition */
-};
+} __attribute__((packed));
struct solaris_vtoc {
unsigned int v_bootinfo[3]; /* info needed by mboot (unsupported) */
unsigned int timestamp[SOLARIS_MAXPARTITIONS]; /* timestamp (unsupported) */
char v_asciilabel[128]; /* for compatibility */
-};
+} __attribute__((packed));
static int probe_solaris_pt(blkid_probe pr, const struct blkid_idmag *mag)
{
uint16_t s_flags; /* permission flags */
uint32_t start_sect; /* starting sector */
uint32_t nr_sects; /* number of sectors */
-};
+} __attribute__((packed));
struct unixware_disklabel {
uint32_t d_type; /* drive type */
struct unixware_partition
v_slice[UNIXWARE_MAXPARTITIONS]; /* partition */
- } vtoc;
+ } __attribute__((packed)) vtoc;
};
static int probe_unixware_pt(blkid_probe pr, const struct blkid_idmag *mag)
uint32_t raidtbl;
uint16_t raidline;
uint8_t res9[0xF6];
-};
+} __attribute__((packed));
#define AD_SIGNATURE "DPTM"
#define AD_MAGIC 0x37FC4D1E
uint32_t edition;
uint32_t blocks;
uint32_t files;
- } info;
+ } __attribute__((packed)) info;
uint8_t name[16];
-};
+} __attribute__((packed));
static int probe_cramfs(blkid_probe pr, const struct blkid_idmag *mag)
{
uint64_t s_mmp_block;
uint32_t s_raid_stripe_width;
uint32_t s_reserved[163];
-};
+} __attribute__((packed));
/* magic string */
#define EXT_SB_MAGIC "\123\357"
struct gfs2_inum __pad3; /* Was quota inode in gfs1 */
struct gfs2_inum __pad4; /* Was licence inode in gfs1 */
uint8_t sb_uuid[16]; /* The UUID maybe 0 for backwards compat */
-};
+} __attribute__((packed));
static int probe_gfs(blkid_probe pr, const struct blkid_idmag *mag)
{
uint8_t sig_hpfs[8];
uint8_t pad[448];
uint8_t magic[2];
-};
+} __attribute__((packed));
struct hpfs_super_block
{
uint8_t magic[4];
uint8_t magic1[4];
uint8_t version;
-};
+} __attribute__((packed));
struct hpfs_spare_super
{
uint8_t magic[4];
uint8_t magic1[4];
-};
+} __attribute__((packed));
#define HPFS_SB_OFFSET 0x2000
unsigned char unused[8];
unsigned char space_size[8];
unsigned char escape_sequences[8];
-};
+} __attribute__((packed));
#define ISO_SUPERBLOCK_OFFSET 0x8000
#define ISO_SECTOR_SIZE 0x800
unsigned char unused1;
unsigned char system_id[32];
unsigned char volume_id[32];
-};
+} __attribute__((packed));
/* returns 1 if the begin of @ascii is equal to @utf16 string.
*/
uint8_t mkDigestSalt[LUKS_SALTSIZE];
uint32_t mkDigestIterations;
uint8_t uuid[UUID_STRING_L];
-};
+} __attribute__((packed));
static int probe_luks(blkid_probe pr, const struct blkid_idmag *mag)
{
uint8_t reserved2[3];
uint64_t volume_serial;
uint16_t checksum;
-};
+} __attribute__((packed));
struct master_file_table_record {
uint32_t magic;
uint32_t size;
uint32_t chksum;
uint16_t version;
-};
+} __attribute__((packed));
#define NVIDIA_SIGNATURE "NVIDIA"
uint32_t rs_dummy4[5];
unsigned char rs_uuid[16];
char rs_label[16];
-};
+} __attribute__((packed));
struct reiser4_super_block {
unsigned char rs4_magic[16];
unsigned char rs4_uuid[16];
unsigned char rs4_label[16];
uint64_t rs4_dummy2;
-};
+} __attribute__((packed));
static int probe_reiser(blkid_probe pr, const struct blkid_idmag *mag)
{
unsigned char ros_magic[8];
uint32_t ros_dummy1[2];
unsigned char ros_volume[16];
-};
+} __attribute__((packed));
static int probe_romfs(blkid_probe pr, const struct blkid_idmag *mag)
{
uint16_t vendor_id;
uint16_t minor_ver;
uint16_t major_ver;
-};
+} __attribute__((packed));
#define SILICON_MAGIC 0x2F000000
uint32_t directory_table_start_2;
uint16_t s_major;
uint16_t s_minor;
-};
+} __attribute__((packed));
static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag)
{
unsigned char volume[16];
uint32_t padding[117];
uint32_t badpages[1];
-};
+} __attribute__((packed));
#define PAGESIZE_MIN 0xff6 /* 4086 (arm, i386, ...) */
#define PAGESIZE_MAX 0xfff6 /* 65526 (ia64) */
uint8_t s_fill[371];
uint32_t s_magic;
uint32_t s_type;
-};
+} __attribute__((packed));
#define SYSV_NICINOD 100
uint16_t crc;
uint16_t crc_len;
uint32_t location;
- } tag;
+ } __attribute__((packed)) tag;
+
union {
struct anchor_descriptor {
uint32_t length;
uint32_t location;
- } anchor;
+ } __attribute__((packed)) anchor;
+
struct primary_descriptor {
uint32_t seq_num;
uint32_t desc_num;
struct dstring {
uint8_t clen;
uint8_t c[31];
- } ident;
- } primary;
- } type;
-};
+ } __attribute__((packed)) ident;
+ } __attribute__((packed)) primary;
+
+ } __attribute__((packed)) type;
+
+} __attribute__((packed));
struct volume_structure_descriptor {
uint8_t type;
uint8_t id[5];
uint8_t version;
-};
+} __attribute__((packed));
#define UDF_VSD_OFFSET 0x8000
/* 52*/ unsigned char vs_magic[8];
/* 5a*/ unsigned char vs_dummy2[0x1fe - 0x5a];
/*1fe*/ unsigned char vs_pmagic[2];
-};
+} __attribute__((packed));
/* Yucky misaligned values */
struct msdos_super_block {
/* 36*/ unsigned char ms_magic[8];
/* 3e*/ unsigned char ms_dummy2[0x1fe - 0x3e];
/*1fe*/ unsigned char ms_pmagic[2];
-};
+} __attribute__((packed));
struct vfat_dir_entry {
uint8_t name[11];
uint16_t date_write;
uint16_t cluster_low;
uint32_t size;
-};
+} __attribute__((packed));
struct fat32_fsinfo {
uint8_t signature1[4];
uint32_t free_clusters;
uint32_t next_cluster;
uint32_t reserved2[4];
-};
+} __attribute__((packed));
/* maximum number of clusters */
#define FAT12_MAX 0xFF4
uint32_t capacity_low;
uint32_t capacity_high;
uint32_t serial_checksum;
- } array;
+ } __attribute__((packed)) array;
uint32_t serial_checksum[8];
uint8_t checksum;
-};
+} __attribute__((packed));
#define VIA_SIGNATURE 0xAA55
uint64_t xs_icount;
uint64_t xs_ifree;
uint64_t xs_fdblocks;
-};
+} __attribute__((packed));
static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag)
{
uint64_t ub_guid_sum; /* sum of all vdev guids */
uint64_t ub_timestamp; /* UTC time of last sync */
/*blkptr_t ub_rootbp;*/ /* MOS objset_phys_t */
-};
+} __attribute__((packed));
static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag)
{