]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore,rgw: Fix types/casts making clang on 32-Bit working
authorDaniel Glaser <the78mole@chaintronics.com>
Wed, 21 Mar 2018 19:42:59 +0000 (20:42 +0100)
committerKefu Chai <kchai@redhat.com>
Tue, 27 Mar 2018 07:39:21 +0000 (15:39 +0800)
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 <the78mole@chaintronics.com>
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h
src/rgw/rgw_rados.cc
src/rgw/rgw_sync_log_trim.cc
src/test/filestore/TestFileStore.cc

index 5e8baa7d92d173136b4f7b9b5dfa3f3bf1fba987..eade1118763205b9c701db83cb72466e1c12bba0 100644 (file)
@@ -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;
 
index 85300caf12fc6e384292be4d6ddbba02310f1d59..ea1865eeb41bc0e3f3f8168da750e2d6c0d6eb66 100644 (file)
 
 #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<uint64_t> 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;
index d0e1298be0a68cdb7b5e1da009e285b9ec813da5..7420db441ca0596a48fd3b7b557943fa1a0964c1 100644 (file)
@@ -3787,7 +3787,7 @@ int RGWRados::init_rados()
     }
   }
 
-  auto handles = std::vector<librados::Rados>{cct->_conf->rgw_num_rados_handles};
+  auto handles = std::vector<librados::Rados>{static_cast<size_t>(cct->_conf->rgw_num_rados_handles)};
 
   for (auto& r : handles) {
     ret = r.init_with_context(cct);
index 42b348312fb315456d3d39efe2bebc55a557a33a..e1002253b8d704a617dd60891a2f358ef88a41ae 100644 (file)
@@ -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<time_t>(config.trim_interval_sec), 0});
 
       // prevent others from trimming for our entire wait interval
       set_status("acquiring trim lock");
index bf1026d74550d0ab4e821638ec3a350280ea7138..9b095e838c33fab2285ff3e9e8da52af956db0fb 100644 (file)
@@ -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);
   }
 };