diff options
author | Sage Weil <sage@inktank.com> | 2013-06-19 10:56:51 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-19 10:56:51 -0700 |
commit | 2434ecca6f8e1f2af62c74cb1b7df277f4a076f7 (patch) | |
tree | 10cd9e05201827eae6f92b671964fc7c5ff7fd17 | |
parent | f8973bda801dbb2412c4cd83869c0203930f38e9 (diff) | |
parent | 3f32ded41818ad3c607339d723c095f166e36f7e (diff) | |
download | ceph-2434ecca6f8e1f2af62c74cb1b7df277f4a076f7.tar.gz |
Merge remote-tracking branch 'gh/wip-4976-cuttlefish' into cuttlefish
Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r-- | src/os/FileStore.cc | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index fec058edd17..a91c252e531 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -2950,15 +2950,13 @@ int FileStore::_write(coll_t cid, const hobject_t& oid, // flush? { bool should_flush = (ssize_t)len >= m_filestore_flush_min; - bool local_flush = false; #ifdef HAVE_SYNC_FILE_RANGE bool async_done = false; if (!should_flush || !m_filestore_flusher || !(async_done = queue_flusher(fd, offset, len, replica))) { if (should_flush && m_filestore_sync_flush) { - ::sync_file_range(fd, offset, len, SYNC_FILE_RANGE_WRITE); - local_flush = true; + ::fdatasync(fd); } } //Both lfn_close() and possible posix_fadvise() done by flusher @@ -2967,17 +2965,8 @@ int FileStore::_write(coll_t cid, const hobject_t& oid, // no sync_file_range; (maybe) flush inline and close. if (should_flush && m_filestore_sync_flush) { ::fdatasync(fd); - local_flush = true; } #endif - if (local_flush && replica && m_filestore_replica_fadvise) { - int fa_r = posix_fadvise(fd, offset, len, POSIX_FADV_DONTNEED); - if (fa_r) { - dout(0) << "posic_fadvise failed: " << cpp_strerror(fa_r) << dendl; - } else { - dout(10) << "posix_fadvise performed after local flush" << dendl; - } - } } if (fd >= 0) lfn_close(fd); @@ -3279,9 +3268,6 @@ bool FileStore::queue_flusher(int fd, uint64_t off, uint64_t len, bool replica) if (flusher_queue_len < m_filestore_flusher_max_fds) { flusher_queue.push_back(sync_epoch); flusher_queue.push_back(fd); - flusher_queue.push_back(off); - flusher_queue.push_back(len); - flusher_queue.push_back(replica); flusher_queue_len++; flusher_cond.Signal(); dout(10) << "queue_flusher ep " << sync_epoch << " fd " << fd << " " << off << "~" << len @@ -3317,23 +3303,9 @@ void FileStore::flusher_entry() q.pop_front(); int fd = q.front(); q.pop_front(); - uint64_t off = q.front(); - q.pop_front(); - uint64_t len = q.front(); - q.pop_front(); - bool replica = q.front(); - q.pop_front(); if (!stop && ep == sync_epoch) { dout(10) << "flusher_entry flushing+closing " << fd << " ep " << ep << dendl; - ::sync_file_range(fd, off, len, SYNC_FILE_RANGE_WRITE); - if (replica && m_filestore_replica_fadvise) { - int fa_r = posix_fadvise(fd, off, len, POSIX_FADV_DONTNEED); - if (fa_r) { - dout(0) << "posic_fadvise failed: " << cpp_strerror(fa_r) << dendl; - } else { - dout(10) << "posix_fadvise performed after local flush" << dendl; - } - } + ::fdatasync(fd); } else dout(10) << "flusher_entry JUST closing " << fd << " (stop=" << stop << ", ep=" << ep << ", sync_epoch=" << sync_epoch << ")" << dendl; |