summaryrefslogtreecommitdiff
path: root/src/cls_rgw.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda.sadeh@dreamhost.com>2011-09-23 14:38:06 -0700
committerYehuda Sadeh <yehuda.sadeh@dreamhost.com>2011-09-23 14:38:06 -0700
commit3b5cb69d20826f055c1f79542ed7bef11905ca0c (patch)
tree2f3e267dcb5e9cda2e98169685e08ce0587dab64 /src/cls_rgw.cc
parent2ffb04ba64084245398a5323c29404f78c6d0ebf (diff)
downloadceph-3b5cb69d20826f055c1f79542ed7bef11905ca0c.tar.gz
cls_rgw: list entries return upper_bound of marker
Diffstat (limited to 'src/cls_rgw.cc')
-rw-r--r--src/cls_rgw.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/cls_rgw.cc b/src/cls_rgw.cc
index 3f9fb1c9d1a..1178a4a48a9 100644
--- a/src/cls_rgw.cc
+++ b/src/cls_rgw.cc
@@ -46,7 +46,7 @@ static int read_bucket_dir(cls_method_context_t hctx, struct rgw_bucket_dir& dir
bufferlist::iterator iter = bl.begin();
::decode(dir, iter);
} catch (buffer::error& err) {
- CLS_LOG("ERROR: rgw_bucket_list(): failed to decode buffer\n");
+ CLS_LOG("ERROR: read_bucket_dir(): failed to decode buffer\n");
return -EIO;
}
@@ -86,7 +86,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
struct rgw_bucket_dir& new_dir = ret.dir;
new_dir.header = dir.header;
std::map<string, struct rgw_bucket_dir_entry>& m = new_dir.m;
- std::map<string, struct rgw_bucket_dir_entry>::iterator miter = dir.m.lower_bound(op.start_obj);
+ std::map<string, struct rgw_bucket_dir_entry>::iterator miter = dir.m.upper_bound(op.start_obj);
uint32_t i;
for (i = 0; i != op.num_entries && miter != dir.m.end(); ++i, ++miter) {
m[miter->first] = miter->second;
@@ -136,7 +136,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
CLS_LOG("ERROR: rgw_bucket_prepare_op(): failed to decode request\n");
return -EINVAL;
}
- CLS_LOG("rgw_bucket_prepare_op(): request: op=%d name=%s\n", op.op, op.name.c_str());
+ CLS_LOG("rgw_bucket_prepare_op(): request: op=%d name=%s tag=%s\n", op.op, op.name.c_str(), op.tag.c_str());
std::map<string, struct rgw_bucket_dir_entry>::iterator miter = dir.m.find(op.name);
struct rgw_bucket_dir_entry *entry = NULL;
@@ -175,17 +175,18 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
if (rc < 0)
return rc;
+ CLS_LOG("rgw_bucket_complete_op(): dir.m.size()=%lld", dir.m.size());
+
rgw_cls_obj_complete_op op;
bufferlist::iterator iter = in->begin();
try {
::decode(op, iter);
} catch (buffer::error& err) {
- CLS_LOG("ERROR: rgw_bucket_modify(): failed to decode request\n");
+ CLS_LOG("ERROR: rgw_bucket_complete_op(): failed to decode request\n");
return -EINVAL;
}
- CLS_LOG("rgw_bucket_modify(): request: op=%d name=%s epoch=%lld\n", op.op, op.name.c_str(), op.epoch);
-
+ CLS_LOG("rgw_bucket_complete_op(): request: op=%d name=%s epoch=%lld tag=%s\n", op.op, op.name.c_str(), op.epoch, op.tag.c_str());
std::map<string, struct rgw_bucket_dir_entry>::iterator miter = dir.m.find(op.name);
struct rgw_bucket_dir_entry *entry = NULL;
@@ -193,9 +194,9 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
if (miter != dir.m.end()) {
entry = &miter->second;
- CLS_LOG("rgw_bucket_modify(): existing entry: epoch=%lld\n", entry->epoch);
+ CLS_LOG("rgw_bucket_complete_op(): existing entry: epoch=%lld\n", entry->epoch);
if (op.epoch <= entry->epoch) {
- CLS_LOG("rgw_bucket_modify(): skipping request, old epoch\n");
+ CLS_LOG("rgw_bucket_complete_op(): skipping request, old epoch\n");
return 0;
}