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

Commitdb39866

Browse files
committed
cleanup of cfs related files. TODO: more comments
1 parentff42c83 commitdb39866

File tree

7 files changed

+147
-111
lines changed

7 files changed

+147
-111
lines changed

‎src/backend/commands/dbcommands.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,11 +1227,11 @@ movedb(const char *dbname, const char *tblspcname)
12271227
/*
12281228
* Copy files from the old tablespace to the new one
12291229
*/
1230-
if (src_compressed ^dst_compressed) {
1230+
if (src_compressed ^dst_compressed)
12311231
copyzipdir(src_dbpath,src_compressed,dst_dbpath,dst_compressed);
1232-
}else {
1232+
else
12331233
copydir(src_dbpath,dst_dbpath, false);
1234-
}
1234+
12351235

12361236
/*
12371237
* Record the filesystem change in XLOG

‎src/backend/commands/tablespace.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,21 +1062,26 @@ AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt)
10621062
/* If tablespace should be compressed */
10631063
compressed=getBoolOption(stmt->options,"compression", false);
10641064

1065-
if (compressed ^is_tablespace_compressed(tablespaceoid)) {
1065+
if (compressed ^is_tablespace_compressed(tablespaceoid))
1066+
{
10661067
char*tbsdir=psprintf("pg_tblspc/%u/%s",tablespaceoid,TABLESPACE_VERSION_DIRECTORY);
1067-
if (!directory_is_empty(tbsdir)) {
1068+
1069+
if (!directory_is_empty(tbsdir))
10681070
ereport(ERROR,
10691071
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10701072
errmsg("It is not possible to toggle compression option for tablespace")));
1071-
}else {
1073+
else
1074+
{
10721075
char*compressionFilePath=psprintf("%s/pg_compression",tbsdir);
1073-
if (compressed) {
1076+
1077+
if (compressed)
1078+
{
10741079
FILE*comp=fopen(compressionFilePath,"w");
10751080
fputs(cfs_algorithm(),comp);
10761081
fclose(comp);
1077-
}else {
1078-
unlink(compressionFilePath);
10791082
}
1083+
else
1084+
unlink(compressionFilePath);
10801085
}
10811086
}
10821087

‎src/backend/storage/file/cfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ static bool cfs_gc_file(char* map_path)
807807
Assert(rc);
808808
cfs_decrypt(block, (off_t)i*BLCKSZ,size);
809809
res=cfs_decompress(decomressedBlock,BLCKSZ,block,size);
810+
810811
if (res!=BLCKSZ)
811812
{
812813
pg_atomic_fetch_sub_u32(&map->lock,CFS_GC_LOCK);/* release lock */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp