op.create(exclusive);
string etag;
+ string content_type;
bufferlist acl_bl;
map<string, bufferlist>::iterator iter;
if (name.compare(RGW_ATTR_ETAG) == 0) {
etag = bl.c_str();
+ } else if (name.compare(RGW_ATTR_CONTENT_TYPE) == 0) {
+ content_type = bl.c_str();
} else if (name.compare(RGW_ATTR_ACL) == 0) {
acl_bl = bl;
}
utime_t ut = ceph_clock_now(g_ceph_context);
r = complete_update_index(bucket, obj.object, tag, epoch, size,
- ut, etag, &acl_bl, category);
+ ut, etag, content_type, &acl_bl, category);
if (mtime) {
r = io_ctx.stat(oid, NULL, mtime);
}
int RGWRados::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)
{
if (bucket.marker.empty())
return 0;
}
ent.owner = owner.get_id();
ent.owner_display_name = owner.get_display_name();
+ ent.content_type = content_type;
int ret = cls_obj_complete_add(bucket, tag, epoch, ent, category);
RGWRadosCtx *rctx = (RGWRadosCtx *)ctx;
uint64_t size = 0;
string etag;
+ string content_type;
bufferlist acl_bl;
int r = open_bucket_ctx(bucket, io_ctx);
if (name.compare(RGW_ATTR_ETAG) == 0) {
etag = bl.c_str();
+ } else if (name.compare(RGW_ATTR_CONTENT_TYPE) == 0) {
+ content_type = bl.c_str();
} else if (name.compare(RGW_ATTR_ACL) == 0) {
acl_bl = bl;
}
if (ret >= 0) {
ret = complete_update_index(bucket, dst_obj.object, tag, epoch, size,
- ut, etag, &acl_bl, category);
+ ut, etag, content_type, &acl_bl, category);
}
return ret;
call.meta.etag = ent.etag;
call.meta.owner = ent.owner;
call.meta.owner_display_name = ent.owner_display_name;
+ call.meta.content_type = ent.content_type;
call.meta.category = category;
::encode(call, in);
AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
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;
m[e.name] = e;
dout(0) << " got " << e.name << dendl;
}
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 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);
}