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

Commitecef16c

Browse files
author
Sokolov Yura
committed
cfs: speedup a bit verificatoin.
not really much speedup, though.
1 parent3daaa06 commitecef16c

File tree

1 file changed

+14
-3
lines changed
  • src/backend/storage/file

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,23 +1161,34 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
11611161

11621162
if (cfs_gc_verify_file)
11631163
{
1164+
off_tsoff=-1;
11641165
fd=open(file_bck_path,O_RDONLY|PG_BINARY,0);
11651166
Assert(fd >=0);
11661167

11671168
for (i=0;i<n_pages;i++)
11681169
{
1169-
inode_tinode=newMap->inodes[i];
1170+
inodes[i]=&newMap->inodes[i];
1171+
}
1172+
qsort(inodes,n_pages,sizeof(inode_t*),cfs_cmp_page_offs);
1173+
1174+
for (i=0;i<n_pages;i++)
1175+
{
1176+
inode_tinode=*inodes[i];
11701177
intsize=CFS_INODE_SIZE(inode);
11711178
if (size!=0&&size<BLCKSZ)
11721179
{
11731180
charblock[BLCKSZ];
11741181
chardecomressedBlock[BLCKSZ];
11751182
off_tresPG_USED_FOR_ASSERTS_ONLY;
11761183
boolrcPG_USED_FOR_ASSERTS_ONLY;
1177-
res=lseek(fd,CFS_INODE_OFFS(inode),SEEK_SET);
1178-
Assert(res== (off_t)CFS_INODE_OFFS(inode));
1184+
if (soff!=CFS_INODE_OFFS(inode))
1185+
{
1186+
soff=lseek(fd,CFS_INODE_OFFS(inode),SEEK_SET);
1187+
Assert(soff== (off_t)CFS_INODE_OFFS(inode));
1188+
}
11791189
rc=cfs_read_file(fd,block,size);
11801190
Assert(rc);
1191+
soff+=size;
11811192
cfs_decrypt(file_bck_path,block, (off_t)i*BLCKSZ,size);
11821193
res=cfs_decompress(decomressedBlock,BLCKSZ,block,size);
11831194

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp