Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7b6468c

Browse files
committed
Rework macro pgstat_is_ioop_tracked_in_bytes()
As written, it was triggering a compilation warning for old versions ofclang, 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 declarationof IOOp, per suggestion from Tom Lane.Reported-by: Tom LaneReviewed-by: Bertrand Drouvot, Tom Lane, Nazir Bilal YavuzDiscussion:https://postgr.es/m/1272824.1736961543@sss.pgh.pa.us
1 parentd4a43b2 commit7b6468c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

‎src/backend/utils/activity/pgstat_io.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@
2323
staticPgStat_PendingIOPendingIOStats;
2424
staticboolhave_iostats= false;
2525

26-
/*
27-
* Check if an IOOp is tracked in bytes. This relies on the ordering of IOOp
28-
* defined in pgstat.h, so make sure to update this check when changing its
29-
* elements.
30-
*/
31-
#definepgstat_is_ioop_tracked_in_bytes(io_op) \
32-
((io_op) < IOOP_NUM_TYPES && (io_op) >= IOOP_EXTEND)
33-
3426
/*
3527
* Check that stats have not been counted for any combination of IOObject,
3628
* IOContext, and IOOp which are not tracked for the passed-in BackendType. If

‎src/include/pgstat.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ typedef enum IOOp
314314

315315
#defineIOOP_NUM_TYPES (IOOP_WRITE + 1)
316316

317+
#definepgstat_is_ioop_tracked_in_bytes(io_op) \
318+
(((unsigned int) (io_op)) < IOOP_NUM_TYPES && \
319+
((unsigned int) (io_op)) >= IOOP_EXTEND)
320+
317321
typedefstructPgStat_BktypeIO
318322
{
319323
uint64bytes[IOOBJECT_NUM_TYPES][IOCONTEXT_NUM_TYPES][IOOP_NUM_TYPES];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp