Skip to content

Commit

Permalink
Merge pull request ceph#46238 from Huber-ming/storage_class_in_checkd…
Browse files Browse the repository at this point in the history
…iskstate

rgw: check object storage_class when check_disk_state

Reviewed-by: Casey Bodley <[email protected]>
  • Loading branch information
cbodley authored Jun 8, 2022
2 parents 3811b17 + 4a2e553 commit 123b8a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rgw/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9262,6 +9262,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,

string etag;
string content_type;
string storage_class;
ACLOwner owner;

object.meta.size = astate->size;
Expand All @@ -9276,6 +9277,10 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,
if (iter != astate->attrset.end()) {
content_type = rgw_bl_str(iter->second);
}
iter = astate->attrset.find(RGW_ATTR_STORAGE_CLASS);
if (iter != astate->attrset.end()) {
storage_class = rgw_bl_str(iter->second);
}
iter = astate->attrset.find(RGW_ATTR_ACL);
if (iter != astate->attrset.end()) {
r = decode_policy(dpp, iter->second, &owner);
Expand Down Expand Up @@ -9304,6 +9309,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,

object.meta.etag = etag;
object.meta.content_type = content_type;
object.meta.storage_class = storage_class;
object.meta.owner = owner.get_id().to_str();
object.meta.owner_display_name = owner.get_display_name();

Expand All @@ -9315,6 +9321,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,
list_state.meta.category = main_category;
list_state.meta.etag = etag;
list_state.meta.content_type = content_type;
list_state.meta.storage_class = storage_class;

librados::IoCtx head_obj_ctx; // initialize to data pool so we can get pool id
int ret = get_obj_head_ioctx(dpp, bucket_info, obj->get_obj(), &head_obj_ctx);
Expand Down

0 comments on commit 123b8a3

Please sign in to comment.