Fix/edit pgindent confusing places in neon.

This commit is contained in:
Arseny Sher
2023-12-07 17:46:29 +03:00
parent 448c5065d5
commit f3fd8a4ceb
5 changed files with 28 additions and 30 deletions

View File

@@ -29,15 +29,16 @@ static int extension_server_port = 0;
static download_extension_file_hook_type prev_download_extension_file_hook = NULL;
/* to download all SQL (and data) files for an extension: */
/* curl -X POST http://localhost:8080/extension_server/postgis */
/* it covers two possible extension files layouts: */
/* 1. extension_name--version--platform.sql */
/* 2. extension_name/extension_name--version.sql */
/* extension_name/extra_files.csv */
/* */
/* to download specific library file: */
/* curl -X POST http://localhost:8080/extension_server/postgis-3.so?is_library=true */
/*
* to download all SQL (and data) files for an extension:
* curl -X POST http://localhost:8080/extension_server/postgis
* it covers two possible extension files layouts:
* 1. extension_name--version--platform.sql
* 2. extension_name/extension_name--version.sql
* extension_name/extra_files.csv
* to download specific library file:
* curl -X POST http://localhost:8080/extension_server/postgis-3.so?is_library=true
*/
static bool
neon_download_extension_file_http(const char *filename, bool is_library)
{

View File

@@ -219,12 +219,12 @@ lfc_shmem_startup(void)
lfc_lock = (LWLockId) GetNamedLWLockTranche("lfc_lock");
info.keysize = sizeof(BufferTag);
info.entrysize = sizeof(FileCacheEntry);
lfc_hash = ShmemInitHash("lfc_hash",
/*
* lfc_size+1 because we add new element to hash table before eviction
* of victim
*/
lfc_hash = ShmemInitHash("lfc_hash",
lfc_size + 1, lfc_size + 1,
&info,
HASH_ELEM | HASH_BLOBS);

View File

@@ -48,9 +48,11 @@ _PG_init(void)
pg_init_extension_server();
/* Important: This must happen after other parts of the extension */
/* are loaded, otherwise any settings to GUCs that were set before */
/* the extension was loaded will be removed. */
/*
* Important: This must happen after other parts of the extension are
* loaded, otherwise any settings to GUCs that were set before the
* extension was loaded will be removed.
*/
EmitWarningsOnPlaceholders("neon");
}

View File

@@ -109,4 +109,4 @@
#define DropRelationAllLocalBuffers DropRelationAllLocalBuffers
#endif
#endif /* //NEON_PGVERSIONCOMPAT_H */
#endif /* NEON_PGVERSIONCOMPAT_H */

View File

@@ -1352,9 +1352,8 @@ neon_init(void)
if (MyPState != NULL)
return;
prfs_size = offsetof(PrefetchState, prf_buffer) + (
sizeof(PrefetchRequest) * readahead_buffer_size
);
prfs_size = offsetof(PrefetchState, prf_buffer) +
sizeof(PrefetchRequest) * readahead_buffer_size;
MyPState = MemoryContextAllocZero(TopMemoryContext, prfs_size);
@@ -1901,7 +1900,6 @@ neon_close(SMgrRelation reln, ForkNumber forknum)
bool
neon_prefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum)
{
BufferTag tag;
uint64 ring_index PG_USED_FOR_ASSERTS_ONLY;
switch (reln->smgr_relpersistence)
@@ -1921,11 +1919,12 @@ neon_prefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum)
if (lfc_cache_contains(InfoFromSMgrRel(reln), forknum, blocknum))
return false;
tag = (BufferTag)
BufferTag tag =
{
.forkNum = forknum,
.blockNum = blocknum
.blockNum = blocknum
};
CopyNRelFileInfoToBufTag(tag, InfoFromSMgrRel(reln));
ring_index = prefetch_register_buffer(tag, NULL, NULL);
@@ -1989,15 +1988,13 @@ neon_read_at_lsn(NRelFileInfo rinfo, ForkNumber forkNum, BlockNumber blkno,
#endif
{
NeonResponse *resp;
BufferTag buftag;
uint64 ring_index;
PrfHashEntry *entry;
PrefetchRequest *slot;
buftag = (BufferTag)
BufferTag buftag =
{
.forkNum = forkNum,
.blockNum = blkno,
.blockNum = blkno,
};
CopyNRelFileInfoToBufTag(buftag, rinfo);
@@ -2120,11 +2117,10 @@ neon_read_at_lsn(NRelFileInfo rinfo, ForkNumber forkNum, BlockNumber blkno,
* neon_read() -- Read the specified block from a relation.
*/
void
neon_read(SMgrRelation reln, ForkNumber forkNum, BlockNumber blkno,
#if PG_MAJORVERSION_NUM < 16
char *buffer)
neon_read(SMgrRelation reln, ForkNumber forkNum, BlockNumber blkno, char *buffer)
#else
void *buffer)
neon_read(SMgrRelation reln, ForkNumber forkNum, BlockNumber blkno, void *buffer)
#endif
{
bool latest;
@@ -2259,11 +2255,10 @@ hexdump_page(char *page)
* use mdextend().
*/
void
neon_write(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
#if PG_MAJORVERSION_NUM < 16
char *buffer, bool skipFsync)
neon_write(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync)
#else
const void *buffer, bool skipFsync)
neon_write(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
#endif
{
XLogRecPtr lsn;