@@ -158,7 +158,7 @@ recurse_dir(const char *datadir, const char *parentpath,
158
158
* If 'trunc' is true, any existing file with the same name is truncated.
159
159
*/
160
160
static void
161
- copy_file_range (const char * path ,off_t begin ,off_t end ,bool trunc )
161
+ rewind_copy_file_range (const char * path ,off_t begin ,off_t end ,bool trunc )
162
162
{
163
163
char buf [BLCKSZ ];
164
164
char srcpath [MAXPGPATH ];
@@ -224,15 +224,16 @@ copy_executeFileMap(filemap_t *map)
224
224
break ;
225
225
226
226
case FILE_ACTION_COPY :
227
- copy_file_range (entry -> path ,0 ,entry -> newsize , true);
227
+ rewind_copy_file_range (entry -> path ,0 ,entry -> newsize , true);
228
228
break ;
229
229
230
230
case FILE_ACTION_TRUNCATE :
231
231
truncate_target_file (entry -> path ,entry -> newsize );
232
232
break ;
233
233
234
234
case FILE_ACTION_COPY_TAIL :
235
- copy_file_range (entry -> path ,entry -> oldsize ,entry -> newsize , false);
235
+ rewind_copy_file_range (entry -> path ,entry -> oldsize ,
236
+ entry -> newsize , false);
236
237
break ;
237
238
238
239
case FILE_ACTION_CREATE :
@@ -259,7 +260,7 @@ execute_pagemap(datapagemap_t *pagemap, const char *path)
259
260
while (datapagemap_next (iter ,& blkno ))
260
261
{
261
262
offset = blkno * BLCKSZ ;
262
- copy_file_range (path ,offset ,offset + BLCKSZ , false);
263
+ rewind_copy_file_range (path ,offset ,offset + BLCKSZ , false);
263
264
/* Ok, this block has now been copied from new data dir to old */
264
265
}
265
266
pg_free (iter );