From: Jens Axboe Date: Tue, 19 Feb 2008 17:20:14 +0000 (+0100) Subject: Fix TO_MAP_BLOCK() taking offset into account twice X-Git-Tag: fio-1.19~4 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c299e0375a660e2a5fca966233417a7034073175;ds=sidebyside Fix TO_MAP_BLOCK() taking offset into account twice Signed-off-by: Jens Axboe --- diff --git a/fio.h b/fio.h index 9c900245..d8c65950 100644 --- a/fio.h +++ b/fio.h @@ -683,7 +683,7 @@ static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u) } #define BLOCKS_PER_MAP (8 * sizeof(long)) -#define TO_MAP_BLOCK(td, f, b) ((b) - ((f)->file_offset / (unsigned long long) (td)->o.rw_min_bs)) +#define TO_MAP_BLOCK(td, f, b) ((b) / ((unsigned long long) (td)->o.rw_min_bs)) #define RAND_MAP_IDX(td, f, b) (TO_MAP_BLOCK(td, f, b) / BLOCKS_PER_MAP) #define RAND_MAP_BIT(td, f, b) (TO_MAP_BLOCK(td, f, b) & (BLOCKS_PER_MAP - 1))