uint64_t meta_off;
struct adaptec_meta *ad;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
const uint8_t *buf;
struct btrfs_super_block *bfs;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long)off, (unsigned long long)size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
buf = volume_id_get_buffer(id, off + 0x4000, 0x200);
if (buf == NULL)
{
struct cramfs_super *cs;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
cs = (struct cramfs_super *) volume_id_get_buffer(id, off, 0x200);
if (cs == NULL)
const uint8_t *buf;
struct ddf_header *ddf;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long)off, (unsigned long long)size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x30000)
return -1;
return -1;
ddf = (struct ddf_header *) buf;
if (memcmp(ddf->signature, "\x11\xde\x11\xde", 4) == 0) {
- info("header (little endian) found at %llu\n", (unsigned long long)(off + ddf_off));
+ info("header (little endian) found at %" PRIu64 "\n", (off + ddf_off));
goto found;
}
if (memcmp(ddf->signature, "\xde\x11\xde\x11", 4) == 0) {
- info("header (big endian) found at %llu\n", (unsigned long long)(off + ddf_off));
+ info("header (big endian) found at %" PRIu64 "\n", (off + ddf_off));
goto found;
}
return -1;
ddf = (struct ddf_header *) buf;
if (memcmp(ddf->signature, "\x11\xde\x11\xde", 4) == 0) {
- info("header adaptec (little endian) found at %llu\n", (unsigned long long)(off + ddf_off));
+ info("header adaptec (little endian) found at %" PRIu64 "\n", (off + ddf_off));
goto found;
}
if (memcmp(ddf->signature, "\xde\x11\xde\x11", 4) == 0) {
- info("header adaptec (big endian) found at %llu\n", (unsigned long long)(off + ddf_off));
+ info("header adaptec (big endian) found at %" PRIu64 "\n", (off + ddf_off));
goto found;
}
uint32_t feature_incompat;
uint32_t flags;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
es = (struct ext2_super_block *) volume_id_get_buffer(id, off + EXT_SUPERBLOCK_OFFSET, 0x200);
if (es == NULL)
int maxloop;
size_t fnlen;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off, 0x400);
if (buf == NULL)
/* the label may be an attribute in the root directory */
root_start = (reserved + fat_size) * sector_size;
- dbg("root dir start 0x%llx\n", (unsigned long long) root_start);
+ dbg("root dir start 0x%" PRIx64 "\n", root_start);
root_dir_entries = le16_to_cpu(vs->dir_entries);
dbg("expected entries 0x%x\n", root_dir_entries);
dbg("next cluster %u\n", next);
next_sect_off = (next - 2) * vs->sectors_per_cluster;
next_off = (start_data_sect + next_sect_off) * sector_size;
- dbg("cluster offset 0x%llx\n", (unsigned long long) next_off);
+ dbg("cluster offset 0x%" PRIx64 "\n", next_off);
/* get cluster */
buf = volume_id_get_buffer(id, off + next_off, buf_size);
{
struct gfs2_sb *sbd;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
sbd = (struct gfs2_sb *)
volume_id_get_buffer(id, off + GFS_SUPERBLOCK_OFFSET, sizeof(struct gfs2_sb));
struct hfsplus_extent extents[HFSPLUS_EXTENT_COUNT];
const uint8_t *buf;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + HFS_SUPERBLOCK_OFFSET, 0x200);
if (buf == NULL)
off += (alloc_first_block * 512) +
(embed_first_block * alloc_block_size);
- dbg("hfs wrapped hfs+ found at offset 0x%llx\n", (unsigned long long) off);
+ dbg("hfs wrapped hfs+ found at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + HFS_SUPERBLOCK_OFFSET, 0x200);
if (buf == NULL)
struct hpt37x_meta *hpt;
uint32_t magic;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + HPT37X_CONFIG_OFF, 0x200);
if (buf == NULL)
uint64_t meta_off;
uint32_t magic;
- dbg("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ dbg("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
struct hpfs_spare_super *hss;
struct hpfs_boot_block *hbb;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
hs = (struct hpfs_super *) volume_id_get_buffer(id, off + HPFS_SUPERBLOCK_OFFSET, 0x400);
if (hs == NULL)
struct iso_volume_descriptor *is;
struct high_sierra_volume_descriptor *hs;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + ISO_SUPERBLOCK_OFFSET, 0x200);
if (buf == NULL)
if (is->type != ISO_VD_SUPPLEMENTARY)
continue;
- dbg("found SVD at offset 0x%llx\n", (unsigned long long) (off + vd_offset));
+ dbg("found SVD at offset 0x%" PRIx64 "\n", (off + vd_offset));
if (memcmp(is->escape_sequences, "%/@", 3) == 0||
memcmp(is->escape_sequences, "%/C", 3) == 0||
memcmp(is->escape_sequences, "%/E", 3) == 0) {
uint64_t meta_off;
struct isw_meta *isw;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
{
struct jfs_super_block *js;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
js = (struct jfs_super_block *) volume_id_get_buffer(id, off + JFS_SUPERBLOCK_OFFSET, 0x200);
if (js == NULL)
uint64_t meta_off;
struct jmicron_meta *jm;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
#ifndef _LIBVOLUME_ID_PRIVATE_H_
#define _LIBVOLUME_ID_PRIVATE_H_
-#include <stdint.h>
#include <stddef.h>
#include <endian.h>
+#include <stdint.h>
+#include <inttypes.h>
#include <byteswap.h>
#include <syslog.h>
uint8_t bytes[16];
} uuid;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
const uint8_t *buf;
struct mdp1_super_block *mdp1;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
buf = volume_id_get_buffer(id, off, 0x800);
if (buf == NULL)
unsigned int page;
struct swap_header_v1_2 *sw;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
/* eek, the swap signature is at the end of the PAGE_SIZE */
for (page = 0x1000; page <= LARGEST_PAGESIZE; page <<= 1) {
uint64_t meta_off;
struct lsi_meta *lsi;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
const uint8_t *buf;
struct lvm1_super_block *lvm;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + LVM1_SB_OFF, 0x800);
if (buf == NULL)
struct lvm2_super_block *lvm;
struct lvm2_pv_header *pvhdr;
- dbg("probing at offset 0x%llx\n", (unsigned long long) off);
+ dbg("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off, LVM2LABEL_SCAN_SECTORS * 0x200);
if (buf == NULL)
struct minix_super_block *ms;
struct minix3_super_block *m3s;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200);
if (buf == NULL)
{
struct netware_super_block *nw;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
nw = (struct netware_super_block *) volume_id_get_buffer(id, off + NW_SUPERBLOCK_OFFSET, 0x200);
if (nw == NULL)
const uint8_t *buf;
const uint8_t *val;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
ns = (struct ntfs_super_block *) volume_id_get_buffer(id, off, 0x200);
if (ns == NULL)
dbg("sectorsize 0x%x\n", sector_size);
dbg("clustersize 0x%x\n", cluster_size);
- dbg("mftcluster %llu\n", (unsigned long long) mft_cluster);
- dbg("mftoffset 0x%llx\n", (unsigned long long) mft_off);
+ dbg("mftcluster %" PRIu64 "\n", mft_cluster);
+ dbg("mftoffset 0x%" PRIx64 "\n", mft_off);
dbg("cluster per mft_record %i\n", ns->cluster_per_mft_record);
dbg("mft record size %i\n", mft_record_size);
uint64_t meta_off;
struct nvidia_meta *nv;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
struct ocfs1_super_block_header *osh;
struct ocfs1_super_block_label *osl;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off, 0x200);
if (buf == NULL)
struct ocfs2_super_block *os;
size_t blksize;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
for (blksize = 0x200; blksize <= OCFS2_MAX_BLOCKSIZE; blksize <<= 1) {
buf = volume_id_get_buffer(id, off + OCFS2_SUPER_BLOCK_BLKNO * blksize, 0x200);
const uint8_t *buf;
struct oracleasm_super_block *oracleasm;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + ASM_SB_OFF, 0x800);
if (buf == NULL)
63, 255, 256, 16, 399, 0
};
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x40000)
return -1;
struct reiser4_super_block *rs4;
uint8_t *buf;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
buf = volume_id_get_buffer(id, off + REISERFS_SUPERBLOCK_OFFSET, 0x200);
if (buf == NULL)
{
struct romfs_super *rfs;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
rfs = (struct romfs_super *) volume_id_get_buffer(id, off, 0x200);
if (rfs == NULL)
uint64_t meta_off;
struct silicon_meta *sil;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
{
struct squashfs_super *sqs;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
sqs = (struct squashfs_super *) volume_id_get_buffer(id, off, 0x200);
if (sqs == NULL)
struct xenix_super *xs;
unsigned int boff;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
for (boff = 0x200; boff <= SYSV_MAX_BLOCKSIZE; boff <<= 1) {
vs = (struct sysv_super *)
unsigned int loc;
unsigned int clen;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
vsd = (struct volume_structure_descriptor *) volume_id_get_buffer(id, off + UDF_VSD_OFFSET, 0x200);
if (vsd == NULL)
struct ufs_super_block *ufs;
int offsets[] = {0, 8, 64, 256, -1};
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
for (i = 0; offsets[i] >= 0; i++) {
ufs = (struct ufs_super_block *) volume_id_get_buffer(id, off + (offsets[i] * 0x400), 0x800);
{
ssize_t buf_len;
- info("get buffer off 0x%llx(%llu), len 0x%zx\n", (unsigned long long) off, (unsigned long long) off, len);
+ info("get buffer off 0x%" PRIx64 "(%" PRIu64 "), len 0x%zx\n", off, off, len);
/* check if requested area fits in superblock buffer */
if (off + len <= SB_BUFFER_SIZE) {
if (id->sbbuf == NULL) {
/* check if we need to read */
if ((off + len) > id->sbbuf_len) {
- info("read sbbuf len:0x%llx\n", (unsigned long long) (off + len));
+ info("read sbbuf len:0x%" PRIx64 "\n", (off + len));
if (lseek(id->fd, 0, SEEK_SET) < 0) {
dbg("lseek failed (%s)\n", strerror(errno));
return NULL;
/* check if we need to read */
if ((off < id->seekbuf_off) || ((off + len) > (id->seekbuf_off + id->seekbuf_len))) {
- info("read seekbuf off:0x%llx len:0x%zx\n", (unsigned long long) off, len);
+ info("read seekbuf off:0x%" PRIx64 " len:0x%zx\n", off, len);
if (lseek(id->fd, off, SEEK_SET) < 0) {
dbg("lseek failed (%s)\n", strerror(errno));
return NULL;
uint64_t meta_off;
struct via_meta *via;
- dbg("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ dbg("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
if (size < 0x10000)
return -1;
if (!device_is_readable(id, off))
return -1;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
for (i = 0; i < ARRAY_SIZE(prober_raid); i++)
if (prober_raid[i].prober(id, off, size) == 0)
if (!device_is_readable(id, off))
return -1;
- info("probing at offset 0x%llx, size 0x%llx\n",
- (unsigned long long) off, (unsigned long long) size);
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
for (i = 0; i < ARRAY_SIZE(prober_filesystem); i++)
if (prober_filesystem[i].prober(id, off, size) == 0)
{
struct vxfs_super *vxs;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
vxs = (struct vxfs_super *) volume_id_get_buffer(id, off + 0x200, 0x200);
if (vxs == NULL)
#include "libvolume_id-private.h"
struct xfs_super_block {
- uint8_t magic[4];
+ uint8_t magic[4];
uint32_t blocksize;
uint64_t dblocks;
uint64_t rblocks;
uint32_t dummy1[2];
- uint8_t uuid[16];
+ uint8_t uuid[16];
uint32_t dummy2[15];
- uint8_t fname[12];
+ uint8_t fname[12];
uint32_t dummy3[2];
uint64_t icount;
uint64_t ifree;
{
struct xfs_super_block *xs;
- info("probing at offset 0x%llx\n", (unsigned long long) off);
+ info("probing at offset 0x%" PRIx64 "\n", off);
xs = (struct xfs_super_block *) volume_id_get_buffer(id, off, 0x200);
if (xs == NULL)
#include <grp.h>
#include <getopt.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <sys/ioctl.h>
#include "../../udev/udev.h"
if (size == 0) {
if (ioctl(fd, BLKGETSIZE64, &size) != 0)
size = 0;
- info(udev_ctx, "BLKGETSIZE64=%llu (%lluGB)\n", (unsigned long long)size, (unsigned long long)size >> 30);
+ info(udev_ctx, "BLKGETSIZE64=%" PRIu64 " (%" PRIu64 "GB)\n", size, size >> 30);
}
/* try to drop all privileges before reading disk content */