e.etag = dirent.meta.etag;
e.owner = dirent.meta.owner;
e.owner_display_name = dirent.meta.owner_display_name;
+ e.content_type = dirent.meta.content_type;
+
+ if (!dirent.exists || !dirent.pending_map.empty()) {
+ /* there are uncommitted ops. We need to check the current state,
+ * and if the tags are old we need to do cleanup as well. */
+ librados::IoCtx sub_ctx;
+ sub_ctx.dup(io_ctx);
+ r = check_disk_state(sub_ctx, bucket, dirent, e, updates);
+ if (r < 0) {
+ if (r == -ENOENT)
+ continue;
+ else
+ return r;
+ }
+ }
m[e.name] = e;
dout(0) << " got " << e.name << dendl;
}
int decode_policy(bufferlist& bl, ACLOwner *owner);
int get_bucket_stats(rgw_bucket& bucket, map<RGWObjCategory, RGWBucketStats>& stats);
- virtual int get_bucket_info(string& bucket_name, RGWBucketInfo& info);
+ virtual int get_bucket_info(void *ctx, string& bucket_name, RGWBucketInfo& info);
int cls_rgw_init_index(rgw_bucket& bucket, string& oid);
- int cls_obj_prepare_op(rgw_bucket& bucket, uint8_t op, string& tag, string& name);
+ int cls_obj_prepare_op(rgw_bucket& bucket, uint8_t op, string& tag,
+ string& name, string& locator);
int cls_obj_complete_op(rgw_bucket& bucket, uint8_t op, string& tag, uint64_t epoch,
RGWObjEnt& ent, RGWObjCategory category);
int cls_obj_complete_add(rgw_bucket& bucket, string& tag, uint64_t epoch, RGWObjEnt& ent, RGWObjCategory category);
int cls_obj_complete_del(rgw_bucket& bucket, string& tag, uint64_t epoch, string& name);
- int cls_bucket_list(rgw_bucket& bucket, string start, uint32_t num, map<string, RGWObjEnt>& m, bool *is_truncated);
+ int cls_bucket_list(rgw_bucket& bucket, string start, uint32_t num,
+ map<string, RGWObjEnt>& m, bool *is_truncated,
+ string *last_entry = NULL);
int cls_bucket_head(rgw_bucket& bucket, struct rgw_bucket_dir_header& header);
- int prepare_update_index(RGWObjState *state, rgw_bucket& bucket, string& oid, string& tag);
+ int prepare_update_index(RGWObjState *state, rgw_bucket& bucket,
+ rgw_obj& oid, string& tag);
int complete_update_index(rgw_bucket& bucket, string& oid, string& tag, uint64_t epoch, uint64_t size,
- utime_t& ut, string& etag, bufferlist *acl_bl, RGWObjCategory category);
+ utime_t& ut, string& etag, string& content_type, bufferlist *acl_bl, RGWObjCategory category);
int complete_update_index_del(rgw_bucket& bucket, string& oid, string& tag, uint64_t epoch) {
return cls_obj_complete_del(bucket, tag, epoch, oid);
}