1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

volume_id: use PRIu64i, PRIx64 macros

This commit is contained in:
Kay Sievers 2008-10-03 18:24:04 +02:00
parent 99370c2152
commit 0565a00a4c
39 changed files with 61 additions and 74 deletions

View File

@ -91,8 +91,7 @@ int volume_id_probe_adaptec_raid(struct volume_id *id, uint64_t off, uint64_t si
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;

View File

@ -75,8 +75,7 @@ int volume_id_probe_btrfs(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -50,7 +50,7 @@ int volume_id_probe_cramfs(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -50,8 +50,7 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size)
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;
@ -62,11 +61,11 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size)
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;
}
@ -77,11 +76,11 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size)
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;
}

View File

@ -135,7 +135,7 @@ int volume_id_probe_ext(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -275,7 +275,7 @@ int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size)
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)
@ -380,7 +380,7 @@ magic:
/* 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);
@ -442,7 +442,7 @@ fat32:
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);

View File

@ -83,7 +83,7 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
{
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));

View File

@ -188,7 +188,7 @@ int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off, uint64_t siz
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)
@ -211,7 +211,7 @@ int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off, uint64_t siz
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)

View File

@ -54,7 +54,7 @@ int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off, uint6
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)
@ -78,8 +78,7 @@ int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint6
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;

View File

@ -80,7 +80,7 @@ int volume_id_probe_hpfs(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -64,7 +64,7 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size)
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)
@ -91,7 +91,7 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size)
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) {

View File

@ -48,8 +48,7 @@ int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint
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;

View File

@ -50,7 +50,7 @@ int volume_id_probe_jfs(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -44,8 +44,7 @@ int volume_id_probe_jmicron_raid(struct volume_id *id, uint64_t off, uint64_t si
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;

View File

@ -20,9 +20,10 @@
#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>

View File

@ -72,8 +72,7 @@ static int volume_id_probe_linux_raid0(struct volume_id *id, uint64_t off, uint6
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;
@ -127,8 +126,7 @@ static int volume_id_probe_linux_raid1(struct volume_id *id, uint64_t off, uint6
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)

View File

@ -48,7 +48,7 @@ int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size
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) {

View File

@ -43,8 +43,7 @@ int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t s
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;

View File

@ -56,7 +56,7 @@ int volume_id_probe_lvm1(struct volume_id *id, uint64_t off, uint64_t size)
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)
@ -83,7 +83,7 @@ int volume_id_probe_lvm2(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -75,7 +75,7 @@ int volume_id_probe_minix(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -87,7 +87,7 @@ int volume_id_probe_netware(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -110,7 +110,7 @@ int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size)
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)
@ -137,8 +137,8 @@ int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size)
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);

View File

@ -46,8 +46,7 @@ int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t siz
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;

View File

@ -136,7 +136,7 @@ int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off, uint64_t size)
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)
@ -174,7 +174,7 @@ int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off, uint64_t size)
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);

View File

@ -50,7 +50,7 @@ int volume_id_probe_oracleasm(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -47,8 +47,7 @@ int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, u
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;

View File

@ -65,7 +65,7 @@ int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -42,7 +42,7 @@ int volume_id_probe_romfs(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -58,8 +58,7 @@ int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint
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;

View File

@ -50,7 +50,7 @@ int volume_id_probe_squashfs(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -100,7 +100,7 @@ int volume_id_probe_sysv(struct volume_id *id, uint64_t off, uint64_t size)
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 *)

View File

@ -77,7 +77,7 @@ int volume_id_probe_udf(struct volume_id *id, uint64_t off, uint64_t size)
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)

View File

@ -180,7 +180,7 @@ int volume_id_probe_ufs(struct volume_id *id, uint64_t off, uint64_t size)
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);

View File

@ -352,7 +352,7 @@ uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len)
{
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) {
@ -365,7 +365,7 @@ uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len)
/* 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;
@ -401,7 +401,7 @@ uint8_t *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len)
/* 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;

View File

@ -68,8 +68,7 @@ int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size)
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;

View File

@ -367,8 +367,7 @@ int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size)
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)
@ -401,8 +400,7 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size
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)

View File

@ -42,7 +42,7 @@ int volume_id_probe_vxfs(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -32,14 +32,14 @@
#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;
@ -50,7 +50,7 @@ int volume_id_probe_xfs(struct volume_id *id, uint64_t off, uint64_t size)
{
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)

View File

@ -31,6 +31,7 @@
#include <grp.h>
#include <getopt.h>
#include <fcntl.h>
#include <inttypes.h>
#include <sys/ioctl.h>
#include "../../udev/udev.h"
@ -247,7 +248,7 @@ int main(int argc, char *argv[])
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 */