}
} else {
char *lb = memalign(wbuf_align, XFS_MAX_SECTORSIZE);
- off64_t off;
+ off_t off;
ssize_t len;
/* ensure device files are sufficiently large */
struct dioattr dio;
static xfs_swapext_t sx;
struct xfs_flock64 space;
- off64_t cnt, pos;
+ off_t cnt, pos;
void *fbuf = NULL;
int ct, wc, wc_b4;
char ffname[SMBUFSZ];
#define FLG_BSW 0000010 /* Not on begin of stripe width */
#define FLG_ESW 0000001 /* Not on end of stripe width */
int agno;
- off64_t agoff, bbperag;
+ off_t agoff, bbperag;
int foff_w, boff_w, aoff_w, tot_w, agno_w;
char rbuf[32], bbuf[32], abuf[32];
int sunit, swidth;
if (is_rt)
sunit = swidth = bbperag = 0;
else {
- bbperag = (off64_t)fsgeo.agblocks *
- (off64_t)fsgeo.blocksize / BBSIZE;
+ bbperag = (off_t)fsgeo.agblocks *
+ (off_t)fsgeo.blocksize / BBSIZE;
sunit = (fsgeo.sunit * fsgeo.blocksize) / BBSIZE;
swidth = (fsgeo.swidth * fsgeo.blocksize) / BBSIZE;
}
return 0;
}
-static off64_t
+static off_t
copy_src_filesize(int fd)
{
struct stat st;
}
if (!len_specified) {
- off64_t sz;
+ off_t sz;
sz = copy_src_filesize(fd);
if (sz < 0 || (unsigned long long)sz > SIZE_MAX) {
set_cowextsize(const char *path, int fd, long extsz)
{
struct fsxattr fsx;
- struct stat64 stat;
+ struct stat stat;
- if (fstat64(fd, &stat) < 0) {
- perror("fstat64");
+ if (fstat(fd, &stat) < 0) {
+ perror("fstat");
exitcode = 1;
return 0;
}
int argc,
char **argv)
{
- off64_t offset = 0, length = 0;
+ off_t offset = 0, length = 0;
int c, range = 0, advise = POSIX_FADV_NORMAL;
while ((c = getopt(argc, argv, "dnrsw")) != EOF) {
int tot_w = 5; /* 5 since its just one number */
int flg_w = 5;
__u64 last_logical = 0; /* last extent offset handled */
- off64_t start_offset = 0; /* mapping start */
- off64_t length = -1LL; /* mapping length */
- off64_t range_end = -1LL; /* mapping end*/
+ off_t start_offset = 0; /* mapping start */
+ off_t length = -1LL; /* mapping length */
+ off_t range_end = -1LL; /* mapping end*/
size_t fsblocksize, fssectsize;
struct stat st;
unsigned long long i;
struct fsmap *p;
int agno;
- off64_t agoff, bperag;
+ off_t agoff, bperag;
int foff_w, boff_w, aoff_w, tot_w, agno_w, own_w;
int nr_w, dev_w;
char rbuf[40], bbuf[40], abuf[40], obuf[40];
dev_w = 3;
nr_w = 4;
tot_w = MINTOT_WIDTH;
- bperag = (off64_t)fsgeo->agblocks *
- (off64_t)fsgeo->blocksize;
+ bperag = (off_t)fsgeo->agblocks *
+ (off_t)fsgeo->blocksize;
sunit = (fsgeo->sunit * fsgeo->blocksize);
swidth = (fsgeo->swidth * fsgeo->blocksize);
typedef struct mmap_region {
void *addr; /* address of start of mapping */
size_t length; /* length of mapping */
- off64_t offset; /* start offset into backing file */
+ off_t offset; /* start offset into backing file */
int prot; /* protection mode of the mapping */
int flags; /* MAP_* flags passed to mmap() */
char *name; /* name of backing file */
extern int mapcount; /* #entries in the mapping table */
extern mmap_region_t *mapping; /* active mapping table entry */
extern int maplist_f(void);
-extern void *check_mapping_range(mmap_region_t *, off64_t, size_t, int);
+extern void *check_mapping_range(mmap_region_t *, off_t, size_t, int);
/*
* Various xfs_io helper routines/globals
*/
-extern off64_t filesize(void);
+extern off_t filesize(void);
extern int openfile(char *, struct xfs_fsop_geom *, int, mode_t,
struct fs_path *);
extern int addfile(char *, int , struct xfs_fsop_geom *, int,
extern int vectors;
extern struct iovec *iov;
extern int alloc_buffer(size_t, int, unsigned int);
-extern int read_buffer(int, off64_t, long long, long long *,
+extern int read_buffer(int, off_t, long long, long long *,
int, int);
-extern void dump_buffer(off64_t, ssize_t);
+extern void dump_buffer(off_t, ssize_t);
extern void attr_init(void);
extern void bmap_init(void);
int argc,
char **argv)
{
- off64_t offset, llength;
+ off_t offset, llength;
size_t length;
void *start;
int advise = MADV_NORMAL, c;
int argc,
char **argv)
{
- off64_t offset, llength;
+ off_t offset, llength;
size_t length;
size_t blocksize, sectsize;
void *start;
void *
check_mapping_range(
mmap_region_t *map,
- off64_t offset,
+ off_t offset,
size_t length,
int pagealign)
{
- off64_t relative;
+ off_t relative;
if (offset < mapping->offset) {
printf(_("offset (%lld) is before start of mapping (%lld)\n"),
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
+
ssize_t length = 0, length2 = 0;
void *address = NULL;
char *filename;
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
ssize_t length;
void *start;
int c, flags = 0;
int argc,
char **argv)
{
- off64_t offset, tmp, dumpoffset, printoffset;
+ off_t offset, tmp, dumpoffset, printoffset;
ssize_t length;
size_t dumplen, cnt = 0;
char *bp;
int argc,
char **argv)
{
- off64_t offset, tmp;
+ off_t offset, tmp;
ssize_t length;
void *start;
char *sp;
static void
__dump_buffer(
void *buf,
- off64_t offset,
+ off_t offset,
ssize_t len)
{
int i, j;
void
dump_buffer(
- off64_t offset,
+ off_t offset,
ssize_t len)
{
int i, l;
static ssize_t
do_preadv(
int fd,
- off64_t offset,
+ off_t offset,
long long count)
{
int vecs = 0;
static ssize_t
do_pread(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
size_t buffer_size)
{
static int
read_random(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
unsigned int seed,
int eof)
{
- off64_t end, off, range;
+ off_t end, off, range;
ssize_t bytes;
int ops = 0;
static int
read_backward(
int fd,
- off64_t *offset,
+ off_t *offset,
long long *count,
long long *total,
int eof)
{
- off64_t end, off = *offset;
+ off_t end, off = *offset;
ssize_t bytes = 0, bytes_requested;
long long cnt = *count;
int ops = 0;
static int
read_forward(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
int verbose,
int
read_buffer(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
int verbose,
char **argv)
{
size_t bsize;
- off64_t offset;
+ off_t offset;
unsigned int zeed = 0;
long long count, total, tmp;
size_t fsblocksize, fssectsize;
static ssize_t
do_pwritev(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
int pwritev2_flags)
{
static ssize_t
do_pwrite(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
size_t buffer_size,
int pwritev2_flags)
static int
write_random(
- off64_t offset,
+ off_t offset,
long long count,
unsigned int seed,
long long *total,
int pwritev2_flags)
{
- off64_t off, range;
+ off_t off, range;
ssize_t bytes;
int ops = 0;
static int
write_backward(
- off64_t offset,
+ off_t offset,
long long *count,
long long *total,
int pwritev2_flags)
{
- off64_t end, off = offset;
+ off_t end, off = offset;
ssize_t bytes = 0, bytes_requested;
long long cnt = *count;
int ops = 0;
static int
write_buffer(
- off64_t offset,
+ off_t offset,
long long count,
size_t bs,
int fd,
- off64_t skip,
+ off_t skip,
long long *total,
int pwritev2_flags)
{
static int
write_once(
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
int pwritev2_flags)
char **argv)
{
size_t bsize;
- off64_t offset, skip = 0;
+ off_t offset, skip = 0;
long long count, total, tmp;
unsigned int zeed = 0, seed = 0xcdcdcdcd;
size_t fsblocksize, fssectsize;
int argc,
char **argv)
{
- off64_t soffset, doffset;
+ off_t soffset, doffset;
long long count, total;
char *infile;
int condensed, quiet_flag;
int argc,
char **argv)
{
- off64_t soffset, doffset;
+ off_t soffset, doffset;
long long count = 0, total;
char *infile = NULL;
int condensed, quiet_flag;
seek_output(
int startflag,
char *type,
- off64_t start,
- off64_t offset)
+ off_t start,
+ off_t offset)
{
if (offset == -1) {
if (errno == ENXIO) {
int argc,
char **argv)
{
- off64_t offset, start;
+ off_t offset, start;
size_t fsblocksize, fssectsize;
int c;
int current; /* specify data or hole */
static int
send_buffer(
- off64_t offset,
+ off_t offset,
size_t count,
int fd,
long long *total)
{
- off64_t off = offset;
+ off_t off = offset;
ssize_t bytes, bytes_remaining = count;
int ops = 0;
int argc,
char **argv)
{
- off64_t offset = 0;
+ off_t offset = 0;
long long count, total;
size_t blocksize, sectsize;
struct timeval t1, t2;
static cmdinfo_t statfs_cmd;
static cmdinfo_t statx_cmd;
-off64_t
+off_t
filesize(void)
{
struct stat st;
int argc,
char **argv)
{
- off64_t offset = 0, length = 0;
+ off_t offset = 0, length = 0;
int c, sync_mode = 0;
size_t blocksize, sectsize;
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
size_t blocksize, sectsize;
init_cvtnum(&blocksize, §size);
static int
-__read_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__read_buf(int fd, void *buf, int len, off_t offset, int flags)
{
int sts;
buf = bp->b_addr;
for (i = 0; i < bp->b_nmaps; i++) {
- off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
+ off_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
int len = BBTOB(bp->b_maps[i].bm_len);
error = __read_buf(fd, buf, len, offset, flags);
}
static int
-__write_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__write_buf(int fd, void *buf, int len, off_t offset, int flags)
{
int sts;
void *buf = bp->b_addr;
for (i = 0; i < bp->b_nmaps; i++) {
- off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
+ off_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
int len = BBTOB(bp->b_maps[i].bm_len);
bp->b_error = __write_buf(fd, buf, len, offset,
} else {
/* ensure device is sufficiently large enough */
char lb[XFS_MAX_SECTORSIZE] = { 0 };
- off64_t off;
+ off_t off;
off = nr_blocks * blocksize - sizeof(lb);
if (pwrite(dev_fd, lb, sizeof(lb), off) < 0)
{
struct xfs_buf *bplist[MAX_BUFS];
unsigned int num;
- off64_t first_off, last_off, next_off;
+ off_t first_off, last_off, next_off;
int len, size;
int i;
int inode_bufs;
struct scrub_ctx *ctx = (struct scrub_ctx *)wq->wq_ctx;
struct scan_blocks *sbx = arg;
struct fsmap keys[2];
- off64_t bperag;
+ off_t bperag;
int ret;
- bperag = (off64_t)ctx->mnt.fsgeom.agblocks *
- (off64_t)ctx->mnt.fsgeom.blocksize;
+ bperag = (off_t)ctx->mnt.fsgeom.agblocks *
+ (off_t)ctx->mnt.fsgeom.blocksize;
memset(keys, 0, sizeof(struct fsmap) * 2);
keys->fmr_device = ctx->fsinfo.fs_datadev;
addtohist(
xfs_agnumber_t agno,
xfs_agblock_t agbno,
- off64_t len)
+ off_t len)
{
long i;
struct fsmap *l, *h;
struct fsmap *p;
struct xfs_fd *xfd = &file->xfd;
- off64_t aglen;
+ off_t aglen;
xfs_agblock_t agbno;
unsigned long long freeblks = 0;
unsigned long long freeexts = 0;
struct xfs_fd *xfd = &file->xfd;
struct xfs_fsop_geom *fsgeom = &xfd->fsgeom;
xfs_agnumber_t agno = 0;
- off64_t offset = 0;
+ off_t offset = 0;
ssize_t length = 0;
ssize_t minlen = 0;
int aflag = 0;