[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1290523792-6170-4-git-send-email-bgamari.foss@gmail.com>
Date: Tue, 23 Nov 2010 09:49:52 -0500
From: Ben Gamari <bgamari.foss@...il.com>
To: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Minchan Kim <minchan.kim@...il.com>, rsync@...ts.samba.org
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Rik van Riel <riel@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Nick Piggin <npiggin@...nel.dk>,
Ben Gamari <bgamari.foss@...il.com>
Subject: [PATCH 3/3] Inform kernel of FADV_DONTNEED hint in receiver
Use the FADV_DONTNEED fadvise hint after finishing writing to a
destinataion fd in the receiver.
---
receiver.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/receiver.c b/receiver.c
index 39c5e49..33b21fb 100644
--- a/receiver.c
+++ b/receiver.c
@@ -721,6 +721,12 @@ int recv_files(int f_in, char *local_name)
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
fname, fd2, F_LENGTH(file));
+ if (do_fadvise(fd2, 0, 0, POSIX_FADV_DONTNEED) != 0) {
+ rsyserr(FERROR_XFER, errno,
+ "fadvise failed in writing %s",
+ full_fname(fname));
+ }
+
log_item(log_code, file, &initial_stats, iflags, NULL);
if (fd1 != -1)
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists