]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/os/filestore/FileStore.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / os / filestore / FileStore.cc
index d6aceafda17670109d3c2af4fe9a38ef98fe2b87..dc304659b1801da526bb3eccc4343397978da6cb 100644 (file)
@@ -73,7 +73,6 @@
 #include "kv/KeyValueDB.h"
 
 #include "common/ceph_crypto.h"
-using ceph::crypto::SHA1;
 
 #include "include/ceph_assert.h"
 
@@ -109,6 +108,26 @@ using ceph::crypto::SHA1;
 #define XATTR_SPILL_OUT "1"
 #define __FUNC__ __func__ << "(" << __LINE__ << ")"
 
+using std::cerr;
+using std::list;
+using std::make_pair;
+using std::map;
+using std::ostream;
+using std::ostringstream;
+using std::set;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+using ceph::crypto::SHA1;
+using ceph::BackTrace;
+using ceph::bufferlist;
+using ceph::bufferptr;
+using ceph::decode;
+using ceph::encode;
+using ceph::Formatter;
+using ceph::JSONFormatter;
+
 //Initial features in new superblock.
 static CompatSet get_fs_initial_compat_set() {
   CompatSet::FeatureSet ceph_osd_feature_compat;
@@ -553,8 +572,10 @@ FileStore::FileStore(CephContext* cct, const std::string &base,
   m_ondisk_finisher_num(cct->_conf->filestore_ondisk_finisher_threads),
   m_apply_finisher_num(cct->_conf->filestore_apply_finisher_threads),
   op_tp(cct, "FileStore::op_tp", "tp_fstore_op", cct->_conf->filestore_op_threads, "filestore_op_threads"),
-  op_wq(this, cct->_conf->filestore_op_thread_timeout,
-       cct->_conf->filestore_op_thread_suicide_timeout, &op_tp),
+  op_wq(this,
+       ceph::make_timespan(cct->_conf->filestore_op_thread_timeout),
+       ceph::make_timespan(cct->_conf->filestore_op_thread_suicide_timeout),
+       &op_tp),
   logger(nullptr),
   trace_endpoint("0.0.0.0", 0, "FileStore"),
   m_filestore_commit_timeout(cct->_conf->filestore_commit_timeout),
@@ -650,11 +671,11 @@ FileStore::FileStore(CephContext* cct, const std::string &base,
 
 FileStore::~FileStore()
 {
-  for (vector<Finisher*>::iterator it = ondisk_finishers.begin(); it != ondisk_finishers.end(); ++it) {
+  for (auto it = ondisk_finishers.begin(); it != ondisk_finishers.end(); ++it) {
     delete *it;
     *it = nullptr;
   }
-  for (vector<Finisher*>::iterator it = apply_finishers.begin(); it != apply_finishers.end(); ++it) {
+  for (auto it = apply_finishers.begin(); it != apply_finishers.end(); ++it) {
     delete *it;
     *it = nullptr;
   }
@@ -3000,7 +3021,7 @@ void FileStore::_do_transaction(
     case Transaction::OP_COLL_HINT:
       {
         const coll_t &cid = i.get_cid(op->cid);
-        uint32_t type = op->hint_type;
+        uint32_t type = op->hint;
         bufferlist hint;
         i.decode_bl(hint);
         auto hiter = hint.cbegin();
@@ -4435,12 +4456,12 @@ int FileStore::_fgetattr(int fd, const char *name, bufferptr& bp)
   char val[CHAIN_XATTR_MAX_BLOCK_LEN];
   int l = chain_fgetxattr(fd, name, val, sizeof(val));
   if (l >= 0) {
-    bp = buffer::create(l);
+    bp = ceph::buffer::create(l);
     memcpy(bp.c_str(), val, l);
   } else if (l == -ERANGE) {
     l = chain_fgetxattr(fd, name, 0, 0);
     if (l > 0) {
-      bp = buffer::create(l);
+      bp = ceph::buffer::create(l);
       l = chain_fgetxattr(fd, name, bp.c_str(), l);
     }
   }