Define PTR_ALIGN() as a common utility within the entire fio,
but inside FIO_INTERNAL guard since it could be a common name.
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
int temp_stall_ts;
unsigned long done_secs = 0;
int temp_stall_ts;
unsigned long done_secs = 0;
-#define PAGE_ALIGN(buf) \
- (char *) (((uintptr_t) (buf) + page_mask) & ~page_mask)
-
#define JOB_START_TIMEOUT (5 * 1000)
static void sig_int(int sig)
#define JOB_START_TIMEOUT (5 * 1000)
static void sig_int(int sig)
if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
td_ioengine_flagged(td, FIO_RAWIO))
if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
td_ioengine_flagged(td, FIO_RAWIO))
- p = PAGE_ALIGN(td->orig_buffer) + td->o.mem_align;
+ p = PTR_ALIGN(td->orig_buffer, page_mask) + td->o.mem_align;
else
p = td->orig_buffer;
else
p = td->orig_buffer;
extern void free_io_mem(struct thread_data *);
extern void free_threads_shm(void);
extern void free_io_mem(struct thread_data *);
extern void free_threads_shm(void);
+#ifdef FIO_INTERNAL
+#define PTR_ALIGN(ptr, mask) \
+ (char *) (((uintptr_t) (ptr) + (mask)) & ~(mask))
+#endif
+
/*
* Reset stats after ramp time completes
*/
/*
* Reset stats after ramp time completes
*/
#include <inttypes.h>
#include "memalign.h"
#include <inttypes.h>
#include "memalign.h"
struct align_footer {
unsigned int offset;
};
struct align_footer {
unsigned int offset;
};
-#define PTR_ALIGN(ptr, mask) \
- (char *) (((uintptr_t) ((ptr) + (mask)) & ~(mask)))
-
void *fio_memalign(size_t alignment, size_t size)
{
struct align_footer *f;
void *fio_memalign(size_t alignment, size_t size)
{
struct align_footer *f;
#include <limits.h>
#include <fcntl.h>
#include <limits.h>
#include <fcntl.h>
#include "mutex.h"
#include "arch/arch.h"
#include "os/os.h"
#include "mutex.h"
#include "arch/arch.h"
#include "os/os.h"
uintptr_t ptr;
ptr = (uintptr_t) hdr + hdr->size - sizeof(unsigned int);
uintptr_t ptr;
ptr = (uintptr_t) hdr + hdr->size - sizeof(unsigned int);
- ptr = (ptr + int_mask) & ~int_mask;
+ ptr = (uintptr_t) PTR_ALIGN(ptr, int_mask);