hal/volume_id Makefile.am, 1.6, 1.7 cramfs.c, 1.3, 1.4 cramfs.h, 1.1,
1.2 dasd.c, 1.4, NONE dasd.h, 1.2, NONE ext.c, 1.4, 1.5 ext.h,
1.1, 1.2 fat.c, 1.6, 1.7 fat.h, 1.1, 1.2 hfs.c, 1.4, 1.5 hfs.h,
1.1, 1.2 highpoint.c, 1.5, 1.6 highpoint.h, 1.2, 1.3 hpfs.c,
1.3, 1.4 hpfs.h, 1.1, 1.2 iso9660.c, 1.5, 1.6 iso9660.h, 1.1,
1.2 isw_raid.c, 1.3, 1.4 isw_raid.h, 1.1, 1.2 jfs.c, 1.4,
1.5 jfs.h, 1.1, 1.2 linux_raid.c, 1.5, 1.6 linux_raid.h, 1.1,
1.2 linux_swap.c, 1.4, 1.5 linux_swap.h, 1.1, 1.2 lsi_raid.c,
1.2, 1.3 lsi_raid.h, 1.1, 1.2 luks.c, 1.5, 1.6 luks.h, 1.2,
1.3 lvm.c, 1.5, 1.6 lvm.h, 1.1, 1.2 mac.c, 1.4, 1.5 mac.h, 1.1,
1.2 minix.c, 1.2, 1.3 minix.h, 1.1, 1.2 msdos.c, 1.4,
1.5 msdos.h, 1.1, 1.2 ntfs.c, 1.5, 1.6 ntfs.h, 1.1,
1.2 nvidia_raid.c, 1.2, 1.3 nvidia_raid.h, 1.1,
1.2 promise_raid.c, 1.2, 1.3 promise_raid.h, 1.1,
1.2 reiserfs.c, 1.5, 1.6 reiserfs.h, 1.1, 1.2 romfs.c, 1.4,
1.5 romfs.h, 1.1, 1.2 silicon_raid.c, 1.2, 1.3 silicon_raid.h,
1.1, 1.2 sysv.c, 1.3, 1.4 sysv.h, 1.1, 1.2 udf.c, 1.4,
1.5 udf.h, 1.1, 1.2 ufs.c, 1.4, 1.5 ufs.h, 1.1, 1.2 util.c,
1.5, 1.6 util.h, 1.6, 1.7 via_raid.c, 1.2, 1.3 via_raid.h, 1.1,
1.2 volume_id.c, 1.9, 1.10 volume_id.h, 1.8, 1.9 xfs.c, 1.4,
1.5 xfs.h, 1.1, 1.2
Kay Sievers
kay at freedesktop.org
Fri Aug 12 15:28:33 PDT 2005
Update of /cvs/hal/hal/volume_id
In directory gabe:/tmp/cvs-serv11834/volume_id
Modified Files:
Makefile.am cramfs.c cramfs.h ext.c ext.h fat.c fat.h hfs.c
hfs.h highpoint.c highpoint.h hpfs.c hpfs.h iso9660.c
iso9660.h isw_raid.c isw_raid.h jfs.c jfs.h linux_raid.c
linux_raid.h linux_swap.c linux_swap.h lsi_raid.c lsi_raid.h
luks.c luks.h lvm.c lvm.h mac.c mac.h minix.c minix.h msdos.c
msdos.h ntfs.c ntfs.h nvidia_raid.c nvidia_raid.h
promise_raid.c promise_raid.h reiserfs.c reiserfs.h romfs.c
romfs.h silicon_raid.c silicon_raid.h sysv.c sysv.h udf.c
udf.h ufs.c ufs.h util.c util.h via_raid.c via_raid.h
volume_id.c volume_id.h xfs.c xfs.h
Removed Files:
dasd.c dasd.h
Log Message:
2005-08-13 Kay Sievers <kay.sievers at vrfy.org>
Sync up volume_id with the udev version.
* drive_id/drive_id.c: (drive_id_open_dev_t):
* volume_id/Makefile.am:
* volume_id/cramfs.c: (volume_id_probe_cramfs):
* volume_id/cramfs.h:
* volume_id/dasd.c:
* volume_id/dasd.h:
* volume_id/ext.c: (volume_id_probe_ext):
* volume_id/ext.h:
* volume_id/fat.c: (get_attr_volume_id), (volume_id_probe_vfat):
* volume_id/fat.h:
* volume_id/hfs.c: (volume_id_probe_hfs_hfsplus):
* volume_id/hfs.h:
* volume_id/highpoint.c: (volume_id_probe_highpoint_37x_raid),
(volume_id_probe_highpoint_45x_raid):
* volume_id/highpoint.h:
* volume_id/hpfs.c: (volume_id_probe_hpfs):
* volume_id/hpfs.h:
* volume_id/iso9660.c: (volume_id_probe_iso9660):
* volume_id/iso9660.h:
* volume_id/isw_raid.c: (volume_id_probe_intel_software_raid):
* volume_id/isw_raid.h:
* volume_id/jfs.c: (volume_id_probe_jfs):
* volume_id/jfs.h:
* volume_id/linux_raid.c: (volume_id_probe_linux_raid):
* volume_id/linux_raid.h:
* volume_id/linux_swap.c: (volume_id_probe_linux_swap):
* volume_id/linux_swap.h:
* volume_id/lsi_raid.c: (volume_id_probe_lsi_mega_raid):
* volume_id/lsi_raid.h:
* volume_id/luks.c: (volume_id_probe_luks):
* volume_id/luks.h:
* volume_id/lvm.c: (volume_id_probe_lvm1), (volume_id_probe_lvm2):
* volume_id/lvm.h:
* volume_id/mac.c: (volume_id_probe_mac_partition_map):
* volume_id/mac.h:
* volume_id/minix.c: (volume_id_probe_minix):
* volume_id/minix.h:
* volume_id/msdos.c: (volume_id_probe_msdos_part_table):
* volume_id/msdos.h:
* volume_id/ntfs.c: (volume_id_probe_ntfs):
* volume_id/ntfs.h:
* volume_id/nvidia_raid.c: (volume_id_probe_nvidia_raid):
* volume_id/nvidia_raid.h:
* volume_id/promise_raid.c: (volume_id_probe_promise_fasttrack_raid):
* volume_id/promise_raid.h:
* volume_id/reiserfs.c: (volume_id_probe_reiserfs):
* volume_id/reiserfs.h:
* volume_id/romfs.c: (volume_id_probe_romfs):
* volume_id/romfs.h:
* volume_id/silicon_raid.c: (volume_id_probe_silicon_medley_raid):
* volume_id/silicon_raid.h:
* volume_id/sysv.c: (volume_id_probe_sysv):
* volume_id/sysv.h:
* volume_id/udf.c: (volume_id_probe_udf):
* volume_id/udf.h:
* volume_id/ufs.c: (volume_id_probe_ufs):
* volume_id/ufs.h:
* volume_id/util.c: (volume_id_set_unicode16),
(volume_id_set_label_raw),
(volume_id_set_label_string), (volume_id_set_label_unicode16),
(volume_id_set_uuid), (volume_id_get_buffer):
* volume_id/util.h:
* volume_id/via_raid.c: (volume_id_probe_via_raid):
* volume_id/via_raid.h:
* volume_id/volume_id.c: (volume_id_probe_all),
(volume_id_open_dev_t):
* volume_id/volume_id.h:
* volume_id/xfs.c: (volume_id_probe_xfs):
* volume_id/xfs.h:
Index: Makefile.am
===================================================================
RCS file: /cvs/hal/hal/volume_id/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Makefile.am 11 Mar 2005 18:00:35 -0000 1.6
+++ Makefile.am 12 Aug 2005 22:28:30 -0000 1.7
@@ -4,7 +4,6 @@
INCLUDES = -DDEBUG
libvolume_id_la_SOURCES = \
- dasd.h dasd.c \
ext.h ext.c \
fat.h fat.c \
hfs.h hfs.c \
@@ -33,6 +32,7 @@
sysv.h sysv.c \
cramfs.h cramfs.c \
minix.h minix.c \
+ ocfs2.h ocfs2.c \
logging.h \
util.h util.c \
volume_id.h volume_id.c
Index: cramfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/cramfs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cramfs.c 27 Jun 2005 14:52:03 -0000 1.3
+++ cramfs.c 12 Aug 2005 22:28:30 -0000 1.4
@@ -39,21 +39,21 @@
#include "cramfs.h"
struct cramfs_super {
- __u8 magic[4];
- __u32 size;
- __u32 flags;
- __u32 future;
- __u8 signature[16];
+ uint8_t magic[4];
+ uint32_t size;
+ uint32_t flags;
+ uint32_t future;
+ uint8_t signature[16];
struct cramfs_info {
- __u32 crc;
- __u32 edition;
- __u32 blocks;
- __u32 files;
+ uint32_t crc;
+ uint32_t edition;
+ uint32_t blocks;
+ uint32_t files;
} __attribute__((__packed__)) info;
- __u8 name[16];
+ uint8_t name[16];
} __attribute__((__packed__));
-int volume_id_probe_cramfs(struct volume_id *id, __u64 off)
+int volume_id_probe_cramfs(struct volume_id *id, uint64_t off)
{
struct cramfs_super *cs;
Index: cramfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/cramfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cramfs.h 16 Feb 2005 22:40:47 -0000 1.1
+++ cramfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_CRAMFS_
#define _VOLUME_ID_CRAMFS_
-extern int volume_id_probe_cramfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_cramfs(struct volume_id *id, uint64_t off);
#endif
--- dasd.c DELETED ---
--- dasd.h DELETED ---
Index: ext.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/ext.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ext.c 27 Jun 2005 14:52:03 -0000 1.4
+++ ext.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,29 +39,29 @@
#include "ext.h"
struct ext2_super_block {
- __u32 inodes_count;
- __u32 blocks_count;
- __u32 r_blocks_count;
- __u32 free_blocks_count;
- __u32 free_inodes_count;
- __u32 first_data_block;
- __u32 log_block_size;
- __u32 dummy3[7];
- __u8 magic[2];
- __u16 state;
- __u32 dummy5[8];
- __u32 feature_compat;
- __u32 feature_incompat;
- __u32 feature_ro_compat;
- __u8 uuid[16];
- __u8 volume_name[16];
+ uint32_t inodes_count;
+ uint32_t blocks_count;
+ uint32_t r_blocks_count;
+ uint32_t free_blocks_count;
+ uint32_t free_inodes_count;
+ uint32_t first_data_block;
+ uint32_t log_block_size;
+ uint32_t dummy3[7];
+ uint8_t magic[2];
+ uint16_t state;
+ uint32_t dummy5[8];
+ uint32_t feature_compat;
+ uint32_t feature_incompat;
+ uint32_t feature_ro_compat;
+ uint8_t uuid[16];
+ uint8_t volume_name[16];
} __attribute__((__packed__));
#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x00000004
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x00000008
#define EXT_SUPERBLOCK_OFFSET 0x400
-int volume_id_probe_ext(struct volume_id *id, __u64 off)
+int volume_id_probe_ext(struct volume_id *id, uint64_t off)
{
struct ext2_super_block *es;
Index: ext.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/ext.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ext.h 7 Feb 2005 21:24:16 -0000 1.1
+++ ext.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_EXT_
#define _VOLUME_ID_EXT_
-extern int volume_id_probe_ext(struct volume_id *id, __u64 off);
+extern int volume_id_probe_ext(struct volume_id *id, uint64_t off);
#endif
Index: fat.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/fat.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- fat.c 26 Jul 2005 04:40:43 -0000 1.6
+++ fat.c 12 Aug 2005 22:28:30 -0000 1.7
@@ -47,62 +47,62 @@
#define FAT_ENTRY_FREE 0xe5
struct vfat_super_block {
- __u8 boot_jump[3];
- __u8 sysid[8];
- __u16 sector_size;
- __u8 sectors_per_cluster;
- __u16 reserved;
- __u8 fats;
- __u16 dir_entries;
- __u16 sectors;
- __u8 media;
- __u16 fat_length;
- __u16 secs_track;
- __u16 heads;
- __u32 hidden;
- __u32 total_sect;
+ uint8_t boot_jump[3];
+ uint8_t sysid[8];
+ uint16_t sector_size;
+ uint8_t sectors_per_cluster;
+ uint16_t reserved;
+ uint8_t fats;
+ uint16_t dir_entries;
+ uint16_t sectors;
+ uint8_t media;
+ uint16_t fat_length;
+ uint16_t secs_track;
+ uint16_t heads;
+ uint32_t hidden;
+ uint32_t total_sect;
union {
struct fat_super_block {
- __u8 unknown[3];
- __u8 serno[4];
- __u8 label[11];
- __u8 magic[8];
- __u8 dummy2[192];
- __u8 pmagic[2];
+ uint8_t unknown[3];
+ uint8_t serno[4];
+ uint8_t label[11];
+ uint8_t magic[8];
+ uint8_t dummy2[192];
+ uint8_t pmagic[2];
} __attribute__((__packed__)) fat;
struct fat32_super_block {
- __u32 fat32_length;
- __u16 flags;
- __u8 version[2];
- __u32 root_cluster;
- __u16 insfo_sector;
- __u16 backup_boot;
- __u16 reserved2[6];
- __u8 unknown[3];
- __u8 serno[4];
- __u8 label[11];
- __u8 magic[8];
- __u8 dummy2[164];
- __u8 pmagic[2];
+ uint32_t fat32_length;
+ uint16_t flags;
+ uint8_t version[2];
+ uint32_t root_cluster;
+ uint16_t insfo_sector;
+ uint16_t backup_boot;
+ uint16_t reserved2[6];
+ uint8_t unknown[3];
+ uint8_t serno[4];
+ uint8_t label[11];
+ uint8_t magic[8];
+ uint8_t dummy2[164];
+ uint8_t pmagic[2];
} __attribute__((__packed__)) fat32;
} __attribute__((__packed__)) type;
} __attribute__((__packed__));
struct vfat_dir_entry {
- __u8 name[11];
- __u8 attr;
- __u16 time_creat;
- __u16 date_creat;
- __u16 time_acc;
- __u16 date_acc;
- __u16 cluster_high;
- __u16 time_write;
- __u16 date_write;
- __u16 cluster_low;
- __u32 size;
+ uint8_t name[11];
+ uint8_t attr;
+ uint16_t time_creat;
+ uint16_t date_creat;
+ uint16_t time_acc;
+ uint16_t date_acc;
+ uint16_t cluster_high;
+ uint16_t time_write;
+ uint16_t date_write;
+ uint16_t cluster_low;
+ uint32_t size;
} __attribute__((__packed__));
-static char *get_attr_volume_id(struct vfat_dir_entry *dir, unsigned int count)
+static uint8_t *get_attr_volume_id(struct vfat_dir_entry *dir, unsigned int count)
{
unsigned int i;
@@ -127,7 +127,7 @@
continue;
dbg("found ATTR_VOLUME_ID id in root dir");
- return (char *) dir[i].name;
+ return dir[i].name;
}
dbg("skip dir entry");
@@ -136,26 +136,26 @@
return NULL;
}
-int volume_id_probe_vfat(struct volume_id *id, __u64 off)
+int volume_id_probe_vfat(struct volume_id *id, uint64_t off)
{
struct vfat_super_block *vs;
struct vfat_dir_entry *dir;
- __u16 sector_size;
- __u16 dir_entries;
- __u32 sect_count;
- __u16 reserved;
- __u32 fat_size;
- __u32 root_cluster;
- __u32 dir_size;
- __u32 cluster_count;
- __u32 fat_length;
- __u64 root_start;
- __u32 start_data_sect;
- __u16 root_dir_entries;
- __u8 *buf;
- __u32 buf_size;
- __u8 *label = NULL;
- __u32 next;
+ uint16_t sector_size;
+ uint16_t dir_entries;
+ uint32_t sect_count;
+ uint16_t reserved;
+ uint32_t fat_size;
+ uint32_t root_cluster;
+ uint32_t dir_size;
+ uint32_t cluster_count;
+ uint32_t fat_length;
+ uint64_t root_start;
+ uint32_t start_data_sect;
+ uint16_t root_dir_entries;
+ uint8_t *buf;
+ uint32_t buf_size;
+ uint8_t *label = NULL;
+ uint32_t next;
int maxloop;
dbg("probing at offset 0x%llx", (unsigned long long) off);
@@ -267,7 +267,7 @@
dir = (struct vfat_dir_entry*) buf;
- label = (__u8 *) get_attr_volume_id(dir, root_dir_entries);
+ label = get_attr_volume_id(dir, root_dir_entries);
vs = (struct vfat_super_block *) volume_id_get_buffer(id, off, 0x200);
if (vs == NULL)
@@ -293,9 +293,9 @@
next = root_cluster;
maxloop = 100;
while (--maxloop) {
- __u32 next_sect_off;
- __u64 next_off;
- __u64 fat_entry_off;
+ uint32_t next_sect_off;
+ uint64_t next_off;
+ uint64_t fat_entry_off;
int count;
dbg("next cluster %u", next);
@@ -312,18 +312,18 @@
count = buf_size / sizeof(struct vfat_dir_entry);
dbg("expected entries 0x%x", count);
- label = (__u8 *) get_attr_volume_id(dir, count);
+ label = get_attr_volume_id(dir, count);
if (label)
break;
/* get FAT entry */
- fat_entry_off = (reserved * sector_size) + (next * sizeof(__u32));
+ fat_entry_off = (reserved * sector_size) + (next * sizeof(uint32_t));
buf = volume_id_get_buffer(id, off + fat_entry_off, buf_size);
if (buf == NULL)
goto found;
/* set next cluster */
- next = le32_to_cpu(*((__u32 *) buf) & 0x0fffffff);
+ next = le32_to_cpu(*((uint32_t *) buf) & 0x0fffffff);
if (next == 0)
break;
}
Index: fat.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/fat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fat.h 7 Feb 2005 21:24:16 -0000 1.1
+++ fat.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_FAT_
#define _VOLUME_ID_FAT_
-extern int volume_id_probe_vfat(struct volume_id *id, __u64 off);
+extern int volume_id_probe_vfat(struct volume_id *id, uint64_t off);
#endif
Index: hfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/hfs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hfs.c 27 Jun 2005 14:52:03 -0000 1.4
+++ hfs.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,104 +39,104 @@
#include "hfs.h"
struct hfs_finder_info{
- __u32 boot_folder;
- __u32 start_app;
- __u32 open_folder;
- __u32 os9_folder;
- __u32 reserved;
- __u32 osx_folder;
- __u8 id[8];
+ uint32_t boot_folder;
+ uint32_t start_app;
+ uint32_t open_folder;
+ uint32_t os9_folder;
+ uint32_t reserved;
+ uint32_t osx_folder;
+ uint8_t id[8];
} __attribute__((__packed__));
struct hfs_mdb {
- __u8 signature[2];
- __u32 cr_date;
- __u32 ls_Mod;
- __u16 atrb;
- __u16 nm_fls;
- __u16 vbm_st;
- __u16 alloc_ptr;
- __u16 nm_al_blks;
- __u32 al_blk_size;
- __u32 clp_size;
- __u16 al_bl_st;
- __u32 nxt_cnid;
- __u16 free_bks;
- __u8 label_len;
- __u8 label[27];
- __u32 vol_bkup;
- __u16 vol_seq_num;
- __u32 wr_cnt;
- __u32 xt_clump_size;
- __u32 ct_clump_size;
- __u16 num_root_dirs;
- __u32 file_count;
- __u32 dir_count;
+ uint8_t signature[2];
+ uint32_t cr_date;
+ uint32_t ls_Mod;
+ uint16_t atrb;
+ uint16_t nm_fls;
+ uint16_t vbm_st;
+ uint16_t alloc_ptr;
+ uint16_t nm_al_blks;
+ uint32_t al_blk_size;
+ uint32_t clp_size;
+ uint16_t al_bl_st;
+ uint32_t nxt_cnid;
+ uint16_t free_bks;
+ uint8_t label_len;
+ uint8_t label[27];
+ uint32_t vol_bkup;
+ uint16_t vol_seq_num;
+ uint32_t wr_cnt;
+ uint32_t xt_clump_size;
+ uint32_t ct_clump_size;
+ uint16_t num_root_dirs;
+ uint32_t file_count;
+ uint32_t dir_count;
struct hfs_finder_info finder_info;
- __u8 embed_sig[2];
- __u16 embed_startblock;
- __u16 embed_blockcount;
+ uint8_t embed_sig[2];
+ uint16_t embed_startblock;
+ uint16_t embed_blockcount;
} __attribute__((__packed__)) *hfs;
struct hfsplus_bnode_descriptor {
- __u32 next;
- __u32 prev;
- __u8 type;
- __u8 height;
- __u16 num_recs;
- __u16 reserved;
+ uint32_t next;
+ uint32_t prev;
+ uint8_t type;
+ uint8_t height;
+ uint16_t num_recs;
+ uint16_t reserved;
} __attribute__((__packed__));
struct hfsplus_bheader_record {
- __u16 depth;
- __u32 root;
- __u32 leaf_count;
- __u32 leaf_head;
- __u32 leaf_tail;
- __u16 node_size;
+ uint16_t depth;
+ uint32_t root;
+ uint32_t leaf_count;
+ uint32_t leaf_head;
+ uint32_t leaf_tail;
+ uint16_t node_size;
} __attribute__((__packed__));
struct hfsplus_catalog_key {
- __u16 key_len;
- __u32 parent_id;
- __u16 unicode_len;
- __u8 unicode[255 * 2];
+ uint16_t key_len;
+ uint32_t parent_id;
+ uint16_t unicode_len;
+ uint8_t unicode[255 * 2];
} __attribute__((__packed__));
struct hfsplus_extent {
- __u32 start_block;
- __u32 block_count;
+ uint32_t start_block;
+ uint32_t block_count;
} __attribute__((__packed__));
#define HFSPLUS_EXTENT_COUNT 8
struct hfsplus_fork {
- __u64 total_size;
- __u32 clump_size;
- __u32 total_blocks;
+ uint64_t total_size;
+ uint32_t clump_size;
+ uint32_t total_blocks;
struct hfsplus_extent extents[HFSPLUS_EXTENT_COUNT];
} __attribute__((__packed__));
struct hfsplus_vol_header {
- __u8 signature[2];
- __u16 version;
- __u32 attributes;
- __u32 last_mount_vers;
- __u32 reserved;
- __u32 create_date;
- __u32 modify_date;
- __u32 backup_date;
- __u32 checked_date;
- __u32 file_count;
- __u32 folder_count;
- __u32 blocksize;
- __u32 total_blocks;
- __u32 free_blocks;
- __u32 next_alloc;
- __u32 rsrc_clump_sz;
- __u32 data_clump_sz;
- __u32 next_cnid;
- __u32 write_count;
- __u64 encodings_bmp;
+ uint8_t signature[2];
+ uint16_t version;
+ uint32_t attributes;
+ uint32_t last_mount_vers;
+ uint32_t reserved;
+ uint32_t create_date;
+ uint32_t modify_date;
+ uint32_t backup_date;
+ uint32_t checked_date;
+ uint32_t file_count;
+ uint32_t folder_count;
+ uint32_t blocksize;
+ uint32_t total_blocks;
+ uint32_t free_blocks;
+ uint32_t next_alloc;
+ uint32_t rsrc_clump_sz;
+ uint32_t data_clump_sz;
+ uint32_t next_cnid;
+ uint32_t write_count;
+ uint64_t encodings_bmp;
struct hfs_finder_info finder_info;
struct hfsplus_fork alloc_file;
struct hfsplus_fork ext_file;
@@ -149,7 +149,7 @@
#define HFS_NODE_LEAF 0xff
#define HFSPLUS_POR_CNID 1
-int volume_id_probe_hfs_hfsplus(struct volume_id *id, __u64 off)
+int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off)
{
unsigned int blocksize;
unsigned int cat_block;
@@ -160,7 +160,7 @@
unsigned int leaf_node_count;
unsigned int leaf_node_size;
unsigned int leaf_block;
- __u64 leaf_off;
+ uint64_t leaf_off;
unsigned int alloc_block_size;
unsigned int alloc_first_block;
unsigned int embed_first_block;
@@ -168,9 +168,9 @@
struct hfsplus_bnode_descriptor *descr;
struct hfsplus_bheader_record *bnode;
struct hfsplus_catalog_key *key;
- unsigned int label_len;
+ unsigned int label_len;
struct hfsplus_extent extents[HFSPLUS_EXTENT_COUNT];
- const __u8 *buf;
+ const uint8_t *buf;
dbg("probing at offset 0x%llx", (unsigned long long) off);
Index: hfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/hfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hfs.h 7 Feb 2005 21:24:16 -0000 1.1
+++ hfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_HFS_
#define _VOLUME_ID_HFS_
-extern int volume_id_probe_hfs_hfsplus(struct volume_id *id, __u64 off);
+extern int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off);
#endif
Index: highpoint.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/highpoint.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- highpoint.c 27 Jun 2005 14:52:03 -0000 1.5
+++ highpoint.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -39,12 +39,12 @@
#include "highpoint.h"
struct hpt37x_meta {
- __u8 filler1[32];
- __u32 magic;
+ uint8_t filler1[32];
+ uint32_t magic;
} __attribute__((packed));
struct hpt45x_meta {
- __u32 magic;
+ uint32_t magic;
} __attribute__((packed));
#define HPT37X_CONFIG_OFF 0x1200
@@ -55,11 +55,11 @@
#define HPT45X_MAGIC_BAD 0x5a7816fd
-int volume_id_probe_highpoint_37x_raid(struct volume_id *id, __u64 off)
+int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off)
{
- const __u8 *buf;
+ const uint8_t *buf;
struct hpt37x_meta *hpt;
- __u32 magic;
+ uint32_t magic;
dbg("probing at offset 0x%llx", (unsigned long long) off);
@@ -78,12 +78,12 @@
return 0;
}
-int volume_id_probe_highpoint_45x_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
+ const uint8_t *buf;
struct hpt45x_meta *hpt;
- __u64 meta_off;
- __u32 magic;
+ uint64_t meta_off;
+ uint32_t magic;
dbg("probing at offset 0x%llx, size 0x%llx",
(unsigned long long) off, (unsigned long long) size);
Index: highpoint.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/highpoint.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- highpoint.h 11 Mar 2005 18:00:35 -0000 1.2
+++ highpoint.h 12 Aug 2005 22:28:30 -0000 1.3
@@ -21,7 +21,7 @@
#ifndef _VOLUME_ID_HIGHPOINT_
#define _VOLUME_ID_HIGHPOINT_
-extern int volume_id_probe_highpoint_37x_raid(struct volume_id *id, __u64 off);
-extern int volume_id_probe_highpoint_45x_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off);
+extern int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: hpfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/hpfs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hpfs.c 27 Jun 2005 14:52:03 -0000 1.3
+++ hpfs.c 12 Aug 2005 22:28:30 -0000 1.4
@@ -40,13 +40,13 @@
struct hpfs_super
{
- __u8 magic[4];
- __u8 version;
+ uint8_t magic[4];
+ uint8_t version;
} __attribute__((__packed__));
#define HPFS_SUPERBLOCK_OFFSET 0x2000
-int volume_id_probe_hpfs(struct volume_id *id, __u64 off)
+int volume_id_probe_hpfs(struct volume_id *id, uint64_t off)
{
struct hpfs_super *hs;
Index: hpfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/hpfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hpfs.h 16 Feb 2005 22:40:47 -0000 1.1
+++ hpfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_HPFS_
#define _VOLUME_ID_HPFS_
-extern int volume_id_probe_hpfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_hpfs(struct volume_id *id, uint64_t off);
#endif
Index: iso9660.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/iso9660.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- iso9660.c 26 Jul 2005 04:40:43 -0000 1.5
+++ iso9660.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -47,27 +47,27 @@
#define ISO_VD_MAX 16
struct iso_volume_descriptor {
- __u8 vd_type;
- __u8 vd_id[5];
- __u8 vd_version;
- __u8 flags;
- __u8 system_id[32];
- __u8 volume_id[32];
- __u8 unused[8];
- __u8 space_size[8];
- __u8 escape_sequences[8];
+ uint8_t vd_type;
+ uint8_t vd_id[5];
+ uint8_t vd_version;
+ uint8_t flags;
+ uint8_t system_id[32];
+ uint8_t volume_id[32];
+ uint8_t unused[8];
+ uint8_t space_size[8];
+ uint8_t escape_sequences[8];
} __attribute__((__packed__));
struct high_sierra_volume_descriptor {
- __u8 foo[8];
- __u8 type;
- __u8 id[4];
- __u8 version;
+ uint8_t foo[8];
+ uint8_t type;
+ uint8_t id[4];
+ uint8_t version;
} __attribute__((__packed__));
-int volume_id_probe_iso9660(struct volume_id *id, __u64 off)
+int volume_id_probe_iso9660(struct volume_id *id, uint64_t off)
{
- __u8 *buf;
+ uint8_t *buf;
struct iso_volume_descriptor *is;
struct high_sierra_volume_descriptor *hs;
@@ -90,7 +90,7 @@
dbg("looking for SVDs");
vd_offset = ISO_VD_OFFSET;
for (i = 0; i < ISO_VD_MAX; i++) {
- char svd_label[64];
+ uint8_t svd_label[64];
is = (struct iso_volume_descriptor *) volume_id_get_buffer(id, off + vd_offset, 0x200);
if (is == NULL || is->vd_type == ISO_VD_END)
@@ -103,14 +103,14 @@
memcmp(is->escape_sequences, "%/C", 3) == 0||
memcmp(is->escape_sequences, "%/E", 3) == 0) {
dbg("Joliet extension found");
- volume_id_set_unicode16(svd_label, sizeof(svd_label), is->volume_id, BE, 32);
+ volume_id_set_unicode16((char *)svd_label, sizeof(svd_label), is->volume_id, BE, 32);
if (memcmp(id->label, svd_label, 16) == 0) {
dbg("SVD label is identical, use the possibly longer PVD one");
break;
}
volume_id_set_label_raw(id, is->volume_id, 32);
- volume_id_set_label_string(id, (__u8 *) svd_label, 32);
+ volume_id_set_label_string(id, svd_label, 32);
strcpy(id->type_version, "Joliet Extension");
goto found;
}
Index: iso9660.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/iso9660.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- iso9660.h 7 Feb 2005 21:24:16 -0000 1.1
+++ iso9660.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_ISO9660_
#define _VOLUME_ID_ISO9660_
-extern int volume_id_probe_iso9660(struct volume_id *id, __u64 off);
+extern int volume_id_probe_iso9660(struct volume_id *id, uint64_t off);
#endif
Index: isw_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/isw_raid.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- isw_raid.c 26 Jul 2005 04:40:43 -0000 1.3
+++ isw_raid.c 12 Aug 2005 22:28:30 -0000 1.4
@@ -39,20 +39,20 @@
#include "isw_raid.h"
struct isw_meta {
- __u8 sig[32];
- __u32 check_sum;
- __u32 mpb_size;
- __u32 family_num;
- __u32 generation_num;
+ uint8_t sig[32];
+ uint32_t check_sum;
+ uint32_t mpb_size;
+ uint32_t family_num;
+ uint32_t generation_num;
} __attribute__((packed));
#define ISW_SIGNATURE "Intel Raid ISM Cfg Sig. "
-int volume_id_probe_intel_software_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
- __u64 meta_off;
+ const uint8_t *buf;
+ uint64_t meta_off;
struct isw_meta *isw;
dbg("probing at offset 0x%llx, size 0x%llx",
@@ -71,7 +71,7 @@
return -1;
volume_id_set_usage(id, VOLUME_ID_RAID);
- strncpy(id->type_version, (char *) &isw->sig[sizeof(ISW_SIGNATURE)-1], 6);
+ memcpy(id->type_version, &isw->sig[sizeof(ISW_SIGNATURE)-1], 6);
id->type = "isw_raid_member";
return 0;
Index: isw_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/isw_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- isw_raid.h 11 Mar 2005 18:00:35 -0000 1.1
+++ isw_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_ISW_RAID_
#define _VOLUME_ID_ISW_RAID_
-extern int volume_id_probe_intel_software_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: jfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/jfs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- jfs.c 27 Jun 2005 14:52:03 -0000 1.4
+++ jfs.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,21 +39,21 @@
#include "jfs.h"
struct jfs_super_block {
- __u8 magic[4];
- __u32 version;
- __u64 size;
- __u32 bsize;
- __u32 dummy1;
- __u32 pbsize;
- __u32 dummy2[27];
- __u8 uuid[16];
- __u8 label[16];
- __u8 loguuid[16];
+ uint8_t magic[4];
+ uint32_t version;
+ uint64_t size;
+ uint32_t bsize;
+ uint32_t dummy1;
+ uint32_t pbsize;
+ uint32_t dummy2[27];
+ uint8_t uuid[16];
+ uint8_t label[16];
+ uint8_t loguuid[16];
} __attribute__((__packed__));
#define JFS_SUPERBLOCK_OFFSET 0x8000
-int volume_id_probe_jfs(struct volume_id *id, __u64 off)
+int volume_id_probe_jfs(struct volume_id *id, uint64_t off)
{
struct jfs_super_block *js;
Index: jfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/jfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- jfs.h 7 Feb 2005 21:24:16 -0000 1.1
+++ jfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_JFS_
#define _VOLUME_ID_JFS_
-extern int volume_id_probe_jfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_jfs(struct volume_id *id, uint64_t off);
#endif
Index: linux_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/linux_raid.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- linux_raid.c 27 Jun 2005 14:52:03 -0000 1.5
+++ linux_raid.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -39,32 +39,32 @@
#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;
+ uint32_t md_magic;
+ uint32_t major_version;
+ uint32_t minor_version;
+ uint32_t patch_version;
+ uint32_t gvalid_words;
+ uint32_t set_uuid0;
+ uint32_t ctime;
+ uint32_t level;
+ uint32_t size;
+ uint32_t nr_disks;
+ uint32_t raid_disks;
+ uint32_t md_minor;
+ uint32_t not_persistent;
+ uint32_t set_uuid1;
+ uint32_t set_uuid2;
+ uint32_t 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)
+int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
- __u64 sboff;
- __u8 uuid[16];
+ const uint8_t *buf;
+ uint64_t sboff;
+ uint8_t uuid[16];
dbg("probing at offset 0x%llx, size 0x%llx",
(unsigned long long) off, (unsigned long long) size);
Index: linux_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/linux_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- linux_raid.h 7 Feb 2005 21:24:16 -0000 1.1
+++ linux_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_LINUX_RAID_
#define _VOLUME_ID_LINUX_RAID_
-extern int volume_id_probe_linux_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: linux_swap.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/linux_swap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- linux_swap.c 27 Jun 2005 14:52:03 -0000 1.4
+++ linux_swap.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,19 +39,19 @@
#include "linux_swap.h"
struct swap_header_v1_2 {
- __u8 bootbits[1024];
- __u32 version;
- __u32 last_page;
- __u32 nr_badpages;
- __u8 uuid[16];
- __u8 volume_name[16];
+ uint8_t bootbits[1024];
+ uint32_t version;
+ uint32_t last_page;
+ uint32_t nr_badpages;
+ uint8_t uuid[16];
+ uint8_t volume_name[16];
} __attribute__((__packed__)) *sw;
#define LARGEST_PAGESIZE 0x4000
-int volume_id_probe_linux_swap(struct volume_id *id, __u64 off)
+int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off)
{
- const __u8 *buf;
+ const uint8_t *buf;
unsigned int page;
dbg("probing at offset 0x%llx", (unsigned long long) off);
Index: linux_swap.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/linux_swap.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- linux_swap.h 7 Feb 2005 21:24:16 -0000 1.1
+++ linux_swap.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_LINUX_SWAP_
#define _VOLUME_ID_LINUX_SWAP_
-extern int volume_id_probe_linux_swap(struct volume_id *id, __u64 off);
+extern int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off);
#endif
Index: lsi_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/lsi_raid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- lsi_raid.c 27 Jun 2005 14:52:03 -0000 1.2
+++ lsi_raid.c 12 Aug 2005 22:28:30 -0000 1.3
@@ -39,15 +39,15 @@
#include "lsi_raid.h"
struct lsi_meta {
- __u8 sig[6];
+ uint8_t sig[6];
} __attribute__((packed));
#define LSI_SIGNATURE "$XIDE$"
-int volume_id_probe_lsi_mega_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
- __u64 meta_off;
+ const uint8_t *buf;
+ uint64_t meta_off;
struct lsi_meta *lsi;
dbg("probing at offset 0x%llx, size 0x%llx",
Index: lsi_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/lsi_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- lsi_raid.h 11 Mar 2005 18:00:35 -0000 1.1
+++ lsi_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_LSI_RAID_
#define _VOLUME_ID_LSI_RAID_
-extern int volume_id_probe_lsi_mega_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: luks.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/luks.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- luks.c 27 Jun 2005 14:52:03 -0000 1.5
+++ luks.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -48,33 +48,33 @@
#define LUKS_SALTSIZE 32
#define LUKS_NUMKEYS 8
-const __u8 LUKS_MAGIC[] = {'L','U','K','S', 0xba, 0xbe};
+const uint8_t LUKS_MAGIC[] = {'L','U','K','S', 0xba, 0xbe};
#define LUKS_MAGIC_L 6
#define LUKS_PHDR_SIZE (sizeof(struct luks_phdr)/SECTOR_SIZE+1)
#define UUID_STRING_L 40
struct luks_phdr {
- __u8 magic[LUKS_MAGIC_L];
- __u16 version;
- __u8 cipherName[LUKS_CIPHERNAME_L];
- __u8 cipherMode[LUKS_CIPHERMODE_L];
- __u8 hashSpec[LUKS_HASHSPEC_L];
- __u32 payloadOffset;
- __u32 keyBytes;
- __u8 mkDigest[LUKS_DIGESTSIZE];
- __u8 mkDigestSalt[LUKS_SALTSIZE];
- __u32 mkDigestIterations;
- __u8 uuid[UUID_STRING_L];
+ uint8_t magic[LUKS_MAGIC_L];
+ uint16_t version;
+ uint8_t cipherName[LUKS_CIPHERNAME_L];
+ uint8_t cipherMode[LUKS_CIPHERMODE_L];
+ uint8_t hashSpec[LUKS_HASHSPEC_L];
+ uint32_t payloadOffset;
+ uint32_t keyBytes;
+ uint8_t mkDigest[LUKS_DIGESTSIZE];
+ uint8_t mkDigestSalt[LUKS_SALTSIZE];
+ uint32_t mkDigestIterations;
+ uint8_t uuid[UUID_STRING_L];
struct {
- __u32 active;
- __u32 passwordIterations;
- __u8 passwordSalt[LUKS_SALTSIZE];
- __u32 keyMaterialOffset;
- __u32 stripes;
+ uint32_t active;
+ uint32_t passwordIterations;
+ uint8_t passwordSalt[LUKS_SALTSIZE];
+ uint32_t keyMaterialOffset;
+ uint32_t stripes;
} keyblock[LUKS_NUMKEYS];
};
-int volume_id_probe_luks(struct volume_id *id, __u64 off)
+int volume_id_probe_luks(struct volume_id *id, uint64_t off)
{
struct luks_phdr *header;
Index: luks.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/luks.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- luks.h 25 Feb 2005 17:21:48 -0000 1.2
+++ luks.h 12 Aug 2005 22:28:30 -0000 1.3
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_LUKS_
#define _VOLUME_ID_LUKS_
-extern int volume_id_probe_luks(struct volume_id *id, __u64 off);
+extern int volume_id_probe_luks(struct volume_id *id, uint64_t off);
#endif
Index: lvm.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/lvm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- lvm.c 26 Jul 2005 04:40:43 -0000 1.5
+++ lvm.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -39,23 +39,23 @@
#include "lvm.h"
struct lvm1_super_block {
- __u8 id[2];
+ uint8_t id[2];
} __attribute__((packed));
struct lvm2_super_block {
- __u8 id[8];
- __u64 sector_xl;
- __u32 crc_xl;
- __u32 offset_xl;
- __u8 type[8];
+ uint8_t id[8];
+ uint64_t sector_xl;
+ uint32_t crc_xl;
+ uint32_t offset_xl;
+ uint8_t type[8];
} __attribute__((packed));
#define LVM1_SB_OFF 0x400
#define LVM1_MAGIC "HM"
-int volume_id_probe_lvm1(struct volume_id *id, __u64 off)
+int volume_id_probe_lvm1(struct volume_id *id, uint64_t off)
{
- const __u8 *buf;
+ const uint8_t *buf;
struct lvm1_super_block *lvm;
dbg("probing at offset 0x%llx", (unsigned long long) off);
@@ -78,9 +78,9 @@
#define LVM2_LABEL_ID "LABELONE"
#define LVM2LABEL_SCAN_SECTORS 4
-int volume_id_probe_lvm2(struct volume_id *id, __u64 off)
+int volume_id_probe_lvm2(struct volume_id *id, uint64_t off)
{
- const __u8 *buf;
+ const uint8_t *buf;
unsigned int soff;
struct lvm2_super_block *lvm;
@@ -101,7 +101,7 @@
return -1;
found:
- strncpy(id->type_version, (char *) lvm->type, 8);
+ memcpy(id->type_version, lvm->type, 8);
volume_id_set_usage(id, VOLUME_ID_RAID);
id->type = "LVM2_member";
Index: lvm.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/lvm.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- lvm.h 7 Feb 2005 21:24:16 -0000 1.1
+++ lvm.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,7 +21,7 @@
#ifndef _VOLUME_ID_LVM_
#define _VOLUME_ID_LVM_
-extern int volume_id_probe_lvm1(struct volume_id *id, __u64 off);
-extern int volume_id_probe_lvm2(struct volume_id *id, __u64 off);
+extern int volume_id_probe_lvm1(struct volume_id *id, uint64_t off);
+extern int volume_id_probe_lvm2(struct volume_id *id, uint64_t off);
#endif
Index: mac.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/mac.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mac.c 27 Jun 2005 14:52:03 -0000 1.4
+++ mac.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -32,6 +32,7 @@
#include <string.h>
#include <errno.h>
#include <ctype.h>
+#include <asm/types.h>
#include "volume_id.h"
#include "logging.h"
@@ -39,24 +40,24 @@
#include "mac.h"
struct mac_driver_desc {
- __u8 signature[2];
- __u16 block_size;
- __u32 block_count;
+ uint8_t signature[2];
+ uint16_t block_size;
+ uint32_t block_count;
} __attribute__((__packed__));
struct mac_partition {
- __u8 signature[2];
- __u16 res1;
- __u32 map_count;
- __u32 start_block;
- __u32 block_count;
- __u8 name[32];
- __u8 type[32];
+ uint8_t signature[2];
+ uint16_t res1;
+ uint32_t map_count;
+ uint32_t start_block;
+ uint32_t block_count;
+ uint8_t name[32];
+ uint8_t type[32];
} __attribute__((__packed__));
-int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off)
+int volume_id_probe_mac_partition_map(struct volume_id *id, uint64_t off)
{
- const __u8 *buf;
+ const uint8_t *buf;
struct mac_driver_desc *driver;
struct mac_partition *part;
@@ -107,8 +108,8 @@
id->partition_count = part_count;
for (i = 0; i < part_count; i++) {
- __u64 poff;
- __u64 plen;
+ uint64_t poff;
+ uint64_t plen;
buf = volume_id_get_buffer(id, off + ((i+1) * bsize), 0x200);
if (buf == NULL)
Index: mac.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/mac.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mac.h 7 Feb 2005 21:24:16 -0000 1.1
+++ mac.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_MAC_
#define _VOLUME_ID_MAC_
-extern int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off);
+extern int volume_id_probe_mac_partition_map(struct volume_id *id, uint64_t off);
#endif
Index: minix.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/minix.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- minix.c 27 Jun 2005 14:52:03 -0000 1.2
+++ minix.c 12 Aug 2005 22:28:30 -0000 1.3
@@ -40,21 +40,21 @@
struct minix_super_block
{
- __u16 s_ninodes;
- __u16 s_nzones;
- __u16 s_imap_blocks;
- __u16 s_zmap_blocks;
- __u16 s_firstdatazone;
- __u16 s_log_zone_size;
- __u32 s_max_size;
- __u16 s_magic;
- __u16 s_state;
- __u32 s_zones;
+ uint16_t s_ninodes;
+ uint16_t s_nzones;
+ uint16_t s_imap_blocks;
+ uint16_t s_zmap_blocks;
+ uint16_t s_firstdatazone;
+ uint16_t s_log_zone_size;
+ uint32_t s_max_size;
+ uint16_t s_magic;
+ uint16_t s_state;
+ uint32_t s_zones;
} __attribute__((__packed__));
#define MINIX_SUPERBLOCK_OFFSET 0x400
-int volume_id_probe_minix(struct volume_id *id, __u64 off)
+int volume_id_probe_minix(struct volume_id *id, uint64_t off)
{
struct minix_super_block *ms;
Index: minix.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/minix.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- minix.h 10 Mar 2005 23:18:33 -0000 1.1
+++ minix.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_MINIX_
#define _VOLUME_ID_MINIX_
-extern int volume_id_probe_minix(struct volume_id *id, __u64 off);
+extern int volume_id_probe_minix(struct volume_id *id, uint64_t off);
#endif
Index: msdos.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/msdos.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- msdos.c 27 Jun 2005 14:52:03 -0000 1.4
+++ msdos.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,16 +39,16 @@
#include "msdos.h"
struct msdos_partition_entry {
- __u8 boot_ind;
- __u8 head;
- __u8 sector;
- __u8 cyl;
- __u8 sys_ind;
- __u8 end_head;
- __u8 end_sector;
- __u8 end_cyl;
- __u32 start_sect;
- __u32 nr_sects;
+ uint8_t boot_ind;
+ uint8_t head;
+ uint8_t sector;
+ uint8_t cyl;
+ uint8_t sys_ind;
+ uint8_t end_head;
+ uint8_t end_sector;
+ uint8_t end_cyl;
+ uint32_t start_sect;
+ uint32_t nr_sects;
} __attribute__((packed));
#define MSDOS_MAGIC "\x55\xaa"
@@ -66,15 +66,15 @@
#define is_raid(type) \
(type == LINUX_RAID_PARTITION)
-int volume_id_probe_msdos_part_table(struct volume_id *id, __u64 off)
+int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off)
{
- const __u8 *buf;
+ const uint8_t *buf;
int i;
- __u64 poff;
- __u64 plen;
- __u64 extended = 0;
- __u64 current;
- __u64 next;
+ uint64_t poff;
+ uint64_t plen;
+ uint64_t extended = 0;
+ uint64_t current;
+ uint64_t next;
int limit;
int empty = 1;
struct msdos_partition_entry *part;
@@ -112,8 +112,8 @@
VOLUME_ID_PARTITIONS_MAX * sizeof(struct volume_id_partition));
for (i = 0; i < 4; i++) {
- poff = (__u64) le32_to_cpu(part[i].start_sect) * BSIZE;
- plen = (__u64) le32_to_cpu(part[i].nr_sects) * BSIZE;
+ poff = (uint64_t) le32_to_cpu(part[i].start_sect) * BSIZE;
+ plen = (uint64_t) le32_to_cpu(part[i].nr_sects) * BSIZE;
if (plen == 0)
continue;
@@ -166,8 +166,8 @@
next = 0;
for (i = 0; i < 4; i++) {
- poff = (__u64) le32_to_cpu(part[i].start_sect) * BSIZE;
- plen = (__u64) le32_to_cpu(part[i].nr_sects) * BSIZE;
+ poff = (uint64_t) le32_to_cpu(part[i].start_sect) * BSIZE;
+ plen = (uint64_t) le32_to_cpu(part[i].nr_sects) * BSIZE;
if (plen == 0)
continue;
Index: msdos.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/msdos.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- msdos.h 7 Feb 2005 21:24:16 -0000 1.1
+++ msdos.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_MSDOS_
#define _VOLUME_ID_MSDOS_
-extern int volume_id_probe_msdos_part_table(struct volume_id *id, __u64 off);
+extern int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off);
#endif
Index: ntfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/ntfs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ntfs.c 27 Jun 2005 14:52:03 -0000 1.5
+++ ntfs.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -39,61 +39,61 @@
#include "ntfs.h"
struct ntfs_super_block {
- __u8 jump[3];
- __u8 oem_id[8];
- __u16 bytes_per_sector;
- __u8 sectors_per_cluster;
- __u16 reserved_sectors;
- __u8 fats;
- __u16 root_entries;
- __u16 sectors;
- __u8 media_type;
- __u16 sectors_per_fat;
- __u16 sectors_per_track;
- __u16 heads;
- __u32 hidden_sectors;
- __u32 large_sectors;
- __u16 unused[2];
- __u64 number_of_sectors;
- __u64 mft_cluster_location;
- __u64 mft_mirror_cluster_location;
- __s8 cluster_per_mft_record;
- __u8 reserved1[3];
- __s8 cluster_per_index_record;
- __u8 reserved2[3];
- __u8 volume_serial[8];
- __u16 checksum;
+ uint8_t jump[3];
+ uint8_t oem_id[8];
+ uint16_t bytes_per_sector;
+ uint8_t sectors_per_cluster;
+ uint16_t reserved_sectors;
+ uint8_t fats;
+ uint16_t root_entries;
+ uint16_t sectors;
+ uint8_t media_type;
+ uint16_t sectors_per_fat;
+ uint16_t sectors_per_track;
+ uint16_t heads;
+ uint32_t hidden_sectors;
+ uint32_t large_sectors;
+ uint16_t unused[2];
+ uint64_t number_of_sectors;
+ uint64_t mft_cluster_location;
+ uint64_t mft_mirror_cluster_location;
+ int8_t cluster_per_mft_record;
+ uint8_t reserved1[3];
+ int8_t cluster_per_index_record;
+ uint8_t reserved2[3];
+ uint8_t volume_serial[8];
+ uint16_t checksum;
} __attribute__((__packed__)) *ns;
struct master_file_table_record {
- __u8 magic[4];
- __u16 usa_ofs;
- __u16 usa_count;
- __u64 lsn;
- __u16 sequence_number;
- __u16 link_count;
- __u16 attrs_offset;
- __u16 flags;
- __u32 bytes_in_use;
- __u32 bytes_allocated;
+ uint8_t magic[4];
+ uint16_t usa_ofs;
+ uint16_t usa_count;
+ uint64_t lsn;
+ uint16_t sequence_number;
+ uint16_t link_count;
+ uint16_t attrs_offset;
+ uint16_t flags;
+ uint32_t bytes_in_use;
+ uint32_t bytes_allocated;
} __attribute__((__packed__)) *mftr;
struct file_attribute {
- __u32 type;
- __u32 len;
- __u8 non_resident;
- __u8 name_len;
- __u16 name_offset;
- __u16 flags;
- __u16 instance;
- __u32 value_len;
- __u16 value_offset;
+ uint32_t type;
+ uint32_t len;
+ uint8_t non_resident;
+ uint8_t name_len;
+ uint16_t name_offset;
+ uint16_t flags;
+ uint16_t instance;
+ uint32_t value_len;
+ uint16_t value_offset;
} __attribute__((__packed__)) *attr;
struct volume_info {
- __u64 reserved;
- __u8 major_ver;
- __u8 minor_ver;
+ uint64_t reserved;
+ uint8_t major_ver;
+ uint8_t minor_ver;
} __attribute__((__packed__)) *info;
#define MFT_RECORD_VOLUME 3
@@ -102,20 +102,20 @@
#define MFT_RECORD_ATTR_OBJECT_ID 0x40
#define MFT_RECORD_ATTR_END 0xffffffffu
-int volume_id_probe_ntfs(struct volume_id *id, __u64 off)
+int volume_id_probe_ntfs(struct volume_id *id, uint64_t off)
{
unsigned int sector_size;
unsigned int cluster_size;
- __u64 mft_cluster;
- __u64 mft_off;
+ uint64_t mft_cluster;
+ uint64_t mft_off;
unsigned int mft_record_size;
unsigned int attr_type;
unsigned int attr_off;
unsigned int attr_len;
unsigned int val_off;
unsigned int val_len;
- const __u8 *buf;
- const __u8 *val;
+ const uint8_t *buf;
+ const uint8_t *val;
dbg("probing at offset 0x%llx", (unsigned long long) off);
@@ -182,7 +182,7 @@
if (attr_type == MFT_RECORD_ATTR_VOLUME_INFO) {
dbg("found info, len %i", val_len);
- info = (struct volume_info*) (((__u8 *) attr) + val_off);
+ info = (struct volume_info*) (((uint8_t *) attr) + val_off);
snprintf(id->type_version, sizeof(id->type_version)-1,
"%u.%u", info->major_ver, info->minor_ver);
}
@@ -192,7 +192,7 @@
if (val_len > VOLUME_ID_LABEL_SIZE)
val_len = VOLUME_ID_LABEL_SIZE;
- val = ((__u8 *) attr) + val_off;
+ val = ((uint8_t *) attr) + val_off;
volume_id_set_label_raw(id, val, val_len);
volume_id_set_label_unicode16(id, val, LE, val_len);
}
Index: ntfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/ntfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ntfs.h 7 Feb 2005 21:24:16 -0000 1.1
+++ ntfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_NTFS_
#define _VOLUME_ID_NTFS_
-extern int volume_id_probe_ntfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_ntfs(struct volume_id *id, uint64_t off);
#endif
Index: nvidia_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/nvidia_raid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- nvidia_raid.c 27 Jun 2005 14:52:03 -0000 1.2
+++ nvidia_raid.c 12 Aug 2005 22:28:30 -0000 1.3
@@ -39,18 +39,18 @@
#include "nvidia_raid.h"
struct nvidia_meta {
- __u8 vendor[8];
- __u32 size;
- __u32 chksum;
- __u16 version;
+ uint8_t vendor[8];
+ uint32_t size;
+ uint32_t chksum;
+ uint16_t version;
} __attribute__((packed));
#define NVIDIA_SIGNATURE "NVIDIA"
-int volume_id_probe_nvidia_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
- __u64 meta_off;
+ const uint8_t *buf;
+ uint64_t meta_off;
struct nvidia_meta *nv;
dbg("probing at offset 0x%llx, size 0x%llx",
Index: nvidia_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/nvidia_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- nvidia_raid.h 11 Mar 2005 18:00:35 -0000 1.1
+++ nvidia_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_NVIDIA_RAID_
#define _VOLUME_ID_NVIDIA_RAID_
-extern int volume_id_probe_nvidia_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: promise_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/promise_raid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- promise_raid.c 27 Jun 2005 14:52:03 -0000 1.2
+++ promise_raid.c 12 Aug 2005 22:28:30 -0000 1.3
@@ -39,15 +39,15 @@
#include "promise_raid.h"
struct promise_meta {
- __u8 sig[24];
+ uint8_t sig[24];
} __attribute__((packed));
#define PDC_CONFIG_OFF 0x1200
#define PDC_SIGNATURE "Promise Technology, Inc."
-int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
+ const uint8_t *buf;
struct promise_meta *pdc;
unsigned int i;
static unsigned int sectors[] = {
@@ -61,7 +61,7 @@
return -1;
for (i = 0; sectors[i] != 0; i++) {
- __u64 meta_off;
+ uint64_t meta_off;
meta_off = ((size / 0x200) - sectors[i]) * 0x200;
buf = volume_id_get_buffer(id, off + meta_off, 0x200);
Index: promise_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/promise_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- promise_raid.h 11 Mar 2005 18:00:35 -0000 1.1
+++ promise_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_PROMISE_RAID_
#define _VOLUME_ID_PROMISE_RAID_
-extern int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: reiserfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/reiserfs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- reiserfs.c 27 Jun 2005 14:52:03 -0000 1.5
+++ reiserfs.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -33,6 +33,7 @@
#include <string.h>
#include <errno.h>
#include <ctype.h>
+#include <asm/types.h>
#include "volume_id.h"
#include "logging.h"
@@ -40,37 +41,37 @@
#include "reiserfs.h"
struct reiserfs_super_block {
- __u32 blocks_count;
- __u32 free_blocks;
- __u32 root_block;
- __u32 journal_block;
- __u32 journal_dev;
- __u32 orig_journal_size;
- __u32 dummy2[5];
- __u16 blocksize;
- __u16 dummy3[3];
- __u8 magic[12];
- __u32 dummy4[5];
- __u8 uuid[16];
- __u8 label[16];
+ uint32_t blocks_count;
+ uint32_t free_blocks;
+ uint32_t root_block;
+ uint32_t journal_block;
+ uint32_t journal_dev;
+ uint32_t orig_journal_size;
+ uint32_t dummy2[5];
+ uint16_t blocksize;
+ uint16_t dummy3[3];
+ uint8_t magic[12];
+ uint32_t dummy4[5];
+ uint8_t uuid[16];
+ uint8_t label[16];
} __attribute__((__packed__));
struct reiser4_super_block {
- __u8 magic[16];
- __u16 dummy[2];
- __u8 uuid[16];
- __u8 label[16];
- __u64 dummy2;
+ uint8_t magic[16];
+ uint16_t dummy[2];
+ uint8_t uuid[16];
+ uint8_t label[16];
+ uint64_t dummy2;
} __attribute__((__packed__));
#define REISERFS1_SUPERBLOCK_OFFSET 0x2000
#define REISERFS_SUPERBLOCK_OFFSET 0x10000
-int volume_id_probe_reiserfs(struct volume_id *id, __u64 off)
+int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off)
{
struct reiserfs_super_block *rs;
struct reiser4_super_block *rs4;
- __u8 *buf;
+ uint8_t *buf;
dbg("probing at offset 0x%llx", (unsigned long long) off);
@@ -79,13 +80,17 @@
return -1;
rs = (struct reiserfs_super_block *) buf;;
+ if (memcmp(rs->magic, "ReIsErFs", 8) == 0) {
+ strcpy(id->type_version, "3.5");
+ goto found;
+ }
if (memcmp(rs->magic, "ReIsEr2Fs", 9) == 0) {
strcpy(id->type_version, "3.6");
- goto found_v3;
+ goto found_label;
}
if (memcmp(rs->magic, "ReIsEr3Fs", 9) == 0) {
strcpy(id->type_version, "JR");
- goto found_v3;
+ goto found_label;
}
rs4 = (struct reiser4_super_block *) buf;
@@ -103,12 +108,12 @@
if (memcmp(rs->magic, "ReIsErFs", 8) == 0) {
strcpy(id->type_version, "3.5");
- goto found_v3;
+ goto found;
}
return -1;
-found_v3:
+found_label:
volume_id_set_label_raw(id, rs->label, 16);
volume_id_set_label_string(id, rs->label, 16);
volume_id_set_uuid(id, rs->uuid, UUID_DCE);
Index: reiserfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/reiserfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- reiserfs.h 7 Feb 2005 21:24:16 -0000 1.1
+++ reiserfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_REISERFS_
#define _VOLUME_ID_REISERFS_
-extern int volume_id_probe_reiserfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off);
#endif
Index: romfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/romfs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- romfs.c 26 Jul 2005 04:40:43 -0000 1.4
+++ romfs.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,13 +39,13 @@
#include "romfs.h"
struct romfs_super {
- __u8 magic[8];
- __u32 size;
- __u32 checksum;
- __u8 name[0];
+ uint8_t magic[8];
+ uint32_t size;
+ uint32_t checksum;
+ uint8_t name[0];
} __attribute__((__packed__));
-int volume_id_probe_romfs(struct volume_id *id, __u64 off)
+int volume_id_probe_romfs(struct volume_id *id, uint64_t off)
{
struct romfs_super *rfs;
@@ -56,7 +56,7 @@
return -1;
if (memcmp(rfs->magic, "-rom1fs-", 4) == 0) {
- size_t len = strlen((char *) rfs->name);
+ size_t len = strlen((char *)rfs->name);
if (len) {
volume_id_set_label_raw(id, rfs->name, len);
Index: romfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/romfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- romfs.h 16 Feb 2005 22:40:47 -0000 1.1
+++ romfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_ROMFS_
#define _VOLUME_ID_ROMFS_
-extern int volume_id_probe_romfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_romfs(struct volume_id *id, uint64_t off);
#endif
Index: silicon_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/silicon_raid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- silicon_raid.c 27 Jun 2005 14:52:03 -0000 1.2
+++ silicon_raid.c 12 Aug 2005 22:28:30 -0000 1.3
@@ -39,30 +39,30 @@
#include "silicon_raid.h"
struct silicon_meta {
- __u8 unknown0[0x2E];
- __u8 ascii_version[0x36 - 0x2E];
- __u8 diskname[0x56 - 0x36];
- __u8 unknown1[0x60 - 0x56];
- __u32 magic;
- __u32 unknown1a[0x6C - 0x64];
- __u32 array_sectors_low;
- __u32 array_sectors_high;
- __u8 unknown2[0x78 - 0x74];
- __u32 thisdisk_sectors;
- __u8 unknown3[0x100 - 0x7C];
- __u8 unknown4[0x104 - 0x100];
- __u16 product_id;
- __u16 vendor_id;
- __u16 minor_ver;
- __u16 major_ver;
+ uint8_t unknown0[0x2E];
+ uint8_t ascii_version[0x36 - 0x2E];
+ uint8_t diskname[0x56 - 0x36];
+ uint8_t unknown1[0x60 - 0x56];
+ uint32_t magic;
+ uint32_t unknown1a[0x6C - 0x64];
+ uint32_t array_sectors_low;
+ uint32_t array_sectors_high;
+ uint8_t unknown2[0x78 - 0x74];
+ uint32_t thisdisk_sectors;
+ uint8_t unknown3[0x100 - 0x7C];
+ uint8_t unknown4[0x104 - 0x100];
+ uint16_t product_id;
+ uint16_t vendor_id;
+ uint16_t minor_ver;
+ uint16_t major_ver;
} __attribute__((packed));
#define SILICON_MAGIC 0x2F000000
-int volume_id_probe_silicon_medley_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
- __u64 meta_off;
+ const uint8_t *buf;
+ uint64_t meta_off;
struct silicon_meta *sil;
dbg("probing at offset 0x%llx, size 0x%llx",
Index: silicon_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/silicon_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- silicon_raid.h 11 Mar 2005 18:00:35 -0000 1.1
+++ silicon_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_SILICON_RAID_
#define _VOLUME_ID_SILICON_RAID_
-extern int volume_id_probe_silicon_medley_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: sysv.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/sysv.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sysv.c 27 Jun 2005 14:52:03 -0000 1.3
+++ sysv.c 12 Aug 2005 22:28:30 -0000 1.4
@@ -32,6 +32,7 @@
#include <string.h>
#include <errno.h>
#include <ctype.h>
+#include <asm/types.h>
#include "volume_id.h"
#include "logging.h"
@@ -43,56 +44,56 @@
struct sysv_super
{
- __u16 s_isize;
- __u16 s_pad0;
- __u32 s_fsize;
- __u16 s_nfree;
- __u16 s_pad1;
- __u32 s_free[SYSV_NICFREE];
- __u16 s_ninode;
- __u16 s_pad2;
- __u16 s_inode[SYSV_NICINOD];
- __u8 s_flock;
- __u8 s_ilock;
- __u8 s_fmod;
- __u8 s_ronly;
- __u32 s_time;
- __u16 s_dinfo[4];
- __u32 s_tfree;
- __u16 s_tinode;
- __u16 s_pad3;
- __u8 s_fname[6];
- __u8 s_fpack[6];
- __u32 s_fill[12];
- __u32 s_state;
- __u32 s_magic;
- __u32 s_type;
+ uint16_t s_isize;
+ uint16_t s_pad0;
+ uint32_t s_fsize;
+ uint16_t s_nfree;
+ uint16_t s_pad1;
+ uint32_t s_free[SYSV_NICFREE];
+ uint16_t s_ninode;
+ uint16_t s_pad2;
+ uint16_t s_inode[SYSV_NICINOD];
+ uint8_t s_flock;
+ uint8_t s_ilock;
+ uint8_t s_fmod;
+ uint8_t s_ronly;
+ uint32_t s_time;
+ uint16_t s_dinfo[4];
+ uint32_t s_tfree;
+ uint16_t s_tinode;
+ uint16_t s_pad3;
+ uint8_t s_fname[6];
+ uint8_t s_fpack[6];
+ uint32_t s_fill[12];
+ uint32_t s_state;
+ uint32_t s_magic;
+ uint32_t s_type;
} __attribute__((__packed__));
#define XENIX_NICINOD 100
#define XENIX_NICFREE 100
struct xenix_super {
- __u16 s_isize;
- __u32 s_fsize;
- __u16 s_nfree;
- __u32 s_free[XENIX_NICFREE];
- __u16 s_ninode;
- __u16 s_inode[XENIX_NICINOD];
- __u8 s_flock;
- __u8 s_ilock;
- __u8 s_fmod;
- __u8 s_ronly;
- __u32 s_time;
- __u32 s_tfree;
- __u16 s_tinode;
- __u16 s_dinfo[4];
- __u8 s_fname[6];
- __u8 s_fpack[6];
- __u8 s_clean;
- __u8 s_fill[371];
- __u32 s_magic;
- __u32 s_type;
+ uint16_t s_isize;
+ uint32_t s_fsize;
+ uint16_t s_nfree;
+ uint32_t s_free[XENIX_NICFREE];
+ uint16_t s_ninode;
+ uint16_t s_inode[XENIX_NICINOD];
+ uint8_t s_flock;
+ uint8_t s_ilock;
+ uint8_t s_fmod;
+ uint8_t s_ronly;
+ uint32_t s_time;
+ uint32_t s_tfree;
+ uint16_t s_tinode;
+ uint16_t s_dinfo[4];
+ uint8_t s_fname[6];
+ uint8_t s_fpack[6];
+ uint8_t s_clean;
+ uint8_t s_fill[371];
+ uint32_t s_magic;
+ uint32_t s_type;
} __attribute__((__packed__));
#define SYSV_SUPERBLOCK_BLOCK 0x01
@@ -101,7 +102,7 @@
#define XENIX_MAGIC 0x2b5544
#define SYSV_MAX_BLOCKSIZE 0x800
-int volume_id_probe_sysv(struct volume_id *id, __u64 off)
+int volume_id_probe_sysv(struct volume_id *id, uint64_t off)
{
struct sysv_super *vs;
struct xenix_super *xs;
Index: sysv.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/sysv.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sysv.h 16 Feb 2005 22:40:47 -0000 1.1
+++ sysv.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_SYSV_
#define _VOLUME_ID_SYSV_
-extern int volume_id_probe_sysv(struct volume_id *id, __u64 off);
+extern int volume_id_probe_sysv(struct volume_id *id, uint64_t off);
#endif
Index: udf.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/udf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- udf.c 27 Jun 2005 14:52:03 -0000 1.4
+++ udf.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -40,40 +40,40 @@
struct volume_descriptor {
struct descriptor_tag {
- __u16 id;
- __u16 version;
- __u8 checksum;
- __u8 reserved;
- __u16 serial;
- __u16 crc;
- __u16 crc_len;
- __u32 location;
+ uint16_t id;
+ uint16_t version;
+ uint8_t checksum;
+ uint8_t reserved;
+ uint16_t serial;
+ uint16_t crc;
+ uint16_t crc_len;
+ uint32_t location;
} __attribute__((__packed__)) tag;
union {
struct anchor_descriptor {
- __u32 length;
- __u32 location;
+ uint32_t length;
+ uint32_t location;
} __attribute__((__packed__)) anchor;
struct primary_descriptor {
- __u32 seq_num;
- __u32 desc_num;
+ uint32_t seq_num;
+ uint32_t desc_num;
struct dstring {
- __u8 clen;
- __u8 c[31];
+ uint8_t clen;
+ uint8_t c[31];
} __attribute__((__packed__)) ident;
} __attribute__((__packed__)) primary;
} __attribute__((__packed__)) type;
} __attribute__((__packed__));
struct volume_structure_descriptor {
- __u8 type;
- __u8 id[5];
- __u8 version;
+ uint8_t type;
+ uint8_t id[5];
+ uint8_t version;
} __attribute__((__packed__));
#define UDF_VSD_OFFSET 0x8000
-int volume_id_probe_udf(struct volume_id *id, __u64 off)
+int volume_id_probe_udf(struct volume_id *id, uint64_t off)
{
struct volume_descriptor *vd;
struct volume_structure_descriptor *vsd;
Index: udf.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/udf.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- udf.h 7 Feb 2005 21:24:16 -0000 1.1
+++ udf.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_UDF_
#define _VOLUME_ID_UDF_
-extern int volume_id_probe_udf(struct volume_id *id, __u64 off);
+extern int volume_id_probe_udf(struct volume_id *id, uint64_t off);
#endif
Index: ufs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/ufs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ufs.c 27 Jun 2005 14:52:03 -0000 1.4
+++ ufs.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,140 +39,140 @@
#include "ufs.h"
struct ufs_super_block {
- __u32 fs_link;
- __u32 fs_rlink;
- __u32 fs_sblkno;
- __u32 fs_cblkno;
- __u32 fs_iblkno;
- __u32 fs_dblkno;
- __u32 fs_cgoffset;
- __u32 fs_cgmask;
- __u32 fs_time;
- __u32 fs_size;
- __u32 fs_dsize;
- __u32 fs_ncg;
- __u32 fs_bsize;
- __u32 fs_fsize;
- __u32 fs_frag;
- __u32 fs_minfree;
- __u32 fs_rotdelay;
- __u32 fs_rps;
- __u32 fs_bmask;
- __u32 fs_fmask;
- __u32 fs_bshift;
- __u32 fs_fshift;
- __u32 fs_maxcontig;
- __u32 fs_maxbpg;
- __u32 fs_fragshift;
- __u32 fs_fsbtodb;
- __u32 fs_sbsize;
- __u32 fs_csmask;
- __u32 fs_csshift;
- __u32 fs_nindir;
- __u32 fs_inopb;
- __u32 fs_nspf;
- __u32 fs_optim;
- __u32 fs_npsect_state;
- __u32 fs_interleave;
- __u32 fs_trackskew;
- __u32 fs_id[2];
- __u32 fs_csaddr;
- __u32 fs_cssize;
- __u32 fs_cgsize;
- __u32 fs_ntrak;
- __u32 fs_nsect;
- __u32 fs_spc;
- __u32 fs_ncyl;
- __u32 fs_cpg;
- __u32 fs_ipg;
- __u32 fs_fpg;
+ uint32_t fs_link;
+ uint32_t fs_rlink;
+ uint32_t fs_sblkno;
+ uint32_t fs_cblkno;
+ uint32_t fs_iblkno;
+ uint32_t fs_dblkno;
+ uint32_t fs_cgoffset;
+ uint32_t fs_cgmask;
+ uint32_t fs_time;
+ uint32_t fs_size;
+ uint32_t fs_dsize;
+ uint32_t fs_ncg;
+ uint32_t fs_bsize;
+ uint32_t fs_fsize;
+ uint32_t fs_frag;
+ uint32_t fs_minfree;
+ uint32_t fs_rotdelay;
+ uint32_t fs_rps;
+ uint32_t fs_bmask;
+ uint32_t fs_fmask;
+ uint32_t fs_bshift;
+ uint32_t fs_fshift;
+ uint32_t fs_maxcontig;
+ uint32_t fs_maxbpg;
+ uint32_t fs_fragshift;
+ uint32_t fs_fsbtodb;
+ uint32_t fs_sbsize;
+ uint32_t fs_csmask;
+ uint32_t fs_csshift;
+ uint32_t fs_nindir;
+ uint32_t fs_inopb;
+ uint32_t fs_nspf;
+ uint32_t fs_optim;
+ uint32_t fs_npsect_state;
+ uint32_t fs_interleave;
+ uint32_t fs_trackskew;
+ uint32_t fs_id[2];
+ uint32_t fs_csaddr;
+ uint32_t fs_cssize;
+ uint32_t fs_cgsize;
+ uint32_t fs_ntrak;
+ uint32_t fs_nsect;
+ uint32_t fs_spc;
+ uint32_t fs_ncyl;
+ uint32_t fs_cpg;
+ uint32_t fs_ipg;
+ uint32_t fs_fpg;
struct ufs_csum {
- __u32 cs_ndir;
- __u32 cs_nbfree;
- __u32 cs_nifree;
- __u32 cs_nffree;
+ uint32_t cs_ndir;
+ uint32_t cs_nbfree;
+ uint32_t cs_nifree;
+ uint32_t cs_nffree;
} __attribute__((__packed__)) fs_cstotal;
- __s8 fs_fmod;
- __s8 fs_clean;
- __s8 fs_ronly;
- __s8 fs_flags;
+ int8_t fs_fmod;
+ int8_t fs_clean;
+ int8_t fs_ronly;
+ int8_t fs_flags;
union {
struct {
- __s8 fs_fsmnt[512];
- __u32 fs_cgrotor;
- __u32 fs_csp[31];
- __u32 fs_maxcluster;
- __u32 fs_cpc;
- __u16 fs_opostbl[16][8];
+ int8_t fs_fsmnt[512];
+ uint32_t fs_cgrotor;
+ uint32_t fs_csp[31];
+ uint32_t fs_maxcluster;
+ uint32_t fs_cpc;
+ uint16_t fs_opostbl[16][8];
} __attribute__((__packed__)) fs_u1;
struct {
- __s8 fs_fsmnt[468];
- __u8 fs_volname[32];
- __u64 fs_swuid;
- __s32 fs_pad;
- __u32 fs_cgrotor;
- __u32 fs_ocsp[28];
- __u32 fs_contigdirs;
- __u32 fs_csp;
- __u32 fs_maxcluster;
- __u32 fs_active;
- __s32 fs_old_cpc;
- __s32 fs_maxbsize;
- __s64 fs_sparecon64[17];
- __s64 fs_sblockloc;
+ int8_t fs_fsmnt[468];
+ uint8_t fs_volname[32];
+ uint64_t fs_swuid;
+ int32_t fs_pad;
+ uint32_t fs_cgrotor;
+ uint32_t fs_ocsp[28];
+ uint32_t fs_contigdirs;
+ uint32_t fs_csp;
+ uint32_t fs_maxcluster;
+ uint32_t fs_active;
+ int32_t fs_old_cpc;
+ int32_t fs_maxbsize;
+ int64_t fs_sparecon64[17];
+ int64_t fs_sblockloc;
struct ufs2_csum_total {
- __u64 cs_ndir;
- __u64 cs_nbfree;
- __u64 cs_nifree;
- __u64 cs_nffree;
- __u64 cs_numclusters;
- __u64 cs_spare[3];
+ uint64_t cs_ndir;
+ uint64_t cs_nbfree;
+ uint64_t cs_nifree;
+ uint64_t cs_nffree;
+ uint64_t cs_numclusters;
+ uint64_t cs_spare[3];
} __attribute__((__packed__)) fs_cstotal;
struct ufs_timeval {
- __s32 tv_sec;
- __s32 tv_usec;
+ int32_t tv_sec;
+ int32_t tv_usec;
} __attribute__((__packed__)) fs_time;
- __s64 fs_size;
- __s64 fs_dsize;
- __u64 fs_csaddr;
- __s64 fs_pendingblocks;
- __s32 fs_pendinginodes;
+ int64_t fs_size;
+ int64_t fs_dsize;
+ uint64_t fs_csaddr;
+ int64_t fs_pendingblocks;
+ int32_t fs_pendinginodes;
} __attribute__((__packed__)) fs_u2;
} fs_u11;
union {
struct {
- __s32 fs_sparecon[53];
- __s32 fs_reclaim;
- __s32 fs_sparecon2[1];
- __s32 fs_state;
- __u32 fs_qbmask[2];
- __u32 fs_qfmask[2];
+ int32_t fs_sparecon[53];
+ int32_t fs_reclaim;
+ int32_t fs_sparecon2[1];
+ int32_t fs_state;
+ uint32_t fs_qbmask[2];
+ uint32_t fs_qfmask[2];
} __attribute__((__packed__)) fs_sun;
struct {
- __s32 fs_sparecon[53];
- __s32 fs_reclaim;
- __s32 fs_sparecon2[1];
- __u32 fs_npsect;
- __u32 fs_qbmask[2];
- __u32 fs_qfmask[2];
+ int32_t fs_sparecon[53];
+ int32_t fs_reclaim;
+ int32_t fs_sparecon2[1];
+ uint32_t fs_npsect;
+ uint32_t fs_qbmask[2];
+ uint32_t fs_qfmask[2];
} __attribute__((__packed__)) fs_sunx86;
struct {
- __s32 fs_sparecon[50];
- __s32 fs_contigsumsize;
- __s32 fs_maxsymlinklen;
- __s32 fs_inodefmt;
- __u32 fs_maxfilesize[2];
- __u32 fs_qbmask[2];
- __u32 fs_qfmask[2];
- __s32 fs_state;
+ int32_t fs_sparecon[50];
+ int32_t fs_contigsumsize;
+ int32_t fs_maxsymlinklen;
+ int32_t fs_inodefmt;
+ uint32_t fs_maxfilesize[2];
+ uint32_t fs_qbmask[2];
+ uint32_t fs_qfmask[2];
+ int32_t fs_state;
} __attribute__((__packed__)) fs_44;
} fs_u2;
- __s32 fs_postblformat;
- __s32 fs_nrpos;
- __s32 fs_postbloff;
- __s32 fs_rotbloff;
- __u32 fs_magic;
- __u8 fs_space[1];
+ int32_t fs_postblformat;
+ int32_t fs_nrpos;
+ int32_t fs_postbloff;
+ int32_t fs_rotbloff;
+ uint32_t fs_magic;
+ uint8_t fs_space[1];
} __attribute__((__packed__));
#define UFS_MAGIC 0x00011954
@@ -180,12 +180,12 @@
#define UFS_MAGIC_FEA 0x00195612
#define UFS_MAGIC_LFN 0x00095014
-int volume_id_probe_ufs(struct volume_id *id, __u64 off)
+int volume_id_probe_ufs(struct volume_id *id, uint64_t off)
{
- __u32 magic;
- int i;
+ uint32_t magic;
+ int i;
struct ufs_super_block *ufs;
- int offsets[] = {0, 8, 64, 256, -1};
+ int offsets[] = {0, 8, 64, 256, -1};
dbg("probing at offset 0x%llx", (unsigned long long) off);
Index: ufs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/ufs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ufs.h 7 Feb 2005 21:24:16 -0000 1.1
+++ ufs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_UFS_
#define _VOLUME_ID_UFS_
-extern int volume_id_probe_ufs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_ufs(struct volume_id *id, uint64_t off);
#endif
Index: util.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/util.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- util.c 27 Jun 2005 14:52:03 -0000 1.5
+++ util.c 12 Aug 2005 22:28:30 -0000 1.6
@@ -39,10 +39,10 @@
#include "logging.h"
#include "util.h"
-void volume_id_set_unicode16(char *str, unsigned int len, const __u8 *buf, enum endian endianess, unsigned int count)
+void volume_id_set_unicode16(char *str, size_t len, const uint8_t *buf, enum endian endianess, size_t count)
{
unsigned int i, j;
- __u16 c;
+ uint16_t c;
j = 0;
for (i = 0; i + 2 <= count; i += 2) {
@@ -56,18 +56,18 @@
} else if (c < 0x80) {
if (j+1 >= len)
break;
- str[j++] = (__u8) c;
+ str[j++] = (uint8_t) c;
} else if (c < 0x800) {
if (j+2 >= len)
break;
- str[j++] = (__u8) (0xc0 | (c >> 6));
- str[j++] = (__u8) (0x80 | (c & 0x3f));
+ str[j++] = (uint8_t) (0xc0 | (c >> 6));
+ str[j++] = (uint8_t) (0x80 | (c & 0x3f));
} else {
if (j+3 >= len)
break;
- str[j++] = (__u8) (0xe0 | (c >> 12));
- str[j++] = (__u8) (0x80 | ((c >> 6) & 0x3f));
- str[j++] = (__u8) (0x80 | (c & 0x3f));
+ str[j++] = (uint8_t) (0xe0 | (c >> 12));
+ str[j++] = (uint8_t) (0x80 | ((c >> 6) & 0x3f));
+ str[j++] = (uint8_t) (0x80 | (c & 0x3f));
}
}
str[j] = '\0';
@@ -108,13 +108,13 @@
id->usage = usage_to_string(usage_id);
}
-void volume_id_set_label_raw(struct volume_id *id, const __u8 *buf, unsigned int count)
+void volume_id_set_label_raw(struct volume_id *id, const uint8_t *buf, size_t count)
{
memcpy(id->label_raw, buf, count);
id->label_raw_len = count;
}
-void volume_id_set_label_string(struct volume_id *id, const __u8 *buf, unsigned int count)
+void volume_id_set_label_string(struct volume_id *id, const uint8_t *buf, size_t count)
{
unsigned int i;
@@ -129,12 +129,12 @@
id->label[i+1] = '\0';
}
-void volume_id_set_label_unicode16(struct volume_id *id, const __u8 *buf, enum endian endianess, unsigned int count)
+void volume_id_set_label_unicode16(struct volume_id *id, const uint8_t *buf, enum endian endianess, size_t count)
{
volume_id_set_unicode16(id->label, sizeof(id->label), buf, endianess, count);
}
-void volume_id_set_uuid(struct volume_id *id, const __u8 *buf, enum uuid_format format)
+void volume_id_set_uuid(struct volume_id *id, const uint8_t *buf, enum uuid_format format)
{
unsigned int i;
unsigned int count = 0;
@@ -195,11 +195,11 @@
}
}
-__u8 *volume_id_get_buffer(struct volume_id *id, __u64 off, unsigned int len)
+uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len)
{
- unsigned int buf_len;
+ size_t buf_len;
- dbg("get buffer off 0x%llx(%llu), len 0x%x", (unsigned long long) off, (unsigned long long) off, len);
+ dbg("get buffer off 0x%llx(%llu), len 0x%zx", (unsigned long long) off, (unsigned long long) off, len);
/* check if requested area fits in superblock buffer */
if (off + len <= SB_BUFFER_SIZE) {
if (id->sbbuf == NULL) {
@@ -213,7 +213,7 @@
dbg("read sbbuf len:0x%llx", (unsigned long long) (off + len));
lseek(id->fd, 0, SEEK_SET);
buf_len = read(id->fd, id->sbbuf, off + len);
- dbg("got 0x%x (%i) bytes", buf_len, buf_len);
+ dbg("got 0x%zx (%zi) bytes", buf_len, buf_len);
id->sbbuf_len = buf_len;
if (buf_len < off + len)
return NULL;
@@ -235,15 +235,15 @@
/* check if we need to read */
if ((off < id->seekbuf_off) || ((off + len) > (id->seekbuf_off + id->seekbuf_len))) {
- dbg("read seekbuf off:0x%llx len:0x%x", (unsigned long long) off, len);
+ dbg("read seekbuf off:0x%llx len:0x%zx", (unsigned long long) off, len);
if (lseek(id->fd, off, SEEK_SET) == -1)
return NULL;
buf_len = read(id->fd, id->seekbuf, len);
- dbg("got 0x%x (%i) bytes", buf_len, buf_len);
+ dbg("got 0x%zx (%zi) bytes", buf_len, buf_len);
id->seekbuf_off = off;
id->seekbuf_len = buf_len;
if (buf_len < len) {
- dbg("requested 0x%x bytes, got only 0x%x bytes", len, buf_len);
+ dbg("requested 0x%zx bytes, got only 0x%zx bytes", len, buf_len);
return NULL;
}
}
Index: util.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/util.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- util.h 15 Jul 2005 19:12:43 -0000 1.6
+++ util.h 12 Aug 2005 22:28:30 -0000 1.7
@@ -29,12 +29,7 @@
# include <config.h>
#endif
-#ifdef HAVE_ASM_TYPES_H
-# include <asm/types.h>
-#endif
-
-#include <stdint.h>
-#include <asm/types.h>
+#include <endian.h>
/* size of superblock buffer, reiserfs block is at 64k */
#define SB_BUFFER_SIZE 0x11000
@@ -42,23 +37,24 @@
#define SEEK_BUFFER_SIZE 0x10000
/* probe volume for all known filesystems in specific order */
-#define bswap16(x) (__u16)((((__u16)(x) & 0x00ffu) << 8) | \
- (((__u16)(x) & 0xff00u) >> 8))
+#define bswap16(x) (uint16_t) ((((uint16_t)(x) & 0x00ffu) << 8) | \
+ (((uint16_t)(x) & 0xff00u) >> 8))
-#define bswap32(x) (__u32)((((__u32)(x) & 0xff000000u) >> 24) | \
- (((__u32)(x) & 0x00ff0000u) >> 8) | \
- (((__u32)(x) & 0x0000ff00u) << 8) | \
- (((__u32)(x) & 0x000000ffu) << 24))
+#define bswap32(x) (uint32_t) ((((uint32_t)(x) & 0xff000000u) >> 24) | \
+ (((uint32_t)(x) & 0x00ff0000u) >> 8) | \
+ (((uint32_t)(x) & 0x0000ff00u) << 8) | \
+ (((uint32_t)(x) & 0x000000ffu) << 24))
-#define bswap64(x) (__u64)((((__u64)(x) & 0xff00000000000000ull) >> 56) | \
- (((__u64)(x) & 0x00ff000000000000ull) >> 40) | \
- (((__u64)(x) & 0x0000ff0000000000ull) >> 24) | \
- (((__u64)(x) & 0x000000ff00000000ull) >> 8) | \
- (((__u64)(x) & 0x00000000ff000000ull) << 8) | \
- (((__u64)(x) & 0x0000000000ff0000ull) << 24) | \
- (((__u64)(x) & 0x000000000000ff00ull) << 40) | \
- (((__u64)(x) & 0x00000000000000ffull) << 56))
+#define bswap64(x) (uint64_t) ((((uint64_t)(x) & 0xff00000000000000ull) >> 56) | \
+ (((uint64_t)(x) & 0x00ff000000000000ull) >> 40) | \
+ (((uint64_t)(x) & 0x0000ff0000000000ull) >> 24) | \
+ (((uint64_t)(x) & 0x000000ff00000000ull) >> 8) | \
+ (((uint64_t)(x) & 0x00000000ff000000ull) << 8) | \
+ (((uint64_t)(x) & 0x0000000000ff0000ull) << 24) | \
+ (((uint64_t)(x) & 0x000000000000ff00ull) << 40) | \
+ (((uint64_t)(x) & 0x00000000000000ffull) << 56))
+#ifdef __BYTE_ORDER
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define le16_to_cpu(x) (x)
#define le32_to_cpu(x) (x)
@@ -76,6 +72,7 @@
#define cpu_to_le32(x) bswap32(x)
#define cpu_to_be32(x) (x)
#endif
+#endif /* __BYTE_ORDER */
enum uuid_format {
UUID_DCE_STRING,
@@ -90,14 +87,14 @@
BE = 1
};
-extern void volume_id_set_unicode16(char *str, unsigned int len, const __u8 *buf, enum endian endianess, unsigned int count);
+extern void volume_id_set_unicode16(char *str, size_t len, const uint8_t *buf, enum endian endianess, size_t count);
extern void volume_id_set_usage(struct volume_id *id, enum volume_id_usage usage_id);
extern void volume_id_set_usage_part(struct volume_id_partition *part, enum volume_id_usage usage_id);
-extern void volume_id_set_label_raw(struct volume_id *id, const __u8 *buf, unsigned int count);
-extern void volume_id_set_label_string(struct volume_id *id, const __u8 *buf, unsigned int count);
-extern void volume_id_set_label_unicode16(struct volume_id *id, const __u8 *buf, enum endian endianess, unsigned int count);
-extern void volume_id_set_uuid(struct volume_id *id, const __u8 *buf, enum uuid_format format);
-extern __u8 *volume_id_get_buffer(struct volume_id *id, __u64 off, unsigned int len);
+extern void volume_id_set_label_raw(struct volume_id *id, const uint8_t *buf, size_t count);
+extern void volume_id_set_label_string(struct volume_id *id, const uint8_t *buf, size_t count);
+extern void volume_id_set_label_unicode16(struct volume_id *id, const uint8_t *buf, enum endian endianess, size_t count);
+extern void volume_id_set_uuid(struct volume_id *id, const uint8_t *buf, enum uuid_format format);
+extern uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len);
extern void volume_id_free_buffer(struct volume_id *id);
#endif /* _VOLUME_ID_UTIL_ */
Index: via_raid.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/via_raid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- via_raid.c 27 Jun 2005 14:52:03 -0000 1.2
+++ via_raid.c 12 Aug 2005 22:28:30 -0000 1.3
@@ -39,25 +39,25 @@
#include "via_raid.h"
struct via_meta {
- __u16 signature;
- __u8 version_number;
+ uint16_t signature;
+ uint8_t version_number;
struct via_array {
- __u16 disk_bits;
- __u8 disk_array_ex;
- __u32 capacity_low;
- __u32 capacity_high;
- __u32 serial_checksum;
+ uint16_t disk_bits;
+ uint8_t disk_array_ex;
+ uint32_t capacity_low;
+ uint32_t capacity_high;
+ uint32_t serial_checksum;
} __attribute((packed)) array;
- __u32 serial_checksum[8];
- __u8 checksum;
+ uint32_t serial_checksum[8];
+ uint8_t checksum;
} __attribute__((packed));
#define VIA_SIGNATURE 0xAA55
-int volume_id_probe_via_raid(struct volume_id *id, __u64 off, __u64 size)
+int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
- const __u8 *buf;
- __u64 meta_off;
+ const uint8_t *buf;
+ uint64_t meta_off;
struct via_meta *via;
dbg("probing at offset 0x%llx, size 0x%llx",
Index: via_raid.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/via_raid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- via_raid.h 11 Mar 2005 18:00:35 -0000 1.1
+++ via_raid.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID_VIA_RAID_
#define _VOLUME_ID_VIA_RAID_
-extern int volume_id_probe_via_raid(struct volume_id *id, __u64 off, __u64 size);
+extern int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size);
#endif
Index: volume_id.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/volume_id.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- volume_id.c 26 Jul 2005 04:40:43 -0000 1.9
+++ volume_id.c 12 Aug 2005 22:28:30 -0000 1.10
@@ -68,8 +68,9 @@
#include "minix.h"
#include "mac.h"
#include "msdos.h"
+#include "ocfs2.h"
-int volume_id_probe_all(struct volume_id *id, unsigned long long off, unsigned long long size)
+int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size)
{
if (id == NULL)
return -EINVAL;
@@ -168,6 +169,9 @@
if (volume_id_probe_minix(id, off) == 0)
goto exit;
+ if (volume_id_probe_ocfs2(id, off) == 0)
+ goto exit;
+
return -1;
exit:
@@ -219,20 +223,20 @@
struct volume_id *volume_id_open_dev_t(dev_t devt)
{
struct volume_id *id;
- __u8 tmp_node[VOLUME_ID_PATH_MAX];
+ char tmp_node[VOLUME_ID_PATH_MAX];
- snprintf((char *) tmp_node, VOLUME_ID_PATH_MAX,
+ snprintf(tmp_node, VOLUME_ID_PATH_MAX,
"/dev/.volume_id-%u-%u-%u", getpid(), major(devt), minor(devt));
- tmp_node[VOLUME_ID_PATH_MAX] = '\0';
+ tmp_node[VOLUME_ID_PATH_MAX-1] = '\0';
/* create tempory node to open the block device */
- unlink((char *) tmp_node);
- if (mknod((char *) tmp_node, (S_IFBLK | 0600), devt) != 0)
+ unlink(tmp_node);
+ if (mknod(tmp_node, (S_IFBLK | 0600), devt) != 0)
return NULL;
- id = volume_id_open_node((char *) tmp_node);
+ id = volume_id_open_node(tmp_node);
- unlink((char *) tmp_node);
+ unlink(tmp_node);
return id;
}
Index: volume_id.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/volume_id.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- volume_id.h 11 Mar 2005 18:00:35 -0000 1.8
+++ volume_id.h 12 Aug 2005 22:28:30 -0000 1.9
@@ -21,7 +21,9 @@
#ifndef _VOLUME_ID_H_
#define _VOLUME_ID_H_
-#define VOLUME_ID_VERSION 42
+#include <stdint.h>
+
+#define VOLUME_ID_VERSION 47
#define VOLUME_ID_LABEL_SIZE 64
#define VOLUME_ID_UUID_SIZE 36
@@ -44,17 +46,17 @@
enum volume_id_usage usage_id;
char *usage;
char *type;
- unsigned long long off;
- unsigned long long len;
- unsigned int partition_type_raw;
+ uint64_t off;
+ uint64_t len;
+ uint8_t partition_type_raw;
};
struct volume_id {
- unsigned char label_raw[VOLUME_ID_LABEL_SIZE];
- unsigned int label_raw_len;
+ uint8_t label_raw[VOLUME_ID_LABEL_SIZE];
+ size_t label_raw_len;
char label[VOLUME_ID_LABEL_SIZE+1];
- unsigned char uuid_raw[VOLUME_ID_UUID_SIZE];
- unsigned int uuid_raw_len;
+ uint8_t uuid_raw[VOLUME_ID_UUID_SIZE];
+ size_t uuid_raw_len;
char uuid[VOLUME_ID_UUID_SIZE+1];
enum volume_id_usage usage_id;
char *usage;
@@ -62,21 +64,21 @@
char type_version[VOLUME_ID_FORMAT_SIZE];
struct volume_id_partition *partitions;
- unsigned int partition_count;
+ size_t partition_count;
int fd;
- unsigned char *sbbuf;
- unsigned int sbbuf_len;
- unsigned char *seekbuf;
- unsigned long long seekbuf_off;
- unsigned int seekbuf_len;
- int fd_close;
+ uint8_t *sbbuf;
+ size_t sbbuf_len;
+ uint8_t *seekbuf;
+ uint64_t seekbuf_off;
+ size_t seekbuf_len;
+ int fd_close:1;
};
extern struct volume_id *volume_id_open_fd(int fd);
extern struct volume_id *volume_id_open_node(const char *path);
extern struct volume_id *volume_id_open_dev_t(dev_t devt);
-extern int volume_id_probe_all(struct volume_id *id, unsigned long long off, unsigned long long size);
+extern int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size);
extern void volume_id_close(struct volume_id *id);
#endif
Index: xfs.c
===================================================================
RCS file: /cvs/hal/hal/volume_id/xfs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- xfs.c 27 Jun 2005 14:52:03 -0000 1.4
+++ xfs.c 12 Aug 2005 22:28:30 -0000 1.5
@@ -39,21 +39,21 @@
#include "xfs.h"
struct xfs_super_block {
- __u8 magic[4];
- __u32 blocksize;
- __u64 dblocks;
- __u64 rblocks;
- __u32 dummy1[2];
- __u8 uuid[16];
- __u32 dummy2[15];
- __u8 fname[12];
- __u32 dummy3[2];
- __u64 icount;
- __u64 ifree;
- __u64 fdblocks;
+ uint8_t magic[4];
+ uint32_t blocksize;
+ uint64_t dblocks;
+ uint64_t rblocks;
+ uint32_t dummy1[2];
+ uint8_t uuid[16];
+ uint32_t dummy2[15];
+ uint8_t fname[12];
+ uint32_t dummy3[2];
+ uint64_t icount;
+ uint64_t ifree;
+ uint64_t fdblocks;
} __attribute__((__packed__));
-int volume_id_probe_xfs(struct volume_id *id, __u64 off)
+int volume_id_probe_xfs(struct volume_id *id, uint64_t off)
{
struct xfs_super_block *xs;
Index: xfs.h
===================================================================
RCS file: /cvs/hal/hal/volume_id/xfs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xfs.h 7 Feb 2005 21:24:16 -0000 1.1
+++ xfs.h 12 Aug 2005 22:28:30 -0000 1.2
@@ -21,6 +21,6 @@
#ifndef _VOLUME_ID__
#define _VOLUME_ID__
-extern int volume_id_probe_xfs(struct volume_id *id, __u64 off);
+extern int volume_id_probe_xfs(struct volume_id *id, uint64_t off);
#endif
More information about the hal-commit
mailing list