]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: only flush inline if write is sufficiently large
authorSage Weil <sage@inktank.com>
Fri, 18 Jan 2013 20:14:48 +0000 (12:14 -0800)
committerSage Weil <sage@inktank.com>
Wed, 23 Jan 2013 13:40:27 +0000 (05:40 -0800)
Honor filestore_flush_min in the inline flush case.

Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 49726dcf973c38c7313ab78743b45ccc879671ea)

src/os/FileStore.cc

index 057a373361feebebc82da44541f8025490495eb7..4e208350902494a0e3d06a3cd401a69bd674ea37 100644 (file)
@@ -2884,13 +2884,13 @@ int FileStore::_write(coll_t cid, const hobject_t& oid,
     if (!should_flush ||
        !m_filestore_flusher ||
        !queue_flusher(fd, offset, len)) {
-      if (m_filestore_sync_flush)
+      if (should_flush && m_filestore_sync_flush)
        ::sync_file_range(fd, offset, len, SYNC_FILE_RANGE_WRITE);
       lfn_close(fd);
     }
 #else
     // no sync_file_range; (maybe) flush inline and close.
-    if (m_filestore_sync_flush)
+    if (should_flush && m_filestore_sync_flush)
       ::fdatasync(fd);
     lfn_close(fd);
 #endif