* 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
*/
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;
// 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;
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);
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);
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) {