From d78a4401b544b2ba219d7184672fb3fad2822eb8 Mon Sep 17 00:00:00 2001 From: sdong Date: Mon, 19 Sep 2016 16:21:35 -0700 Subject: [PATCH] DBImpl::GetWalPreallocateBlockSize() should return size_t Summary: WritableFile::SetPreallocationBlockSize() requires parameter as size_t, and options used in DBImpl::GetWalPreallocateBlockSize() are all size_t. WritableFile::SetPreallocationBlockSize() should return size_t to avoid build break if size_t is not uint64_t. Test Plan: Run existing tests. Reviewers: andrewkr, IslamAbdelRahman, yiwu Reviewed By: yiwu Subscribers: leveldb, andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D64137 --- db/db_impl.cc | 4 ++-- db/db_impl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 6cf9e7d09..c2f1ba3dd 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3682,8 +3682,8 @@ bool DBImpl::MCOverlap(ManualCompaction* m, ManualCompaction* m1) { return true; } -uint64_t DBImpl::GetWalPreallocateBlockSize(uint64_t write_buffer_size) const { - uint64_t bsize = write_buffer_size / 10 + write_buffer_size; +size_t DBImpl::GetWalPreallocateBlockSize(uint64_t write_buffer_size) const { + size_t bsize = write_buffer_size / 10 + write_buffer_size; // Some users might set very high write_buffer_size and rely on // max_total_wal_size or other parameters to control the WAL size. if (db_options_.max_total_wal_size > 0) { diff --git a/db/db_impl.h b/db/db_impl.h index 277e09bfd..49c3a1584 100644 --- a/db/db_impl.h +++ b/db/db_impl.h @@ -1068,7 +1068,7 @@ class DBImpl : public DB { bool HaveManualCompaction(ColumnFamilyData* cfd); bool MCOverlap(ManualCompaction* m, ManualCompaction* m1); - uint64_t GetWalPreallocateBlockSize(uint64_t write_buffer_size) const; + size_t GetWalPreallocateBlockSize(uint64_t write_buffer_size) const; }; // Sanitize db options. The caller should delete result.info_log if