From f8564c2a3c13543ae3fcb0802474ec69ea6a6787 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Wed, 17 Apr 2024 15:37:24 +0000 Subject: [PATCH] fio: use thread flag count for ioengine flag shift We store the thread and ioengine flags in the same unsigned long long with the ioengine flags bit shifted by the number of thread flags. In the macros related to the bit shift, just use the count of the number of thread flags. This way any time we change the number of thread flags the required shift will be automatically updated. Signed-off-by: Vincent Fu --- fio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fio.h b/fio.h index fc3e3ece..7d9927a0 100644 --- a/fio.h +++ b/fio.h @@ -706,8 +706,8 @@ enum { TD_NR, }; -#define TD_ENG_FLAG_SHIFT 18 -#define TD_ENG_FLAG_MASK ((1ULL << 18) - 1) +#define TD_ENG_FLAG_SHIFT (__TD_F_LAST) +#define TD_ENG_FLAG_MASK ((1ULL << (__TD_F_LAST)) - 1) static inline void td_set_ioengine_flags(struct thread_data *td) { -- 2.25.1