rgw: No null_yield in rgw_torrent

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Adam C. Emerson 2020-11-11 12:13:50 -05:00
parent 7e7c3f5614
commit dec41841de
4 changed files with 8 additions and 7 deletions

View File

@ -4079,7 +4079,7 @@ void RGWPutObj::execute(optional_yield y)
{
torrent.init(s, store);
torrent.set_create_date(mtime);
op_ret = torrent.complete();
op_ret = torrent.complete(y);
if (0 != op_ret)
{
ldpp_dout(this, 0) << "ERROR: torrent.handle_data() returned " << op_ret << dendl;

View File

@ -102,7 +102,7 @@ void seed::update(bufferlist &bl)
sha1(&h, bl, bl.length());
}
int seed::complete()
int seed::complete(optional_yield y)
{
uint64_t remain = info.len%info.piece_length;
uint8_t remain_len = ((remain > 0)? 1 : 0);
@ -113,7 +113,7 @@ int seed::complete()
do_encode();
/* save torrent data into OMAP */
ret = save_torrent_file();
ret = save_torrent_file(y);
if (0 != ret)
{
ldout(s->cct, 0) << "ERROR: failed to save_torrent_file() ret= "<< ret << dendl;
@ -245,7 +245,7 @@ void seed::do_encode()
dencode.bencode_end(bl);
}
int seed::save_torrent_file()
int seed::save_torrent_file(optional_yield y)
{
int op_ret = 0;
string key = RGW_OBJ_TORRENT;
@ -257,7 +257,7 @@ int seed::save_torrent_file()
auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
auto sysobj = obj_ctx.get_obj(raw_obj);
op_ret = sysobj.omap().set(key, bl, null_yield);
op_ret = sysobj.omap().set(key, bl, y);
if (op_ret < 0)
{
ldout(s->cct, 0) << "ERROR: failed to omap_set() op_ret = " << op_ret << dendl;

View File

@ -129,7 +129,7 @@ public:
void set_create_date(ceph::real_time& value);
void set_info_name(const string& value);
void update(bufferlist &bl);
int complete();
int complete(optional_yield y);
private:
void do_encode ();
@ -137,6 +137,6 @@ private:
void set_exist(bool exist);
void set_info_pieces(char *buff);
void sha1(SHA1 *h, bufferlist &bl, off_t bl_len);
int save_torrent_file();
int save_torrent_file(optional_yield y);
};
#endif /* CEPH_RGW_TORRENT_H */

View File

@ -9,6 +9,7 @@
#include "common/Formatter.h"
#include "rgw_formats.h"
#include "rgw_user.h"
class RGWRados;