From: Bart Van Assche Date: Sun, 5 Jan 2020 19:10:30 +0000 (-0800) Subject: Change off64_t into uint64_t X-Git-Tag: fio-3.18~18^2~5 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7e2a317e68abf1ca9946151ea61b6f1fc95a4686 Change off64_t into uint64_t off64_t is Linux specific while uint64_t is defined by a C standard. This change makes fio easier to port. Signed-off-by: Bart Van Assche --- diff --git a/helpers.c b/helpers.c index a0ee3704..ab9d706d 100644 --- a/helpers.c +++ b/helpers.c @@ -18,7 +18,8 @@ int posix_fallocate(int fd, off_t offset, off_t len) #endif #ifndef CONFIG_SYNC_FILE_RANGE -int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags) +int sync_file_range(int fd, uint64_t offset, uint64_t nbytes, + unsigned int flags) { errno = ENOSYS; return -1; diff --git a/helpers.h b/helpers.h index a0b32858..4ec0f052 100644 --- a/helpers.h +++ b/helpers.h @@ -7,8 +7,10 @@ extern int fallocate(int fd, int mode, off_t offset, off_t len); extern int posix_fallocate(int fd, off_t offset, off_t len); -extern int sync_file_range(int fd, off64_t offset, off64_t nbytes, +#ifndef CONFIG_SYNC_FILE_RANGE +extern int sync_file_range(int fd, uint64_t offset, uint64_t nbytes, unsigned int flags); +#endif extern int posix_fadvise(int fd, off_t offset, off_t len, int advice); #endif /* FIO_HELPERS_H_ */ diff --git a/io_u.c b/io_u.c index 4a0c725a..03f5c21f 100644 --- a/io_u.c +++ b/io_u.c @@ -2182,7 +2182,7 @@ void io_u_fill_buffer(struct thread_data *td, struct io_u *io_u, static int do_sync_file_range(const struct thread_data *td, struct fio_file *f) { - off64_t offset, nbytes; + uint64_t offset, nbytes; offset = f->first_write; nbytes = f->last_write - f->first_write; diff --git a/os/os-dragonfly.h b/os/os-dragonfly.h index 3c460ae2..44bfcd5d 100644 --- a/os/os-dragonfly.h +++ b/os/os-dragonfly.h @@ -47,7 +47,6 @@ /* This is supposed to equal (sizeof(cpumask_t)*8) */ #define FIO_MAX_CPUS SMP_MAXCPU -typedef off_t off64_t; typedef cpumask_t os_cpu_mask_t; /* diff --git a/os/os-freebsd.h b/os/os-freebsd.h index 789da178..b3addf98 100644 --- a/os/os-freebsd.h +++ b/os/os-freebsd.h @@ -30,8 +30,6 @@ #define fio_swap32(x) bswap32(x) #define fio_swap64(x) bswap64(x) -typedef off_t off64_t; - typedef cpuset_t os_cpu_mask_t; #define fio_cpu_clear(mask, cpu) (void) CPU_CLR((cpu), (mask)) diff --git a/os/os-mac.h b/os/os-mac.h index 0d97f6b9..2852ac67 100644 --- a/os/os-mac.h +++ b/os/os-mac.h @@ -33,8 +33,6 @@ */ #define FIO_MAX_JOBS 128 -typedef off_t off64_t; - #ifndef CONFIG_CLOCKID_T typedef unsigned int clockid_t; #endif diff --git a/os/os-netbsd.h b/os/os-netbsd.h index 88fb3ef1..abc1d3cb 100644 --- a/os/os-netbsd.h +++ b/os/os-netbsd.h @@ -35,8 +35,6 @@ #define fio_swap32(x) bswap32(x) #define fio_swap64(x) bswap64(x) -typedef off_t off64_t; - static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { struct disklabel dl; diff --git a/os/os-openbsd.h b/os/os-openbsd.h index 43a649d4..085a6f2b 100644 --- a/os/os-openbsd.h +++ b/os/os-openbsd.h @@ -35,8 +35,6 @@ #define fio_swap32(x) bswap32(x) #define fio_swap64(x) bswap64(x) -typedef off_t off64_t; - static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { struct disklabel dl; diff --git a/os/windows/posix.h b/os/windows/posix.h index 85640a21..02a9075b 100644 --- a/os/windows/posix.h +++ b/os/windows/posix.h @@ -1,7 +1,6 @@ #ifndef FIO_WINDOWS_POSIX_H #define FIO_WINDOWS_POSIX_H -typedef off_t off64_t; typedef int clockid_t; extern int clock_gettime(clockid_t clock_id, struct timespec *tp);