snprintf(buf, 32, ".%d", i);
obj_names[i].append(buf);
}
+
+#define COOKIE_LEN 16
+ char cookie_buf[COOKIE_LEN + 1];
+ gen_rand_alphanumeric(cct, cookie_buf, sizeof(cookie_buf) - 1);
+ cookie = cookie_buf;
}
void RGWLC::finalize()
pair<string, int >& entry, int& result)
{
rados::cls::lock::Lock l(lc_index_lock_name);
+ l.set_cookie(cookie);
do {
int ret = l.lock_exclusive(&store->lc_pool_ctx, obj_names[index]);
if (ret == -EBUSY) { /* already locked by another lc processor */
int max_objs;
string *obj_names;
atomic_t down_flag;
+ string cookie;
class LCWorker : public Thread {
CephContext *cct;
rados::cls::lock::Lock l(lc_index_lock_name);
utime_t time(max_lock_secs, 0);
l.set_duration(time);
+ l.set_cookie(cookie);
librados::IoCtx *ctx = store->get_lc_pool_ctx();
do {
ret = l.lock_exclusive(ctx, oid);
int ret;
size_t len;
char *data;
+ string cookie;
public:
RGWPutLC() {
free(data);
}
+ virtual void init(RGWRados *store, struct req_state *s, RGWHandler *dialect_handler) {
+#define COOKIE_LEN 16
+ char buf[COOKIE_LEN + 1];
+
+ RGWOp::init(store, s, dialect_handler);
+ gen_rand_alphanumeric(s->cct, buf, sizeof(buf) - 1);
+ cookie = buf;
+ }
+
int verify_permission();
void pre_exec();
void execute();