]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: proper override rocksdb::WritableFile::Allocate
authorIgor Fedotov <igor.fedotov@croit.io>
Wed, 1 Mar 2023 13:04:23 +0000 (16:04 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Tue, 1 Aug 2023 12:28:40 +0000 (15:28 +0300)
Failing to do that makes BlueFS file frgmentation higher.

Fixes: https://tracker.ceph.com/issues/58966
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 2d8b9e9ed58bca4917b90ea5eaa43264a89dff75)

src/os/bluestore/BlueRocksEnv.cc

index f8a2b7025d49f5ff9eacddf35dc6d392113aee57..e34e50630f08bf7cc213b0e75139513e22da58c9 100644 (file)
@@ -283,14 +283,12 @@ class BlueRocksWritableFile : public rocksdb::WritableFile {
     return rocksdb::Status::OK();
   }
 
-  using rocksdb::WritableFile::RangeSync;
   // Sync a file range with disk.
   // offset is the starting byte of the file range to be synchronized.
   // nbytes specifies the length of the range to be synchronized.
   // This asks the OS to initiate flushing the cached data to disk,
   // without waiting for completion.
-  // Default implementation does nothing.
-  rocksdb::Status RangeSync(off_t offset, off_t nbytes) {
+  rocksdb::Status RangeSync(uint64_t offset, uint64_t nbytes) override {
     // round down to page boundaries
     int partial = offset & 4095;
     offset -= partial;
@@ -302,11 +300,10 @@ class BlueRocksWritableFile : public rocksdb::WritableFile {
   }
 
  protected:
-  using rocksdb::WritableFile::Allocate;
   /*
    * Pre-allocate space for a file.
    */
-  rocksdb::Status Allocate(off_t offset, off_t len) {
+  rocksdb::Status Allocate(uint64_t offset, uint64_t len) override {
     int r = fs->preallocate(h->file, offset, len);
     return err_to_status(r);
   }