summaryrefslogtreecommitdiffstats
path: root/src/cls/rgw
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-04-16 07:49:26 +0200
committerYehuda Sadeh <yehuda@inktank.com>2013-05-08 19:57:46 +0200
commitb295c649597381bfd5e84450a4d4fb9678bcd62c (patch)
tree8f7e77c2d4514d2b5f1c2265d28a45ccaac22ade /src/cls/rgw
parentrgw: call rgw_store_user_info() with objv_tracker (diff)
downloadceph-b295c649597381bfd5e84450a4d4fb9678bcd62c.tar.xz
ceph-b295c649597381bfd5e84450a4d4fb9678bcd62c.zip
rgw: radosgw-admin bucket list --bucket lists bucket objects
Also lists tag for each object. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Diffstat (limited to 'src/cls/rgw')
-rw-r--r--src/cls/rgw/cls_rgw.cc1
-rw-r--r--src/cls/rgw/cls_rgw_types.cc4
-rw-r--r--src/cls/rgw/cls_rgw_types.h9
3 files changed, 10 insertions, 4 deletions
diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc
index ad2ab155346..461e40a662a 100644
--- a/src/cls/rgw/cls_rgw.cc
+++ b/src/cls/rgw/cls_rgw.cc
@@ -572,6 +572,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
entry.meta = meta;
entry.name = op.name;
entry.exists = true;
+ entry.tag = op.tag;
stats.num_entries++;
stats.total_size += meta.size;
stats.total_size_rounded += get_rounded_size(meta.size);
diff --git a/src/cls/rgw/cls_rgw_types.cc b/src/cls/rgw/cls_rgw_types.cc
index 07098be8681..e2b7a07f165 100644
--- a/src/cls/rgw/cls_rgw_types.cc
+++ b/src/cls/rgw/cls_rgw_types.cc
@@ -27,7 +27,6 @@ void rgw_bucket_dir_entry_meta::generate_test_instances(list<rgw_bucket_dir_entr
m->etag = "etag";
m->owner = "owner";
m->owner_display_name = "display name";
- m->tag = "tag";
m->content_type = "content/type";
o.push_back(m);
o.push_back(new rgw_bucket_dir_entry_meta);
@@ -41,7 +40,6 @@ void rgw_bucket_dir_entry_meta::dump(Formatter *f) const
f->dump_string("etag", etag);
f->dump_string("owner", owner);
f->dump_string("owner_display_name", owner_display_name);
- f->dump_string("tag", tag);
f->dump_string("content_type", content_type);
}
@@ -60,6 +58,7 @@ void rgw_bucket_dir_entry::generate_test_instances(list<rgw_bucket_dir_entry*>&
e->locator = "locator";
e->exists = true;
e->meta = *m;
+ e->tag = "tag";
o.push_back(e);
@@ -84,6 +83,7 @@ void rgw_bucket_dir_entry::dump(Formatter *f) const
f->open_object_section("meta");
meta.dump(f);
f->close_section();
+ f->dump_string("tag", tag);
map<string, struct rgw_bucket_pending_info>::const_iterator iter = pending_map.begin();
f->open_array_section("pending_map");
diff --git a/src/cls/rgw/cls_rgw_types.h b/src/cls/rgw/cls_rgw_types.h
index 430b1df662c..3f7abaff857 100644
--- a/src/cls/rgw/cls_rgw_types.h
+++ b/src/cls/rgw/cls_rgw_types.h
@@ -62,7 +62,6 @@ struct rgw_bucket_dir_entry_meta {
string etag;
string owner;
string owner_display_name;
- string tag;
string content_type;
rgw_bucket_dir_entry_meta() :
@@ -143,18 +142,21 @@ void decode_packed_val(T& val, bufferlist::iterator& bl)
::decode(v, bl);
val = v;
}
+ break;
case 2:
{
uint16_t v;
::decode(v, bl);
val = v;
}
+ break;
case 4:
{
uint32_t v;
::decode(v, bl);
val = v;
}
+ break;
case 8:
{
uint64_t v;
@@ -199,9 +201,10 @@ struct rgw_bucket_dir_entry {
struct rgw_bucket_dir_entry_meta meta;
map<string, struct rgw_bucket_pending_info> pending_map;
uint64_t index_ver;
+ string tag;
rgw_bucket_dir_entry() :
- exists(false) {}
+ exists(false), index_ver(0) {}
void encode(bufferlist &bl) const {
ENCODE_START(5, 3, bl);
@@ -212,6 +215,7 @@ struct rgw_bucket_dir_entry {
::encode(pending_map, bl);
::encode(locator, bl);
::encode_packed_val(index_ver, bl);
+ ::encode(tag, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
@@ -231,6 +235,7 @@ struct rgw_bucket_dir_entry {
}
if (struct_v >= 5) {
::decode_packed_val(index_ver, bl);
+ ::decode(tag, bl);
}
DECODE_FINISH(bl);
}