Skip to content

Commit

Permalink
rgw: remove meaningless oid_rand
Browse files Browse the repository at this point in the history
We have no need to genarate an `oid_rand` and pass it into the `prepare`
function, which will do nothing with `oid_rand` as following:

```
  virtual int prepare(RGWRados *_store, string *oid_rand) {
    store = _store;
    return 0;
  }
```
On the other hand, the `RGWObjManifest::generator::create_begin` will
genarate a different rand `oid` suffix as well as we need.

Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
  • Loading branch information
Yan-waller committed Jun 30, 2016
1 parent 5cf6374 commit 13b631b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/rgw/rgw_op.cc
Expand Up @@ -2709,12 +2709,7 @@ void RGWPutObj::execute()
dispose_processor(processor);
processor = select_processor(*static_cast<RGWObjectCtx *>(s->obj_ctx), &multipart);

string oid_rand;
char buf[33];
gen_rand_alphanumeric(store->ctx(), buf, sizeof(buf) - 1);
oid_rand.append(buf);

op_ret = processor->prepare(store, &oid_rand);
op_ret = processor->prepare(store, NULL);
if (op_ret < 0) {
ldout(s->cct, 0) << "ERROR: processor->prepare() returned "
<< op_ret << dendl;
Expand Down

0 comments on commit 13b631b

Please sign in to comment.