]> git-server-git.apps.pok.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>
Fri, 18 Jan 2013 20:14:48 +0000 (12:14 -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>
src/os/FileStore.cc

index fa11b373882c525464797c02154d702fc657004f..fc1f931a86106278d4b8de7f0fce6d0dda736326 100644 (file)
@@ -2913,13 +2913,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