INSTALL_LIB = ${INSTALL} -m 755
SHLIB_CUR = 0
-SHLIB_REV = 67
+SHLIB_REV = 68
SHLIB_AGE = 0
SHLIB = libvolume_id.so.$(SHLIB_CUR).$(SHLIB_REV).$(SHLIB_AGE)
uint8_t name[16];
} PACKED;
-int volume_id_probe_cramfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_cramfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct cramfs_super *cs;
#define EXT3_MIN_BLOCK_SIZE 0x400
#define EXT3_MAX_BLOCK_SIZE 0x1000
-int volume_id_probe_ext(struct volume_id *id, uint64_t off)
+int volume_id_probe_ext(struct volume_id *id, uint64_t off, uint64_t size)
{
struct ext2_super_block *es;
size_t bsize;
return NULL;
}
-int volume_id_probe_vfat(struct volume_id *id, uint64_t off)
+int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size)
{
struct vfat_super_block *vs;
struct vfat_dir_entry *dir;
return -1;
}
-int volume_id_probe_gfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_gfs(struct volume_id *id, uint64_t off, uint64_t size)
{
return volume_id_probe_gfs_generic(id, off, 1);
}
-int volume_id_probe_gfs2(struct volume_id *id, uint64_t off)
+int volume_id_probe_gfs2(struct volume_id *id, uint64_t off, uint64_t size)
{
return volume_id_probe_gfs_generic(id, off, 2);
}
#define HFS_NODE_LEAF 0xff
#define HFSPLUS_POR_CNID 1
-int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off)
+int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off, uint64_t size)
{
unsigned int blocksize;
unsigned int cat_block;
#define HPT45X_MAGIC_BAD 0x5a7816fd
-int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off)
+int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
struct hpt37x_meta *hpt;
#define HPFS_SUPERBLOCK_OFFSET 0x2000
-int volume_id_probe_hpfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_hpfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct hpfs_super *hs;
uint8_t version;
} PACKED;
-int volume_id_probe_iso9660(struct volume_id *id, uint64_t off)
+int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size)
{
uint8_t *buf;
struct iso_volume_descriptor *is;
#define JFS_SUPERBLOCK_OFFSET 0x8000
-int volume_id_probe_jfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_jfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct jfs_super_block *js;
extern void volume_id_close(struct volume_id *id);
/* filesystems */
-extern int volume_id_probe_cramfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_ext(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_vfat(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_hpfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_iso9660(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_jfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_minix(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_ntfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_romfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_sysv(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_udf(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_ufs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_vxfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_xfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_squashfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_netware(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_gfs(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_gfs2(struct volume_id *id, uint64_t off);
+extern int volume_id_probe_cramfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_ext(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_hpfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_jfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_minix(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_romfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_sysv(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_udf(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_ufs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_vxfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_xfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_squashfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_netware(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_gfs(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_gfs2(struct volume_id *id, uint64_t off, uint64_t size);
/* special formats */
-extern int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off);
-extern int volume_id_probe_luks(struct volume_id *id, uint64_t off);
+extern int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_luks(struct volume_id *id, uint64_t off, uint64_t size);
/* raid */
extern int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size);
-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);
+extern int volume_id_probe_lvm1(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_lvm2(struct volume_id *id, uint64_t off, uint64_t size);
/* bios raid */
extern int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size);
-extern int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off);
+extern int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off, uint64_t size);
extern int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size);
extern int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size);
extern int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size);
#define LARGEST_PAGESIZE 0x4000
-int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off)
+int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
unsigned int page;
} keyblock[LUKS_NUMKEYS];
};
-int volume_id_probe_luks(struct volume_id *id, uint64_t off)
+int volume_id_probe_luks(struct volume_id *id, uint64_t off, uint64_t size)
{
struct luks_phdr *header;
#define LVM1_SB_OFF 0x400
#define LVM1_MAGIC "HM"
-int volume_id_probe_lvm1(struct volume_id *id, uint64_t off)
+int volume_id_probe_lvm1(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
struct lvm1_super_block *lvm;
#define LVM2_LABEL_ID "LABELONE"
#define LVM2LABEL_SCAN_SECTORS 4
-int volume_id_probe_lvm2(struct volume_id *id, uint64_t off)
+int volume_id_probe_lvm2(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
unsigned int soff;
#define MINIX_SUPERBLOCK_OFFSET 0x400
-int volume_id_probe_minix(struct volume_id *id, uint64_t off)
+int volume_id_probe_minix(struct volume_id *id, uint64_t off, uint64_t size)
{
struct minix_super_block *ms;
uint32_t reserved2[64-(2+46)];
} PACKED;
-int volume_id_probe_netware(struct volume_id *id, uint64_t off)
+int volume_id_probe_netware(struct volume_id *id, uint64_t off, uint64_t size)
{
struct netware_super_block *nw;
#define MFT_RECORD_ATTR_OBJECT_ID 0x40
#define MFT_RECORD_ATTR_END 0xffffffffu
-int volume_id_probe_ntfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size)
{
unsigned int sector_size;
unsigned int cluster_size;
uint8_t s_uuid[16];
} PACKED;
-int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off)
+int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
struct ocfs1_super_block_header *osh;
#define OCFS2_MAX_BLOCKSIZE 0x1000
#define OCFS2_SUPER_BLOCK_BLKNO 2
-int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off)
+int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
struct ocfs2_super_block *os;
#define REISERFS1_SUPERBLOCK_OFFSET 0x2000
#define REISERFS_SUPERBLOCK_OFFSET 0x10000
-int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct reiserfs_super_block *rs;
struct reiser4_super_block *rs4;
uint8_t name[0];
} PACKED;
-int volume_id_probe_romfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_romfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct romfs_super *rfs;
uint32_t s_magic;
} PACKED;
-int volume_id_probe_squashfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_squashfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct squashfs_super *sqs;
#define XENIX_MAGIC 0x2b5544
#define SYSV_MAX_BLOCKSIZE 0x800
-int volume_id_probe_sysv(struct volume_id *id, uint64_t off)
+int volume_id_probe_sysv(struct volume_id *id, uint64_t off, uint64_t size)
{
struct sysv_super *vs;
struct xenix_super *xs;
#define UDF_VSD_OFFSET 0x8000
-int volume_id_probe_udf(struct volume_id *id, uint64_t off)
+int volume_id_probe_udf(struct volume_id *id, uint64_t off, uint64_t size)
{
struct volume_descriptor *vd;
struct volume_structure_descriptor *vsd;
#define UFS_MAGIC_FEA 0x00195612
#define UFS_MAGIC_LFN 0x00095014
-int volume_id_probe_ufs(struct volume_id *id, uint64_t off)
+int volume_id_probe_ufs(struct volume_id *id, uint64_t off, uint64_t size)
{
uint32_t magic;
int i;
goto found;
}
- if (volume_id_probe_lvm1(id, off) == 0)
+ if (volume_id_probe_lvm1(id, off, size) == 0)
goto found;
- if (volume_id_probe_lvm2(id, off) == 0)
+ if (volume_id_probe_lvm2(id, off, size) == 0)
goto found;
- if (volume_id_probe_highpoint_37x_raid(id, off) == 0)
+ if (volume_id_probe_highpoint_37x_raid(id, off, size) == 0)
goto found;
return -1;
info("probing at offset 0x%llx, size 0x%llx",
(unsigned long long) off, (unsigned long long) size);
- if (volume_id_probe_vfat(id, off) == 0)
+ if (volume_id_probe_vfat(id, off, size) == 0)
goto found;
/* fill buffer with maximum */
volume_id_get_buffer(id, 0, SB_BUFFER_SIZE);
- if (volume_id_probe_linux_swap(id, off) == 0)
+ if (volume_id_probe_linux_swap(id, off, size) == 0)
goto found;
- if (volume_id_probe_luks(id, off) == 0)
+ if (volume_id_probe_luks(id, off, size) == 0)
goto found;
- if (volume_id_probe_xfs(id, off) == 0)
+ if (volume_id_probe_xfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_ext(id, off) == 0)
+ if (volume_id_probe_ext(id, off, size) == 0)
goto found;
- if (volume_id_probe_reiserfs(id, off) == 0)
+ if (volume_id_probe_reiserfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_jfs(id, off) == 0)
+ if (volume_id_probe_jfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_udf(id, off) == 0)
+ if (volume_id_probe_udf(id, off, size) == 0)
goto found;
- if (volume_id_probe_iso9660(id, off) == 0)
+ if (volume_id_probe_iso9660(id, off, size) == 0)
goto found;
- if (volume_id_probe_hfs_hfsplus(id, off) == 0)
+ if (volume_id_probe_hfs_hfsplus(id, off, size) == 0)
goto found;
- if (volume_id_probe_ufs(id, off) == 0)
+ if (volume_id_probe_ufs(id, off, size) == 0)
goto found;
- if (volume_id_probe_ntfs(id, off) == 0)
+ if (volume_id_probe_ntfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_cramfs(id, off) == 0)
+ if (volume_id_probe_cramfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_romfs(id, off) == 0)
+ if (volume_id_probe_romfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_hpfs(id, off) == 0)
+ if (volume_id_probe_hpfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_sysv(id, off) == 0)
+ if (volume_id_probe_sysv(id, off, size) == 0)
goto found;
- if (volume_id_probe_minix(id, off) == 0)
+ if (volume_id_probe_minix(id, off, size) == 0)
goto found;
- if (volume_id_probe_ocfs1(id, off) == 0)
+ if (volume_id_probe_ocfs1(id, off, size) == 0)
goto found;
- if (volume_id_probe_ocfs2(id, off) == 0)
+ if (volume_id_probe_ocfs2(id, off, size) == 0)
goto found;
- if (volume_id_probe_vxfs(id, off) == 0)
+ if (volume_id_probe_vxfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_squashfs(id, off) == 0)
+ if (volume_id_probe_squashfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_netware(id, off) == 0)
+ if (volume_id_probe_netware(id, off, size) == 0)
goto found;
- if (volume_id_probe_gfs(id, off) == 0)
+ if (volume_id_probe_gfs(id, off, size) == 0)
goto found;
- if (volume_id_probe_gfs2(id, off) == 0)
+ if (volume_id_probe_gfs2(id, off, size) == 0)
goto found;
return -1;
int32_t vs_version;
} PACKED;
-int volume_id_probe_vxfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_vxfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct vxfs_super *vxs;
uint64_t fdblocks;
} PACKED;
-int volume_id_probe_xfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_xfs(struct volume_id *id, uint64_t off, uint64_t size)
{
struct xfs_super_block *xs;
printf("%s\n", vid->type);
if (volume_id_probe_jmicron_raid(vid, 0, size) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_vfat(vid, 0) == 0)
+ if (volume_id_probe_vfat(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_linux_swap(vid, 0) == 0)
+ if (volume_id_probe_linux_swap(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_luks(vid, 0) == 0)
+ if (volume_id_probe_luks(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_xfs(vid, 0) == 0)
+ if (volume_id_probe_xfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_ext(vid, 0) == 0)
+ if (volume_id_probe_ext(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_reiserfs(vid, 0) == 0)
+ if (volume_id_probe_reiserfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_jfs(vid, 0) == 0)
+ if (volume_id_probe_jfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_udf(vid, 0) == 0)
+ if (volume_id_probe_udf(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_iso9660(vid, 0) == 0)
+ if (volume_id_probe_iso9660(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_hfs_hfsplus(vid, 0) == 0)
+ if (volume_id_probe_hfs_hfsplus(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_ufs(vid, 0) == 0)
+ if (volume_id_probe_ufs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_ntfs(vid, 0) == 0)
+ if (volume_id_probe_ntfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_cramfs(vid, 0) == 0)
+ if (volume_id_probe_cramfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_romfs(vid, 0) == 0)
+ if (volume_id_probe_romfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_hpfs(vid, 0) == 0)
+ if (volume_id_probe_hpfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_sysv(vid, 0) == 0)
+ if (volume_id_probe_sysv(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_minix(vid, 0) == 0)
+ if (volume_id_probe_minix(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_ocfs1(vid, 0) == 0)
+ if (volume_id_probe_ocfs1(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_ocfs2(vid, 0) == 0)
+ if (volume_id_probe_ocfs2(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_vxfs(vid, 0) == 0)
+ if (volume_id_probe_vxfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_squashfs(vid, 0) == 0)
+ if (volume_id_probe_squashfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_netware(vid, 0) == 0)
+ if (volume_id_probe_netware(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_gfs(vid, 0) == 0)
+ if (volume_id_probe_gfs(vid, 0, 0) == 0)
printf("%s\n", vid->type);
- if (volume_id_probe_gfs2(vid, 0) == 0)
+ if (volume_id_probe_gfs2(vid, 0, 0) == 0)
printf("%s\n", vid->type);
goto exit;