Skip to content

Commit e728adb

Browse files
committed
pgindent-ing xtm patched sources
1 parent f93212b commit e728adb

File tree

8 files changed

+78
-49
lines changed

8 files changed

+78
-49
lines changed

src/backend/access/transam/clog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void set_status_by_pages(int nsubxids, TransactionId *subxids,
9595

9696
void
9797
TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
98-
TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
98+
TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
9999
{
100100
return TM->SetTransactionStatus(xid, nsubxids, subxids, status, lsn);
101101
}
@@ -352,10 +352,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i
352352
* Current state change should be from 0 or subcommitted to target state
353353
* or we should already be there when replaying changes during recovery.
354354
*/
355-
// Assert(curval == 0 ||
356-
// (curval == TRANSACTION_STATUS_SUB_COMMITTED &&
357-
// status != TRANSACTION_STATUS_IN_PROGRESS) ||
358-
// curval == status);
355+
/* Assert(curval == 0 || */
356+
/* (curval == TRANSACTION_STATUS_SUB_COMMITTED && */
357+
/* status != TRANSACTION_STATUS_IN_PROGRESS) || */
358+
/* curval == status); */
359359

360360
/* note this assumes exclusive access to the clog page */
361361
byteval = *byteptr;

src/backend/access/transam/xact.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,9 +1543,9 @@ RecordTransactionAbort(bool isSubXact)
15431543
/*
15441544
* Check that we haven't aborted halfway through RecordTransactionCommit.
15451545
*/
1546-
// if (TransactionIdDidCommit(xid))
1547-
// elog(PANIC, "cannot abort transaction %u, it was already committed",
1548-
// xid);
1546+
/* if (TransactionIdDidCommit(xid)) */
1547+
/* elog(PANIC, "cannot abort transaction %u, it was already committed", */
1548+
/* xid); */
15491549

15501550
/* Fetch the data we need for the abort record */
15511551
nrels = smgrGetPendingDeletes(false, &rels);

src/backend/access/transam/xtm.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@
1818
#include "access/transam.h"
1919
#include "access/xtm.h"
2020

21-
TransactionId PgGetGlobalTransactionId(void)
21+
TransactionId
22+
PgGetGlobalTransactionId(void)
2223
{
2324
return InvalidTransactionId;
2425
}
2526

26-
bool PgDetectGlobalDeadLock(PGPROC* proc)
27+
bool
28+
PgDetectGlobalDeadLock(PGPROC *proc)
2729
{
2830
return false;
2931
}
3032

31-
char const* PgGetTransactionManagerName(void)
33+
char const *
34+
PgGetTransactionManagerName(void)
3235
{
3336
return "postgres";
3437
}
@@ -46,9 +49,10 @@ TransactionManager PgTM = {
4649
PgGetTransactionManagerName
4750
};
4851

49-
TransactionManager* TM = &PgTM;
52+
TransactionManager *TM = &PgTM;
5053

51-
TransactionManager* GetTransactionManager(void)
54+
TransactionManager *
55+
GetTransactionManager(void)
5256
{
5357
return TM;
5458
}

src/include/access/clog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef int XidStatus;
2727
#define TRANSACTION_STATUS_COMMITTED 0x01
2828
#define TRANSACTION_STATUS_ABORTED 0x02
2929
#define TRANSACTION_STATUS_SUB_COMMITTED 0x03
30-
#define TRANSACTION_STATUS_UNKNOWN 0x03
30+
#define TRANSACTION_STATUS_UNKNOWN 0x03
3131

3232

3333
extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,

src/include/access/twophase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ extern void CheckPointTwoPhase(XLogRecPtr redo_horizon);
5656

5757
extern void FinishPreparedTransaction(const char *gid, bool isCommit);
5858

59-
extern const char* GetLockedGlobalTransactionId(void);
59+
extern const char *GetLockedGlobalTransactionId(void);
6060

6161
#endif /* TWOPHASE_H */

src/include/access/xact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ typedef enum
103103
typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid,
104104
SubTransactionId parentSubid, void *arg);
105105

106-
void CallXactCallbacks(XactEvent event);
106+
void CallXactCallbacks(XactEvent event);
107107

108108

109109
/* ----------------

src/include/access/xtm.h

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,72 @@
1818

1919
typedef struct
2020
{
21-
/* Get current transaction status (encapsulation of TransactionIdGetStatus in clog.c) */
22-
XidStatus (*GetTransactionStatus)(TransactionId xid, XLogRecPtr *lsn);
23-
24-
/* Set current transaction status (encapsulation of TransactionIdSetTreeStatus in clog.c) */
25-
void (*SetTransactionStatus)(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
26-
27-
/* Get current transaction snaphot (encapsulation of GetSnapshotData in procarray.c) */
28-
Snapshot (*GetSnapshot)(Snapshot snapshot);
29-
30-
/* Assign new Xid to transaction (encapsulation of GetNewTransactionId in varsup.c) */
31-
TransactionId (*GetNewTransactionId)(bool isSubXact);
32-
33-
/* Get oldest transaction Xid that was running when any current transaction was started (encapsulation of GetOldestXmin in procarray.c) */
34-
TransactionId (*GetOldestXmin)(Relation rel, bool ignoreVacuum);
35-
36-
/* Check if current transaction is not yet completed (encapsulation of TransactionIdIsInProgress in procarray.c) */
37-
bool (*IsInProgress)(TransactionId xid);
38-
39-
/* Get global transaction XID: returns XID of current transaction if it is global, InvalidTransactionId otherwise */
40-
TransactionId (*GetGlobalTransactionId)(void);
41-
42-
/* Is the given XID still-in-progress according to the snapshot (encapsulation of XidInMVCCSnapshot in tqual.c) */
43-
bool (*IsInSnapshot)(TransactionId xid, Snapshot snapshot);
21+
/*
22+
* Get current transaction status (encapsulation of TransactionIdGetStatus
23+
* in clog.c)
24+
*/
25+
XidStatus (*GetTransactionStatus) (TransactionId xid, XLogRecPtr *lsn);
26+
27+
/*
28+
* Set current transaction status (encapsulation of
29+
* TransactionIdSetTreeStatus in clog.c)
30+
*/
31+
void (*SetTransactionStatus) (TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
32+
33+
/*
34+
* Get current transaction snaphot (encapsulation of GetSnapshotData in
35+
* procarray.c)
36+
*/
37+
Snapshot (*GetSnapshot) (Snapshot snapshot);
38+
39+
/*
40+
* Assign new Xid to transaction (encapsulation of GetNewTransactionId in
41+
* varsup.c)
42+
*/
43+
TransactionId (*GetNewTransactionId) (bool isSubXact);
44+
45+
/*
46+
* Get oldest transaction Xid that was running when any current
47+
* transaction was started (encapsulation of GetOldestXmin in procarray.c)
48+
*/
49+
TransactionId (*GetOldestXmin) (Relation rel, bool ignoreVacuum);
50+
51+
/*
52+
* Check if current transaction is not yet completed (encapsulation of
53+
* TransactionIdIsInProgress in procarray.c)
54+
*/
55+
bool (*IsInProgress) (TransactionId xid);
56+
57+
/*
58+
* Get global transaction XID: returns XID of current transaction if it is
59+
* global, InvalidTransactionId otherwise
60+
*/
61+
TransactionId (*GetGlobalTransactionId) (void);
62+
63+
/*
64+
* Is the given XID still-in-progress according to the snapshot
65+
* (encapsulation of XidInMVCCSnapshot in tqual.c)
66+
*/
67+
bool (*IsInSnapshot) (TransactionId xid, Snapshot snapshot);
4468

4569
/* Detect distributed deadlock */
46-
bool (*DetectGlobalDeadLock)(PGPROC* proc);
70+
bool (*DetectGlobalDeadLock) (PGPROC *proc);
4771

48-
char const* (*GetName)(void);
49-
} TransactionManager;
72+
char const *(*GetName) (void);
73+
} TransactionManager;
5074

5175
/* Get pointer to transaction manager: actually returns content of TM variable */
52-
TransactionManager* GetTransactionManager(void);
76+
TransactionManager *GetTransactionManager(void);
5377

54-
extern TransactionManager* TM; /* Current transaction manager (can be substituted by extensions) */
78+
extern TransactionManager *TM; /* Current transaction manager (can be
79+
* substituted by extensions) */
5580
extern TransactionManager PgTM; /* Standard PostgreSQL transaction manager */
5681

5782
/* Standard PostgreSQL function implementing TM interface */
5883
extern bool PgXidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
5984

6085
extern void PgTransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
61-
TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
86+
TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
6287
extern XidStatus PgTransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn);
6388

6489
extern Snapshot PgGetSnapshotData(Snapshot snapshot);
@@ -71,8 +96,8 @@ extern TransactionId PgGetGlobalTransactionId(void);
7196

7297
extern TransactionId PgGetNewTransactionId(bool isSubXact);
7398

74-
extern bool PgDetectGlobalDeadLock(PGPROC* proc);
99+
extern bool PgDetectGlobalDeadLock(PGPROC *proc);
75100

76-
extern char const* PgGetTransactionManagerName(void);
101+
extern char const *PgGetTransactionManagerName(void);
77102

78103
#endif

src/include/storage/lock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,9 @@ extern void DumpLocks(PGPROC *proc);
548548
extern void DumpAllLocks(void);
549549
#endif
550550

551-
typedef void(*LockIterator)(PROCLOCK* lock, void* arg);
551+
typedef void (*LockIterator) (PROCLOCK *lock, void *arg);
552552

553-
extern void EnumerateLocks(LockIterator iterator, void* arg);
553+
extern void EnumerateLocks(LockIterator iterator, void *arg);
554554

555555
/* Lock a VXID (used to wait for a transaction to finish) */
556556
extern void VirtualXactLockTableInsert(VirtualTransactionId vxid);

0 commit comments

Comments
 (0)