Avoid data remain in buffer when close the file, we should flush w/
force.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
// handler for discard event
void handle_discard(unsigned dev, interval_set<uint64_t>& to_release);
- void flush(FileWriter *h) {
+ void flush(FileWriter *h, bool force = false) {
std::lock_guard l(lock);
- _flush(h, false);
+ _flush(h, force);
}
void flush_range(FileWriter *h, uint64_t offset, uint64_t length) {
std::lock_guard l(lock);
}
rocksdb::Status Close() override {
- Flush();
+ fs->flush(h, true);
// mimic posix env, here. shrug.
size_t block_size;