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

Commit250c8ee

Browse 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 parentd46a979 commit250c8ee

File tree

7 files changed

+19
-15
lines changed

7 files changed

+19
-15
lines changed

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

Lines 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
uint32buf_state;
32983298

32993299
/*
3300-
* As in DropRelationBuffers, an unlocked precheck should be
3301-
*safe andsaves 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
uint32buf_state;
34263426

34273427
/*
3428-
* As in DropRelationBuffers, an unlocked precheck should be
3429-
*safe andsaves 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 andsaves 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
uint32buf_state;
36463646

36473647
/*
3648-
* As in DropRelationBuffers, an unlocked precheck should be
3649-
*safe andsaves 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 andsaves 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

Lines 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 todrop 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

Lines 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

Lines 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
TimestampTzt=GetCurrentTransactionStopTimestamp();
786+
786787
if (t>tabentry->lastscan)
787788
tabentry->lastscan=t;
788789
}

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

Lines 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

Lines 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
externPgStat_StatDBEntry*pgstat_fetch_stat_dbentry(Oiddboid);
478478

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

‎src/include/utils/pgstat_internal.h

Lines 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
externboolpgstat_subscription_flush_cb(PgStat_EntryRef*entry_ref,boolnowait);
627627
externvoidpgstat_subscription_reset_timestamp_cb(PgStatShared_Common*header,TimestampTzts);
628628

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp