From: Daniel Glaser Date: Wed, 21 Mar 2018 19:42:59 +0000 (+0100) Subject: filestore,rgw: Fix types/casts making clang on 32-Bit working X-Git-Tag: v13.1.0~383^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f3ea2aae6a171dcb3c61d7aa828624c8a53bc77;p=ceph.git filestore,rgw: Fix types/casts making clang on 32-Bit working Fixing types for FS_SUPER_MAGIC from long to unsigned long in Filestore.cc and adding some static_casts to rgw_rados and rgw_sync_log_trim due to clang errors. Signed-off-by: Daniel Glaser --- diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 5e8baa7d92d..eade1118763 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -778,7 +778,7 @@ int FileStore::dump_journal(ostream& out) return r; } -FileStoreBackend *FileStoreBackend::create(long f_type, FileStore *fs) +FileStoreBackend *FileStoreBackend::create(unsigned long f_type, FileStore *fs) { switch (f_type) { #if defined(__linux__) @@ -798,7 +798,7 @@ FileStoreBackend *FileStoreBackend::create(long f_type, FileStore *fs) } } -void FileStore::create_backend(long f_type) +void FileStore::create_backend(unsigned long f_type) { m_fs_type = f_type; diff --git a/src/os/filestore/FileStore.h b/src/os/filestore/FileStore.h index 85300caf12f..ea1865eeb41 100644 --- a/src/os/filestore/FileStore.h +++ b/src/os/filestore/FileStore.h @@ -50,13 +50,13 @@ #if defined(__linux__) # ifndef BTRFS_SUPER_MAGIC -#define BTRFS_SUPER_MAGIC 0x9123683EL +#define BTRFS_SUPER_MAGIC 0x9123683EUL # endif # ifndef XFS_SUPER_MAGIC -#define XFS_SUPER_MAGIC 0x58465342L +#define XFS_SUPER_MAGIC 0x58465342UL # endif # ifndef ZFS_SUPER_MAGIC -#define ZFS_SUPER_MAGIC 0x2fc12fc1L +#define ZFS_SUPER_MAGIC 0x2fc12fc1UL # endif #endif @@ -158,7 +158,7 @@ private: FileStoreBackend *backend; - void create_backend(long f_type); + void create_backend(unsigned long f_type); deque snaps; @@ -810,7 +810,7 @@ private: bool m_filestore_sloppy_crc; int m_filestore_sloppy_crc_block_size; uint64_t m_filestore_max_alloc_hint_size; - long m_fs_type; + unsigned long m_fs_type; //Determined xattr handling based on fs type void set_xattr_limits_via_conf(); @@ -890,7 +890,7 @@ public: return filestore->cct; } - static FileStoreBackend *create(long f_type, FileStore *fs); + static FileStoreBackend *create(unsigned long f_type, FileStore *fs); virtual const char *get_name() = 0; virtual int detect_features() = 0; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index d0e1298be0a..7420db441ca 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3787,7 +3787,7 @@ int RGWRados::init_rados() } } - auto handles = std::vector{cct->_conf->rgw_num_rados_handles}; + auto handles = std::vector{static_cast(cct->_conf->rgw_num_rados_handles)}; for (auto& r : handles) { ret = r.init_with_context(cct); diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc index 42b348312fb..e1002253b8d 100644 --- a/src/rgw/rgw_sync_log_trim.cc +++ b/src/rgw/rgw_sync_log_trim.cc @@ -897,7 +897,7 @@ int BucketTrimPollCR::operate() reenter(this) { for (;;) { set_status("sleeping"); - wait(utime_t{config.trim_interval_sec, 0}); + wait(utime_t{static_cast(config.trim_interval_sec), 0}); // prevent others from trimming for our entire wait interval set_status("acquiring trim lock"); diff --git a/src/test/filestore/TestFileStore.cc b/src/test/filestore/TestFileStore.cc index bf1026d7455..9b095e838c3 100644 --- a/src/test/filestore/TestFileStore.cc +++ b/src/test/filestore/TestFileStore.cc @@ -21,7 +21,7 @@ class TestFileStore { public: - static void create_backend(FileStore &fs, long f_type) { + static void create_backend(FileStore &fs, unsigned long f_type) { fs.create_backend(f_type); } };