Skip to content

Navigation Menu

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

Appearance settings

Commit 250c8ee

Browse filesBrowse files
committed
Manual cleanup and pgindent of pgstat and bufmgr related code
This is in preparation for commiting a larger patch series in the area. Discussion: https://postgr.es/m/CAAKRu_bHwGEbzNxxy+MQDkrsgog6aO6iUvajJ4d6PD98gFU7+w@mail.gmail.com
1 parent d46a979 commit 250c8ee
Copy full SHA for 250c8ee

File tree

7 files changed

+19
-15
lines changed
Filter options

7 files changed

+19
-15
lines changed

‎src/backend/storage/buffer/bufmgr.c

Copy file name to clipboardExpand all lines: src/backend/storage/buffer/bufmgr.c
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ PrefetchSharedBuffer(SMgrRelation smgr_reln,
516516

517517
/* create a tag so we can lookup the buffer */
518518
InitBufferTag(&newTag, &smgr_reln->smgr_rlocator.locator,
519-
forkNum, blockNum);
519+
forkNum, blockNum);
520520

521521
/* determine its hash code and partition lock ID */
522522
newHash = BufTableHashCode(&newTag);
@@ -3297,8 +3297,8 @@ DropRelationsAllBuffers(SMgrRelation *smgr_reln, int nlocators)
32973297
uint32 buf_state;
32983298

32993299
/*
3300-
* As in DropRelationBuffers, an unlocked precheck should be
3301-
* safe and saves some cycles.
3300+
* As in DropRelationBuffers, an unlocked precheck should be safe and
3301+
* saves some cycles.
33023302
*/
33033303

33043304
if (!use_bsearch)
@@ -3425,8 +3425,8 @@ DropDatabaseBuffers(Oid dbid)
34253425
uint32 buf_state;
34263426

34273427
/*
3428-
* As in DropRelationBuffers, an unlocked precheck should be
3429-
* safe and saves some cycles.
3428+
* As in DropRelationBuffers, an unlocked precheck should be safe and
3429+
* saves some cycles.
34303430
*/
34313431
if (bufHdr->tag.dbOid != dbid)
34323432
continue;
@@ -3572,8 +3572,8 @@ FlushRelationBuffers(Relation rel)
35723572
bufHdr = GetBufferDescriptor(i);
35733573

35743574
/*
3575-
* As in DropRelationBuffers, an unlocked precheck should be
3576-
* safe and saves some cycles.
3575+
* As in DropRelationBuffers, an unlocked precheck should be safe and
3576+
* saves some cycles.
35773577
*/
35783578
if (!BufTagMatchesRelFileLocator(&bufHdr->tag, &rel->rd_locator))
35793579
continue;
@@ -3645,8 +3645,8 @@ FlushRelationsAllBuffers(SMgrRelation *smgrs, int nrels)
36453645
uint32 buf_state;
36463646

36473647
/*
3648-
* As in DropRelationBuffers, an unlocked precheck should be
3649-
* safe and saves some cycles.
3648+
* As in DropRelationBuffers, an unlocked precheck should be safe and
3649+
* saves some cycles.
36503650
*/
36513651

36523652
if (!use_bsearch)
@@ -3880,8 +3880,8 @@ FlushDatabaseBuffers(Oid dbid)
38803880
bufHdr = GetBufferDescriptor(i);
38813881

38823882
/*
3883-
* As in DropRelationBuffers, an unlocked precheck should be
3884-
* safe and saves some cycles.
3883+
* As in DropRelationBuffers, an unlocked precheck should be safe and
3884+
* saves some cycles.
38853885
*/
38863886
if (bufHdr->tag.dbOid != dbid)
38873887
continue;

‎src/backend/storage/buffer/localbuf.c

Copy file name to clipboardExpand all lines: src/backend/storage/buffer/localbuf.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ AtProcExit_LocalBuffers(void)
610610
{
611611
/*
612612
* We shouldn't be holding any remaining pins; if we are, and assertions
613-
* aren't enabled, we'll fail later in DropRelationBuffers while
614-
* trying to drop the temp rels.
613+
* aren't enabled, we'll fail later in DropRelationBuffers while trying to
614+
* drop the temp rels.
615615
*/
616616
CheckForLocalBufferLeaks();
617617
}

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

Copy file name to clipboardExpand all lines: src/backend/utils/activity/pgstat.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ pgstat_discard_stats(void)
426426
ereport(DEBUG2,
427427
(errcode_for_file_access(),
428428
errmsg_internal("unlinked permanent statistics file \"%s\"",
429-
PGSTAT_STAT_PERMANENT_FILENAME)));
429+
PGSTAT_STAT_PERMANENT_FILENAME)));
430430
}
431431

432432
/*
@@ -986,6 +986,7 @@ pgstat_build_snapshot(void)
986986

987987
entry->data = MemoryContextAlloc(pgStatLocal.snapshot.context,
988988
kind_info->shared_size);
989+
989990
/*
990991
* Acquire the LWLock directly instead of using
991992
* pg_stat_lock_entry_shared() which requires a reference.

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

Copy file name to clipboardExpand all lines: src/backend/utils/activity/pgstat_relation.c
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ pgstat_relation_flush_cb(PgStat_EntryRef *entry_ref, bool nowait)
783783
if (lstats->t_counts.t_numscans)
784784
{
785785
TimestampTz t = GetCurrentTransactionStopTimestamp();
786+
786787
if (t > tabentry->lastscan)
787788
tabentry->lastscan = t;
788789
}

‎src/backend/utils/adt/pgstatfuncs.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/pgstatfuncs.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ pg_stat_get_backend_client_addr(PG_FUNCTION_ARGS)
906906
clean_ipv6_addr(beentry->st_clientaddr.addr.ss_family, remote_host);
907907

908908
PG_RETURN_DATUM(DirectFunctionCall1(inet_in,
909-
CStringGetDatum(remote_host)));
909+
CStringGetDatum(remote_host)));
910910
}
911911

912912
Datum

‎src/include/pgstat.h

Copy file name to clipboardExpand all lines: src/include/pgstat.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ extern void pgstat_report_connect(Oid dboid);
476476

477477
extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dboid);
478478

479+
479480
/*
480481
* Functions in pgstat_function.c
481482
*/

‎src/include/utils/pgstat_internal.h

Copy file name to clipboardExpand all lines: src/include/utils/pgstat_internal.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ extern void pgstat_wal_snapshot_cb(void);
626626
extern bool pgstat_subscription_flush_cb(PgStat_EntryRef *entry_ref, bool nowait);
627627
extern void pgstat_subscription_reset_timestamp_cb(PgStatShared_Common *header, TimestampTz ts);
628628

629+
629630
/*
630631
* Functions in pgstat_xact.c
631632
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.