summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorMichael Paquier2025-01-16 23:26:17 +0000
committerMichael Paquier2025-01-16 23:26:17 +0000
commit7b6468cc9523d7d923487d212281af51f7f3dae2 (patch)
treeb334d97be7b07466139fff5d93fc7d80a63f421a /src/include/pgstat.h
parentd4a43b283751b23d32bbfa1ecc2cad2d16e3dde9 (diff)
Rework macro pgstat_is_ioop_tracked_in_bytes()
As written, it was triggering a compilation warning for old versions of clang, as reported by buildfarm members ayu, batfish and demoiselle. Forcing a cast with "unsigned int" should fix the warning. While on it, the macro is moved to pgstat.h, closer to the declaration of IOOp, per suggestion from Tom Lane. Reported-by: Tom Lane Reviewed-by: Bertrand Drouvot, Tom Lane, Nazir Bilal Yavuz Discussion: https://postgr.es/m/1272824.1736961543@sss.pgh.pa.us
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index a878402f502..2d40fe3e70f 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -314,6 +314,10 @@ typedef enum IOOp
#define IOOP_NUM_TYPES (IOOP_WRITE + 1)
+#define pgstat_is_ioop_tracked_in_bytes(io_op) \
+ (((unsigned int) (io_op)) < IOOP_NUM_TYPES && \
+ ((unsigned int) (io_op)) >= IOOP_EXTEND)
+
typedef struct PgStat_BktypeIO
{
uint64 bytes[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];