From: Jianpeng Ma Date: Fri, 26 Dec 2014 01:58:24 +0000 (+0800) Subject: FileJournal: Don't cache journal data if journal w/o directio mode X-Git-Tag: v0.92~93^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45fb9a3b5d16dfef7ef2760c162144fd58fc0c5a;p=ceph.git FileJournal: Don't cache journal data if journal w/o directio mode Only read journal data in osd starting.So no need to keep journal data in kernel cache/buffer. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index e2fa715f0a91..73b284154635 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1077,6 +1077,10 @@ void FileJournal::do_write(bufferlist& bl) ::fsync(fd); #else ::fdatasync(fd); +#endif +#ifdef HAVE_POSIX_FADVISE + if (g_conf->filestore_fadvise) + posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED); #endif }