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

Commit3e68686

Browse files
committed
Rename pg_rewind's copy_file_range() to avoid conflict with new linux syscall.
Upcoming versions of glibc will contain copy_file_range(2), a wrapperaround a new linux syscall for in-kernel copying of data ranges. Thisconflicts with pg_rewinds function of the same name.Therefore rename pg_rewinds version. As our version isn't a genericcopying facility we decided to choose a rewind specific function name.Per buildfarm animal caiman and subsequent discussion with Tom Lane.Author: Andres FreundDiscussion:https://postgr.es/m/20180103033425.w7jkljth3e26sduc@alap3.anarazel.dehttps://postgr.es/m/31122.1514951044@sss.pgh.pa.usBackpatch: 9.5-, where pg_rewind was introduced
1 parent99d5a3f commit3e68686

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/bin/pg_rewind/copy_fetch.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ recurse_dir(const char *datadir, const char *parentpath,
156156
* If 'trunc' is true, any existing file with the same name is truncated.
157157
*/
158158
staticvoid
159-
copy_file_range(constchar*path,off_tbegin,off_tend,booltrunc)
159+
rewind_copy_file_range(constchar*path,off_tbegin,off_tend,booltrunc)
160160
{
161161
charbuf[BLCKSZ];
162162
charsrcpath[MAXPGPATH];
@@ -222,15 +222,16 @@ copy_executeFileMap(filemap_t *map)
222222
break;
223223

224224
caseFILE_ACTION_COPY:
225-
copy_file_range(entry->path,0,entry->newsize, true);
225+
rewind_copy_file_range(entry->path,0,entry->newsize, true);
226226
break;
227227

228228
caseFILE_ACTION_TRUNCATE:
229229
truncate_target_file(entry->path,entry->newsize);
230230
break;
231231

232232
caseFILE_ACTION_COPY_TAIL:
233-
copy_file_range(entry->path,entry->oldsize,entry->newsize, false);
233+
rewind_copy_file_range(entry->path,entry->oldsize,
234+
entry->newsize, false);
234235
break;
235236

236237
caseFILE_ACTION_CREATE:
@@ -257,7 +258,7 @@ execute_pagemap(datapagemap_t *pagemap, const char *path)
257258
while (datapagemap_next(iter,&blkno))
258259
{
259260
offset=blkno*BLCKSZ;
260-
copy_file_range(path,offset,offset+BLCKSZ, false);
261+
rewind_copy_file_range(path,offset,offset+BLCKSZ, false);
261262
/* Ok, this block has now been copied from new data dir to old */
262263
}
263264
pg_free(iter);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp