return true;
}
-int RGWGetObj::read_user_manifest_part(rgw_bucket& bucket, RGWObjEnt& ent, RGWAccessControlPolicy *bucket_policy, off_t start_ofs, off_t end_ofs)
+int RGWGetObj::read_user_manifest_part(rgw_bucket& bucket,
+ const RGWObjEnt& ent,
+ RGWAccessControlPolicy * const bucket_policy,
+ const off_t start_ofs,
+ const off_t end_ofs)
{
ldout(s->cct, 20) << "user manifest obj=" << ent.key.name << "[" << ent.key.instance << "]" << dendl;
return 0;
}
-static int iterate_user_manifest_parts(CephContext *cct, RGWRados *store, off_t ofs, off_t end,
- rgw_bucket& bucket, string& obj_prefix, RGWAccessControlPolicy *bucket_policy,
- uint64_t *ptotal_len,
- uint64_t *pobj_size,
- int (*cb)(rgw_bucket& bucket, RGWObjEnt& ent, RGWAccessControlPolicy *bucket_policy,
- off_t start_ofs, off_t end_ofs, void *param), void *cb_param)
+static int iterate_user_manifest_parts(CephContext * const cct,
+ RGWRados * const store,
+ const off_t ofs,
+ const off_t end,
+ rgw_bucket& bucket,
+ const string& obj_prefix,
+ RGWAccessControlPolicy * const bucket_policy,
+ uint64_t * const ptotal_len,
+ uint64_t * const pobj_size,
+ int (*cb)(rgw_bucket& bucket,
+ const RGWObjEnt& ent,
+ RGWAccessControlPolicy * const bucket_policy,
+ off_t start_ofs,
+ off_t end_ofs,
+ void *param),
+ void * const cb_param)
{
uint64_t obj_ofs = 0, len_count = 0;
bool found_start = false, found_end = false, handled_end = false;
if (cb) {
r = cb(bucket, ent, bucket_policy, start_ofs, end_ofs, cb_param);
- if (r < 0)
+ if (r < 0) {
return r;
+ }
}
}
}
} while (is_truncated);
- if (ptotal_len)
+ if (ptotal_len) {
*ptotal_len = len_count;
+ }
if (pobj_size) {
*pobj_size = obj_ofs;
}
return 0;
}
-static int get_obj_user_manifest_iterate_cb(rgw_bucket& bucket, RGWObjEnt& ent, RGWAccessControlPolicy *bucket_policy, off_t start_ofs, off_t end_ofs,
- void *param)
+static int get_obj_user_manifest_iterate_cb(rgw_bucket& bucket,
+ const RGWObjEnt& ent,
+ RGWAccessControlPolicy * const bucket_policy,
+ const off_t start_ofs,
+ const off_t end_ofs,
+ void * const param)
{
RGWGetObj *op = static_cast<RGWGetObj *>(param);
return op->read_user_manifest_part(bucket, ent, bucket_policy, start_ofs, end_ofs);
}
/* dry run to find out total length */
- int r = iterate_user_manifest_parts(s->cct, store, ofs, end, bucket, obj_prefix, bucket_policy, &total_len, &s->obj_size, NULL, NULL);
- if (r < 0)
+ int r = iterate_user_manifest_parts(s->cct, store, ofs, end,
+ bucket, obj_prefix, bucket_policy, &total_len, &s->obj_size,
+ NULL, NULL);
+ if (r < 0) {
return r;
+ }
if (!get_data) {
bufferlist bl;
return 0;
}
- r = iterate_user_manifest_parts(s->cct, store, ofs, end, bucket, obj_prefix, bucket_policy, NULL, NULL, get_obj_user_manifest_iterate_cb, (void *)this);
- if (r < 0)
+ r = iterate_user_manifest_parts(s->cct, store, ofs, end,
+ bucket, obj_prefix, bucket_policy, NULL, NULL,
+ get_obj_user_manifest_iterate_cb, (void *)this);
+ if (r < 0) {
return r;
+ }
return 0;
}