Ben Gamari
2010-Nov-23 14:49 UTC
[PATCH 2/3] Inform kernel of FADV_DONTNEED hint in sender
Use the FADV_DONTNEED fadvise hint after finishing reading an origin fd in the sender. --- sender.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/sender.c b/sender.c index 59dae7d..a934bfe 100644 --- a/sender.c +++ b/sender.c @@ -338,6 +338,12 @@ void send_files(int f_in, int f_out) if (do_progress) end_progress(st.st_size); + if (do_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) != 0) { + rsyserr(FERROR_XFER, errno, + "fadvise failed in sending %s", + full_fname(fname)); + } + log_item(log_code, file, &initial_stats, iflags, NULL); if (mbuf) { -- 1.7.1
Reasonably Related Threads
- [PATCH 3/3] Inform kernel of FADV_DONTNEED hint in receiver
- FADV_DONTNEED support
- Problem with exact moment of issuing transfer log entry for a [recv] action
- [PATCH] Add option --log-after to log after moving file into place
- [PATCH 1/3] Add fadvise interface wrapper