struct blkid_bufinfo {
unsigned char *data;
- blkid_loff_t off;
- blkid_loff_t len;
+ uint64_t off;
+ uint64_t len;
struct list_head bufs; /* list of buffers */
};
struct blkid_struct_probe
{
int fd; /* device file descriptor */
- blkid_loff_t off; /* begin of data on the device */
- blkid_loff_t size; /* end of data on the device */
+ uint64_t off; /* begin of data on the device */
+ uint64_t size; /* end of data on the device */
size_t mmap_granularity; /* minimal size of mmaped buffer (PAGE_SIZE) */
dev_t devno; /* device number (st.st_rdev) */
int flags; /* private libray flags */
int prob_flags; /* always zeroized by blkid_do_*() */
- blkid_loff_t wipe_off; /* begin of the wiped area */
- blkid_loff_t wipe_size; /* size of the wiped area */
+ uint64_t wipe_off; /* begin of the wiped area */
+ uint64_t wipe_size; /* size of the wiped area */
struct blkid_chain *wipe_chain; /* superblock, partition, ... */
struct list_head buffers; /* list of buffers */
__attribute__((warn_unused_result));
extern unsigned char *blkid_probe_get_buffer(blkid_probe pr,
- blkid_loff_t off, blkid_loff_t len)
+ uint64_t off, uint64_t len)
__attribute__((nonnull))
__attribute__((warn_unused_result));
__attribute__((warn_unused_result));
extern int blkid_probe_get_dimension(blkid_probe pr,
- blkid_loff_t *off, blkid_loff_t *size)
+ uint64_t *off, uint64_t *size)
__attribute__((nonnull));
extern int blkid_probe_set_dimension(blkid_probe pr,
- blkid_loff_t off, blkid_loff_t size)
+ uint64_t off, uint64_t size)
__attribute__((nonnull));
extern int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
- blkid_loff_t *offset, const struct blkid_idmag **res)
+ uint64_t *offset, const struct blkid_idmag **res)
__attribute__((nonnull(1)));
/* returns superblok according to 'struct blkid_idmag' */
__attribute__((warn_unused_result));
extern int blkid_probe_is_covered_by_pt(blkid_probe pr,
- blkid_loff_t offset, blkid_loff_t size)
+ uint64_t offset, uint64_t size)
__attribute__((warn_unused_result));
extern void blkid_probe_chain_reset_values(blkid_probe pr, struct blkid_chain *chn)
__attribute__((nonnull))
__attribute__ ((__format__ (__printf__, 3, 4)));
-extern int blkid_probe_set_magic(blkid_probe pr, blkid_loff_t offset,
+extern int blkid_probe_set_magic(blkid_probe pr, uint64_t offset,
size_t len, unsigned char *magic)
__attribute__((nonnull));
extern size_t blkid_ltrim_whitespace(unsigned char *str)
__attribute__((nonnull));
-extern void blkid_probe_set_wiper(blkid_probe pr, blkid_loff_t off,
- blkid_loff_t size)
+extern void blkid_probe_set_wiper(blkid_probe pr, uint64_t off,
+ uint64_t size)
__attribute__((nonnull));
extern int blkid_probe_is_wiped(blkid_probe pr, struct blkid_chain **chn,
- blkid_loff_t off, blkid_loff_t size)
+ uint64_t off, uint64_t size)
__attribute__((nonnull))
__attribute__((warn_unused_result));
-extern void blkid_probe_use_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
+extern void blkid_probe_use_wiper(blkid_probe pr, uint64_t off, uint64_t size)
__attribute__((nonnull));
/* filter bitmap macros */
static int last_lba(blkid_probe pr, uint64_t *lba)
{
- blkid_loff_t sz = blkid_probe_get_size(pr);
+ uint64_t sz = blkid_probe_get_size(pr);
unsigned int ssz = blkid_probe_get_sectorsize(pr);
if (sz < ssz)
uint16_t block_size,
uint32_t num)
{
- return blkid_probe_get_buffer(pr,
- (blkid_loff_t) num * block_size, block_size);
+ return blkid_probe_get_buffer(pr, (uint64_t) num * block_size, block_size);
}
static inline int has_part_signature(struct mac_partition *p)
/* exported as opaque type "blkid_parttable" */
struct blkid_struct_parttable {
const char *type; /* partition table type */
- blkid_loff_t offset; /* begin of the partition table (in bytes) */
+ uint64_t offset; /* begin of the partition table (in bytes) */
int nparts; /* number of partitions */
blkid_partition parent; /* parent of nested partition table */
char id[37]; /* PT identifier (e.g. UUID for GPT) */
/* exported as opaque type "blkid_partition" */
struct blkid_struct_partition {
- blkid_loff_t start; /* begin of the partition (512-bytes sectors) */
- blkid_loff_t size; /* size of the partitions (512-bytes sectors) */
+ uint64_t start; /* begin of the partition (512-bytes sectors) */
+ uint64_t size; /* size of the partitions (512-bytes sectors) */
int type; /* partition type */
char typestr[37]; /* partition type string (GPT and Mac) */
}
blkid_parttable blkid_partlist_new_parttable(blkid_partlist ls,
- const char *type, blkid_loff_t offset)
+ const char *type, uint64_t offset)
{
blkid_parttable tab;
}
blkid_partition blkid_partlist_add_partition(blkid_partlist ls,
- blkid_parttable tab,
- blkid_loff_t start, blkid_loff_t size)
+ blkid_parttable tab, uint64_t start, uint64_t size)
{
blkid_partition par = new_partition(ls, tab);
par->size = size;
DBG(LOWPROBE, ul_debug("parts: add partition (%p start=%"
- PRId64 ", size=%" PRId64 ", table=%p)",
+ PRIu64 ", size=%" PRIu64 ", table=%p)",
par, par->start, par->size, tab));
return par;
}
/* check if @start and @size are within @par partition */
int blkid_is_nested_dimension(blkid_partition par,
- blkid_loff_t start, blkid_loff_t size)
+ uint64_t start, uint64_t size)
{
- blkid_loff_t pstart;
- blkid_loff_t psize;
+ uint64_t pstart;
+ uint64_t psize;
if (!par)
return 0;
struct blkid_chain *chn)
{
const struct blkid_idmag *mag = NULL;
- blkid_loff_t off;
+ uint64_t off;
int rc = BLKID_PROBE_NONE; /* default is nothing */
if (pr->size <= 0 || (id->minsz && id->minsz > pr->size))
blkid_probe prc;
int rc;
blkid_partlist ls;
- blkid_loff_t sz, off;
+ uint64_t sz, off;
DBG(LOWPROBE, ul_debug(
"parts: ----> %s subprobe requested (parent=%p)",
return BLKID_PROBE_NONE;
/* range defined by parent */
- sz = ((blkid_loff_t) parent->size) << 9;
- off = ((blkid_loff_t) parent->start) << 9;
+ sz = parent->size << 9;
+ off = parent->start << 9;
if (off < pr->off || pr->off + pr->size < off + sz) {
DBG(LOWPROBE, ul_debug(
* @size is covered by any partition.
*/
int blkid_probe_is_covered_by_pt(blkid_probe pr,
- blkid_loff_t offset, blkid_loff_t size)
+ uint64_t offset, uint64_t size)
{
blkid_probe prc = NULL;
blkid_partlist ls = NULL;
- blkid_loff_t start, end;
+ uint64_t start, end;
int nparts, i, rc = 0;
DBG(LOWPROBE, ul_debug(
if (partno != blkid_partition_get_partno(par))
continue;
- if ((blkid_loff_t) size == blkid_partition_get_size(par) ||
- (blkid_partition_is_extended(par) && size <= 1024))
+ if (size == blkid_partition_get_size(par) ||
+ (blkid_partition_is_extended(par) && size <= 1024ULL))
return par;
}
for (i = 0; i < ls->nparts; i++) {
blkid_partition par = &ls->parts[i];
- if (blkid_partition_get_start(par) == (blkid_loff_t) start &&
- blkid_partition_get_size(par) == (blkid_loff_t) size)
+ if (blkid_partition_get_start(par) == start &&
+ blkid_partition_get_size(par) == size)
return par;
/* exception for extended dos partitions */
- if (blkid_partition_get_start(par) == (blkid_loff_t) start &&
- blkid_partition_is_extended(par) && size <= 1024)
+ if (blkid_partition_get_start(par) == start &&
+ blkid_partition_is_extended(par) && size <= 1024ULL)
return par;
}
extern int blkid_partitions_get_flags(blkid_probe pr);
extern blkid_parttable blkid_partlist_new_parttable(blkid_partlist ls,
- const char *type, blkid_loff_t offset);
+ const char *type, uint64_t offset);
extern int blkid_parttable_set_uuid(blkid_parttable tab, const unsigned char *id);
extern int blkid_parttable_set_id(blkid_parttable tab, const unsigned char *id);
extern blkid_partition blkid_partlist_add_partition(blkid_partlist ls,
blkid_parttable tab,
- blkid_loff_t start, blkid_loff_t size);
+ uint64_t start, uint64_t size);
extern int blkid_partlist_set_partno(blkid_partlist ls, int partno);
extern int blkid_partlist_increment_partno(blkid_partlist ls);
extern int blkid_is_nested_dimension(blkid_partition par,
- blkid_loff_t start, blkid_loff_t size);
+ uint64_t start, uint64_t size);
extern int blkid_partition_set_name(blkid_partition par,
const unsigned char *name, size_t len);
blkid_parttable tab = NULL;
blkid_partlist ls;
uint16_t nparts;
- blkid_loff_t spc;
+ uint64_t spc;
int i, use_vtoc;
l = (struct sun_disklabel *) blkid_probe_get_sector(pr, 0);
for (i = 0, p = l->partitions; i < nparts; i++, p++) {
- blkid_loff_t start, size;
+ uint64_t start, size;
uint16_t type = 0, flags = 0;
blkid_partition par;
#define probe_is_mmap_wanted(p) (!S_ISCHR((p)->mode))
-static struct blkid_bufinfo *mmap_buffer(blkid_probe pr,
- blkid_loff_t real_off,
- blkid_loff_t len)
+static struct blkid_bufinfo *mmap_buffer(blkid_probe pr, uint64_t real_off, uint64_t len)
{
- blkid_loff_t map_len;
- blkid_loff_t map_off = 0;
+ uint64_t map_len;
+ uint64_t map_off = 0;
struct blkid_bufinfo *bf = NULL;
/*
/* begin of the device */
if (real_off == 0 || real_off + len < PROBE_MMAP_BEGINSIZ) {
- DBG(BUFFER, ul_debug("\tmapping begin of the device (max size: %ju)",
- (uintmax_t) pr->size));
+ DBG(BUFFER, ul_debug("\tmapping begin of the device (max size: %ju)", pr->size));
map_off = 0;
map_len = PROBE_MMAP_BEGINSIZ > pr->size ? pr->size : PROBE_MMAP_BEGINSIZ;
/* end of the device */
} else if (real_off > pr->off + pr->size - PROBE_MMAP_ENDSIZ) {
DBG(BUFFER, ul_debug("\tmapping end of the device (probing area: "
- "off=%ju, size=%ju)",
- (uintmax_t) pr->off, (uintmax_t) pr->size));
+ "off=%ju, size=%ju)", pr->off, pr->size));
map_off = PROBE_ALIGN_OFF(pr, pr->off + pr->size - PROBE_MMAP_ENDSIZ);
map_len = pr->off + pr->size - map_off;
/* middle of the device */
} else {
- blkid_loff_t minlen;
+ uint64_t minlen;
map_off = PROBE_ALIGN_OFF(pr, real_off);
minlen = real_off + len - map_off;
INIT_LIST_HEAD(&bf->bufs);
DBG(BUFFER, ul_debug("\tmmap %p: off=%ju, len=%ju (%ju pages)",
- bf->data, (uintmax_t) map_off, (uintmax_t) map_len,
- (uintmax_t) map_len / pr->mmap_granularity));
+ bf->data, map_off, map_len, map_len / pr->mmap_granularity));
return bf;
}
-static struct blkid_bufinfo *read_buffer(blkid_probe pr,
- blkid_loff_t real_off,
- blkid_loff_t len)
+static struct blkid_bufinfo *read_buffer(blkid_probe pr, uint64_t real_off, uint64_t len)
{
ssize_t ret;
struct blkid_bufinfo *bf = NULL;
bf->off = real_off;
INIT_LIST_HEAD(&bf->bufs);
- DBG(LOWPROBE, ul_debug("\tread %p: off=%jd len=%jd", bf->data, real_off, len));
+ DBG(LOWPROBE, ul_debug("\tread %p: off=%ju len=%ju", bf->data, real_off, len));
ret = read(pr->fd, bf->data, len);
if (ret != (ssize_t) len) {
* Note that @off is offset within probing area, the probing area is defined by
* pr->off and pr->size.
*/
-unsigned char *blkid_probe_get_buffer(blkid_probe pr,
- blkid_loff_t off, blkid_loff_t len)
+unsigned char *blkid_probe_get_buffer(blkid_probe pr, uint64_t off, uint64_t len)
{
struct list_head *p;
struct blkid_bufinfo *bf = NULL;
- blkid_loff_t real_off = pr->off + off;
+ uint64_t real_off = pr->off + off;
/*
DBG(BUFFER, ul_debug("\t>>>> off=%ju, real-off=%ju (probe <%ju..%ju>, len=%ju",
off, real_off, pr->off, pr->off + pr->size, len));
*/
- if (pr->size <= 0) {
+ if (pr->size == 0) {
errno = EINVAL;
return NULL;
}
list_entry(p, struct blkid_bufinfo, bufs);
if (real_off >= x->off && real_off + len <= x->off + x->len) {
- DBG(BUFFER, ul_debug("\treuse %p: off=%jd len=%jd (for off=%jd len=%jd)",
- x->data, x->off, x->len,
- real_off, len));
+ DBG(BUFFER, ul_debug("\treuse %p: off=%ju len=%ju (for off=%ju len=%ju)",
+ x->data, x->off, x->len, real_off, len));
bf = x;
break;
}
blkid_loff_t off, blkid_loff_t size)
{
struct stat sb;
- blkid_loff_t devsiz = 0;
+ uint64_t devsiz = 0;
if (!pr)
return -1;
pr->flags &= ~BLKID_FL_CDROM_DEV;
pr->prob_flags = 0;
pr->fd = fd;
- pr->off = off;
+ pr->off = (uint64_t) off;
pr->size = 0;
pr->devno = 0;
pr->disk_devno = 0;
if (off && size == 0)
/* only offset without size specified */
- pr->size -= off;
+ pr->size -= (uint64_t) off;
if (pr->off + pr->size > devsiz) {
DBG(LOWPROBE, ul_debug("area specified by offset and size is bigger than device"));
pr->flags |= BLKID_FL_CDROM_DEV;
#endif
- DBG(LOWPROBE, ul_debug("ready for low-probing, offset=%jd, size=%jd",
+ DBG(LOWPROBE, ul_debug("ready for low-probing, offset=%ju, size=%ju",
pr->off, pr->size));
DBG(LOWPROBE, ul_debug("whole-disk: %s, regfile: %s",
blkid_probe_is_wholedisk(pr) ?"YES" : "NO",
}
-int blkid_probe_get_dimension(blkid_probe pr,
- blkid_loff_t *off, blkid_loff_t *size)
+int blkid_probe_get_dimension(blkid_probe pr, uint64_t *off, uint64_t *size)
{
if (!pr)
return -1;
return 0;
}
-int blkid_probe_set_dimension(blkid_probe pr,
- blkid_loff_t off, blkid_loff_t size)
+int blkid_probe_set_dimension(blkid_probe pr, uint64_t off, uint64_t size)
{
if (!pr)
return -1;
DBG(LOWPROBE, ul_debug(
- "changing probing area pr=%p: size=%llu, off=%llu "
- "-to-> size=%llu, off=%llu",
- pr,
- (unsigned long long) pr->size,
- (unsigned long long) pr->off,
- (unsigned long long) size,
- (unsigned long long) off));
+ "changing probing area pr=%p: size=%ju, off=%ju "
+ "-to-> size=%ju, off=%ju",
+ pr, pr->size, pr->off, size, off));
pr->off = off;
pr->size = size;
pr->flags &= ~BLKID_FL_TINY_DEV;
- if (pr->size <= 1440 * 1024 && !S_ISCHR(pr->mode))
+ if (pr->size <= 1440ULL * 1024ULL && !S_ISCHR(pr->mode))
pr->flags |= BLKID_FL_TINY_DEV;
blkid_probe_reset_buffer(pr);
* or no magic present, or negative value on error.
*/
int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
- blkid_loff_t *offset, const struct blkid_idmag **res)
+ uint64_t *offset, const struct blkid_idmag **res)
{
const struct blkid_idmag *mag = NULL;
- blkid_loff_t off = 0;
+ uint64_t off = 0;
if (id)
mag = &id->magics[0];
{
const char *off = NULL;
size_t len = 0;
- loff_t offset, l;
+ uint64_t offset, l;
char buf[BUFSIZ];
int fd, rc = 0;
struct blkid_chain *chn;
if (rc || len == 0 || off == NULL)
return 0;
- offset = strtoll(off, NULL, 10);
+ offset = strtoumax(off, NULL, 10);
fd = blkid_probe_get_fd(pr);
if (fd < 0)
return -1;
len = sizeof(buf);
DBG(LOWPROBE, ul_debug(
- "do_wipe [offset=0x%jx, len=%zd, chain=%s, idx=%d, dryrun=%s]\n",
- offset, len, chn->driver->name, chn->idx, dryrun ? "yes" : "not"));
+ "do_wipe [offset=0x%jx (%ju), len=%zd, chain=%s, idx=%d, dryrun=%s]\n",
+ offset, offset, len, chn->driver->name, chn->idx, dryrun ? "yes" : "not"));
- l = lseek(fd, offset, SEEK_SET);
+ l = blkid_llseek(fd, offset, SEEK_SET);
if (l == (off_t) -1)
return -1;
unsigned char *blkid_probe_get_sector(blkid_probe pr, unsigned int sector)
{
return pr ? blkid_probe_get_buffer(pr,
- ((blkid_loff_t) sector) << 9, 0x200) : NULL;
+ ((uint64_t) sector) << 9, 0x200) : NULL;
}
struct blkid_prval *blkid_probe_assign_value(
return rc;
}
-int blkid_probe_set_magic(blkid_probe pr, blkid_loff_t offset,
+int blkid_probe_set_magic(blkid_probe pr, uint64_t offset,
size_t len, unsigned char *magic)
{
int rc = 0;
*/
blkid_loff_t blkid_probe_get_size(blkid_probe pr)
{
- return pr ? pr->size : -1;
+ return pr ? (blkid_loff_t) pr->size : -1;
}
/**
*/
blkid_loff_t blkid_probe_get_offset(blkid_probe pr)
{
- return pr ? pr->off : -1;
+ return pr ? (blkid_loff_t) pr->off : -1;
}
/**
*/
blkid_loff_t blkid_probe_get_sectors(blkid_probe pr)
{
- return pr ? pr->size >> 9 : -1;
+ return pr ? (blkid_loff_t) (pr->size >> 9) : -1;
}
/**
* Note that there is not relation between _wiper and blkid_to_wipe().
*
*/
-void blkid_probe_set_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
+void blkid_probe_set_wiper(blkid_probe pr, uint64_t off, uint64_t size)
{
struct blkid_chain *chn;
/*
* Returns 1 if the <@off,@size> area was wiped
*/
-int blkid_probe_is_wiped(blkid_probe pr, struct blkid_chain **chn,
- blkid_loff_t off, blkid_loff_t size)
+int blkid_probe_is_wiped(blkid_probe pr, struct blkid_chain **chn, uint64_t off, uint64_t size)
{
if (!pr || !size)
return 0;
* Try to use any area -- if the area has been previously wiped then the
* previous probing result should be ignored (reseted).
*/
-void blkid_probe_use_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
+void blkid_probe_use_wiper(blkid_probe pr, uint64_t off, uint64_t size)
{
struct blkid_chain *chn = NULL;
const struct block_run *br, int fs_le)
{
return blkid_probe_get_buffer(pr,
- ((blkid_loff_t) FS32_TO_CPU(br->allocation_group, fs_le)
+ ((uint64_t) FS32_TO_CPU(br->allocation_group, fs_le)
<< FS32_TO_CPU(bs->ag_shift, fs_le)
<< FS32_TO_CPU(bs->block_shift, fs_le))
- + ((blkid_loff_t) FS16_TO_CPU(br->start, fs_le)
+ + ((uint64_t) FS16_TO_CPU(br->start, fs_le)
<< FS32_TO_CPU(bs->block_shift, fs_le)),
- (blkid_loff_t) FS16_TO_CPU(br->len, fs_le)
+ (uint64_t) FS16_TO_CPU(br->len, fs_le)
<< FS32_TO_CPU(bs->block_shift, fs_le));
}
return NULL;
return blkid_probe_get_buffer(pr,
- ((blkid_loff_t) FS32_TO_CPU(br->allocation_group, fs_le)
+ ((uint64_t) FS32_TO_CPU(br->allocation_group, fs_le)
<< FS32_TO_CPU(bs->ag_shift, fs_le)
<< FS32_TO_CPU(bs->block_shift, fs_le))
- + ((blkid_loff_t) FS16_TO_CPU(br->start, fs_le)
+ + ((uint64_t) FS16_TO_CPU(br->start, fs_le)
<< FS32_TO_CPU(bs->block_shift, fs_le))
+ offset,
length);
#define EXFAT_ENTRY_EOD 0x00
#define EXFAT_ENTRY_LABEL 0x83
-static blkid_loff_t block_to_offset(const struct exfat_super_block *sb,
- blkid_loff_t block)
+static uint64_t block_to_offset(const struct exfat_super_block *sb,
+ uint64_t block)
{
- return (blkid_loff_t) block << sb->block_bits;
+ return block << sb->block_bits;
}
-static blkid_loff_t cluster_to_block(const struct exfat_super_block *sb,
+static uint64_t cluster_to_block(const struct exfat_super_block *sb,
uint32_t cluster)
{
return le32_to_cpu(sb->cluster_block_start) +
- ((blkid_loff_t) (cluster - EXFAT_FIRST_DATA_CLUSTER)
+ ((uint64_t) (cluster - EXFAT_FIRST_DATA_CLUSTER)
<< sb->bpc_bits);
}
-static blkid_loff_t cluster_to_offset(const struct exfat_super_block *sb,
+static uint64_t cluster_to_offset(const struct exfat_super_block *sb,
uint32_t cluster)
{
return block_to_offset(sb, cluster_to_block(sb, cluster));
const struct exfat_super_block *sb, uint32_t cluster)
{
uint32_t *next;
- blkid_loff_t fat_offset;
+ uint64_t fat_offset;
fat_offset = block_to_offset(sb, le32_to_cpu(sb->fat_block_start))
- + (blkid_loff_t) cluster * sizeof(cluster);
+ + (uint64_t) cluster * sizeof(cluster);
next = (uint32_t *) blkid_probe_get_buffer(pr, fat_offset,
sizeof(uint32_t));
if (!next)
const struct exfat_super_block *sb)
{
uint32_t cluster = le32_to_cpu(sb->rootdir_cluster);
- blkid_loff_t offset = cluster_to_offset(sb, cluster);
+ uint64_t offset = cluster_to_offset(sb, cluster);
uint8_t *entry;
for (;;) {
cat_block = be32_to_cpu(extents[0].start_block);
buf = blkid_probe_get_buffer(pr,
- off + ((blkid_loff_t) cat_block * blocksize), 0x2000);
+ off + ((uint64_t) cat_block * blocksize), 0x2000);
if (!buf)
return errno ? -errno : 0;
leaf_off = ((uint64_t) ext_block_start + leaf_block) * blocksize;
buf = blkid_probe_get_buffer(pr,
- (blkid_loff_t) off + leaf_off,
+ (uint64_t) off + leaf_off,
leaf_node_size);
if (!buf)
return errno ? -errno : 0;
#define MD_RESERVED_BYTES 0x10000
#define MD_SB_MAGIC 0xa92b4efc
-static int probe_raid0(blkid_probe pr, blkid_loff_t off)
+static int probe_raid0(blkid_probe pr, uint64_t off)
{
struct mdp0_super_block *mdp0;
union {
for ( ; i < ARRAY_SIZE(idinfos); i++) {
const struct blkid_idinfo *id;
const struct blkid_idmag *mag = NULL;
- blkid_loff_t off = 0;
+ uint64_t off = 0;
chn->idx = i;
id = idinfos[i];
for (b = 0; b < 64; b++) {
vsd = (struct volume_structure_descriptor *)
blkid_probe_get_buffer(pr,
- UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800),
+ UDF_VSD_OFFSET + ((uint64_t) b * 0x800),
sizeof(*vsd));
if (!vsd)
return errno ? -errno : 1;
for (b = 0; b < count; b++) {
vd = (struct volume_descriptor *)
blkid_probe_get_buffer(pr,
- (blkid_loff_t) (loc + b) * bs,
+ (uint64_t) (loc + b) * bs,
sizeof(*vd));
if (!vd)
return errno ? -errno : 1;
for (b = 0; b < count; b++) {
vd = (struct volume_descriptor *)
blkid_probe_get_buffer(pr,
- (blkid_loff_t) (loc + b) * bs,
+ (uint64_t) (loc + b) * bs,
sizeof(*vd));
if (!vd)
return errno ? -errno : 1;
dir = (struct vfat_dir_entry *)
blkid_probe_get_buffer(pr,
offset,
- (blkid_loff_t) entries *
+ (uint64_t) entries *
sizeof(struct vfat_dir_entry));
if (!dir)
return NULL;
if (!dir)
ent = (struct vfat_dir_entry *)
blkid_probe_get_buffer(pr,
- (blkid_loff_t) offset + (i *
+ (uint64_t) offset + (i *
sizeof(struct vfat_dir_entry)),
sizeof(struct vfat_dir_entry));
else
struct fat32_fsinfo *fsinfo;
buf = blkid_probe_get_buffer(pr,
- (blkid_loff_t) fsinfo_sect * sector_size,
+ (uint64_t) fsinfo_sect * sector_size,
sizeof(struct fat32_fsinfo));
if (buf == NULL)
return errno ? -errno : 1;
static int lowprobe_device(blkid_probe pr, const char *devname,
int chain, char *show[], int output,
- blkid_loff_t offset, blkid_loff_t size)
+ uint64_t offset, uint64_t size)
{
const char *data;
const char *name;
for (i = 0; i < numdev; i++) {
err = lowprobe_device(pr, devices[i], lowprobe, show,
output_format,
- (blkid_loff_t) offset,
- (blkid_loff_t) size);
+ (uint64_t) offset,
+ (uint64_t) size);
if (err)
break;
}