]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/cls/cephfs/cls_cephfs.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / cls / cephfs / cls_cephfs.cc
index 1d656c137892e9e197994e8fbd3c77d5969e120b..7e3214b9246fe3ec4ff7101fb7c877b1b6a95c45 100644 (file)
@@ -38,7 +38,7 @@ std::ostream &operator<<(std::ostream &out, const ObjCeiling &in)
  * If the xattr is missing, then it is set to the input integer.
  *
  * @param xattr_name: name of xattr to compare against and set
- * @param input_val: candidate new value, of ::encode()'able type
+ * @param input_val: candidate new value, of encode()'able type
  * @returns 0 on success (irrespective of whether our new value
  *          was used) else an error code
  */
@@ -53,10 +53,10 @@ static int set_if_greater(cls_method_context_t hctx,
   if (r == -ENOENT || existing_val_bl.length() == 0) {
     set_val = true;
   } else if (r >= 0) {
-    bufferlist::iterator existing_p = existing_val_bl.begin();
+    auto existing_p = existing_val_bl.cbegin();
     try {
       A existing_val;
-      ::decode(existing_val, existing_p);
+      decode(existing_val, existing_p);
       if (!existing_p.end()) {
         // Trailing junk?  Consider it invalid and overwrite
         set_val = true;
@@ -75,7 +75,7 @@ static int set_if_greater(cls_method_context_t hctx,
   // Conditionally set the new xattr
   if (set_val) {
     bufferlist set_bl;
-    ::encode(input_val, set_bl);
+    encode(input_val, set_bl);
     return cls_cxx_setxattr(hctx, xattr_name.c_str(), &set_bl);
   } else {
     return 0;
@@ -85,13 +85,13 @@ static int set_if_greater(cls_method_context_t hctx,
 static int accumulate_inode_metadata(cls_method_context_t hctx,
     bufferlist *in, bufferlist *out)
 {
-  assert(in != NULL);
-  assert(out != NULL);
+  ceph_assert(in != NULL);
+  ceph_assert(out != NULL);
 
   int r = 0;
 
   // Decode `in`
-  bufferlist::iterator q = in->begin();
+  auto q = in->cbegin();
   AccumulateArgs args;
   try {
     args.decode(q);
@@ -126,7 +126,7 @@ class PGLSCephFSFilter : public PGLSFilter {
 protected:
   std::string scrub_tag;
 public:
-  int init(bufferlist::iterator& params) override {
+  int init(bufferlist::const_iterator& params) override {
     try {
       InodeTagFilterArgs args;
       args.decode(params);
@@ -167,9 +167,9 @@ bool PGLSCephFSFilter::filter(const hobject_t &obj,
 
   if (!scrub_tag.empty() && xattr_data.length() > 0) {
     std::string tag_ondisk;
-    bufferlist::iterator q = xattr_data.begin();
+    auto q = xattr_data.cbegin();
     try {
-      ::decode(tag_ondisk, q);
+      decode(tag_ondisk, q);
       if (tag_ondisk == scrub_tag)
        return false;
     } catch (const buffer::error &err) {