Skip to content
/ server Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions extra/mariabackup/ds_local.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ local_open(ds_ctxt_t *ctxt, const char *path,
local_file = (ds_local_file_t *) (file + 1);

local_file->fd = fd;
posix_fadvise(local_file->fd, 0, 0, POSIX_FADV_DONTNEED);
local_file->init_ibd_done = 0;
local_file->is_ibd = (path_len > 5) && !strcmp(fullpath + path_len - 5, ".ibd");
local_file->compressed = 0;
Expand Down Expand Up @@ -166,9 +167,7 @@ static int write_compressed(File fd, uchar *data, size_t len, size_t pagesize)
size_t n_bytes = MY_MIN(pagesize, len - written);
size_t datasize= trim_binary_zeros(ptr,n_bytes);
if (datasize > 0) {
if (!my_write(fd, ptr, datasize, MYF(MY_WME | MY_NABP)))
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
else
if (my_write(fd, ptr, datasize, MYF(MY_WME | MY_NABP)))
return 1;
}
if (datasize < n_bytes) {
Expand Down Expand Up @@ -242,11 +241,10 @@ local_write(ds_file_t *file, const uchar *buf, size_t len)
return write_compressed(fd, b, len, local_file->pagesize);
}

if (!my_write(fd, b , len, MYF(MY_WME | MY_NABP))) {
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
return 0;
if (my_write(fd, b , len, MYF(MY_WME | MY_NABP))) {
return 1;
}
return 1;
return 0;
}

static
Expand Down
8 changes: 4 additions & 4 deletions extra/mariabackup/ds_stdout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ stdout_open(ds_ctxt_t *ctxt __attribute__((unused)),
#endif

stdout_file->fd = my_fileno(stdout);
posix_fadvise(stdout_file->fd, 0, 0, POSIX_FADV_DONTNEED);

file->path = (char *) stdout_file + sizeof(ds_stdout_file_t);
memcpy(file->path, fullpath, pathlen);
Expand All @@ -99,12 +100,11 @@ stdout_write(ds_file_t *file, const uchar *buf, size_t len)
{
File fd = ((ds_stdout_file_t *) file->ptr)->fd;

if (!my_write(fd, buf, len, MYF(MY_WME | MY_NABP))) {
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
return 0;
if (my_write(fd, buf, len, MYF(MY_WME | MY_NABP))) {
return 1;
}

return 1;
return 0;
}

static
Expand Down
8 changes: 4 additions & 4 deletions extra/mariabackup/ds_tmpfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ tmpfile_open(ds_ctxt_t *ctxt, const char *path,
tmp_file->orig_path = (char *) tmp_file + sizeof(ds_tmp_file_t);

tmp_file->fd = fd;
posix_fadvise(tmp_file->fd, 0, 0, POSIX_FADV_DONTNEED);
memcpy(tmp_file->orig_path, path, path_len);

/* Store the real temporary file name in file->path */
Expand All @@ -138,12 +139,11 @@ tmpfile_write(ds_file_t *file, const uchar *buf, size_t len)
{
File fd = ((ds_tmp_file_t *) file->ptr)->fd;

if (!my_write(fd, buf, len, MYF(MY_WME | MY_NABP))) {
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
return 0;
if (my_write(fd, buf, len, MYF(MY_WME | MY_NABP))) {
return 1;
}

return 1;
return 0;
}

static int
Expand Down