+-------------------------------------------------------------------
+Fri Oct 10 12:15:36 CEST 2014 - aschnell@suse.de
+
+- improved fadvise usage
+
-------------------------------------------------------------------
Fri Oct 3 01:05:01 CEST 2014 - dsterba@suse.cz
bool
copyfile(int src_fd, int dest_fd)
{
+ posix_fadvise(src_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+
+ // TODO: maybe use POSIX_FADV_DONTNEED on dest_fd, but this could
+ // trigger a kernel bug (see bsc #888259)
+
while (true)
{
// use small value for count to make function better interruptible
return false;
}
- posix_fadvise(fd1, 0, stat1.st_size, POSIX_FADV_SEQUENTIAL);
- posix_fadvise(fd2, 0, stat2.st_size, POSIX_FADV_SEQUENTIAL);
+ posix_fadvise(fd1, 0, 0, POSIX_FADV_SEQUENTIAL);
+ posix_fadvise(fd2, 0, 0, POSIX_FADV_SEQUENTIAL);
static_assert(sizeof(off_t) >= 8, "off_t is too small");