mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
rgw: No null_yield in rgw_torrent
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
parent
7e7c3f5614
commit
dec41841de
@ -4079,7 +4079,7 @@ void RGWPutObj::execute(optional_yield y)
|
|||||||
{
|
{
|
||||||
torrent.init(s, store);
|
torrent.init(s, store);
|
||||||
torrent.set_create_date(mtime);
|
torrent.set_create_date(mtime);
|
||||||
op_ret = torrent.complete();
|
op_ret = torrent.complete(y);
|
||||||
if (0 != op_ret)
|
if (0 != op_ret)
|
||||||
{
|
{
|
||||||
ldpp_dout(this, 0) << "ERROR: torrent.handle_data() returned " << op_ret << dendl;
|
ldpp_dout(this, 0) << "ERROR: torrent.handle_data() returned " << op_ret << dendl;
|
||||||
|
@ -102,7 +102,7 @@ void seed::update(bufferlist &bl)
|
|||||||
sha1(&h, bl, bl.length());
|
sha1(&h, bl, bl.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
int seed::complete()
|
int seed::complete(optional_yield y)
|
||||||
{
|
{
|
||||||
uint64_t remain = info.len%info.piece_length;
|
uint64_t remain = info.len%info.piece_length;
|
||||||
uint8_t remain_len = ((remain > 0)? 1 : 0);
|
uint8_t remain_len = ((remain > 0)? 1 : 0);
|
||||||
@ -113,7 +113,7 @@ int seed::complete()
|
|||||||
do_encode();
|
do_encode();
|
||||||
|
|
||||||
/* save torrent data into OMAP */
|
/* save torrent data into OMAP */
|
||||||
ret = save_torrent_file();
|
ret = save_torrent_file(y);
|
||||||
if (0 != ret)
|
if (0 != ret)
|
||||||
{
|
{
|
||||||
ldout(s->cct, 0) << "ERROR: failed to save_torrent_file() ret= "<< ret << dendl;
|
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);
|
dencode.bencode_end(bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
int seed::save_torrent_file()
|
int seed::save_torrent_file(optional_yield y)
|
||||||
{
|
{
|
||||||
int op_ret = 0;
|
int op_ret = 0;
|
||||||
string key = RGW_OBJ_TORRENT;
|
string key = RGW_OBJ_TORRENT;
|
||||||
@ -257,7 +257,7 @@ int seed::save_torrent_file()
|
|||||||
auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
|
auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
|
||||||
auto sysobj = obj_ctx.get_obj(raw_obj);
|
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)
|
if (op_ret < 0)
|
||||||
{
|
{
|
||||||
ldout(s->cct, 0) << "ERROR: failed to omap_set() op_ret = " << op_ret << dendl;
|
ldout(s->cct, 0) << "ERROR: failed to omap_set() op_ret = " << op_ret << dendl;
|
||||||
|
@ -129,7 +129,7 @@ public:
|
|||||||
void set_create_date(ceph::real_time& value);
|
void set_create_date(ceph::real_time& value);
|
||||||
void set_info_name(const string& value);
|
void set_info_name(const string& value);
|
||||||
void update(bufferlist &bl);
|
void update(bufferlist &bl);
|
||||||
int complete();
|
int complete(optional_yield y);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void do_encode ();
|
void do_encode ();
|
||||||
@ -137,6 +137,6 @@ private:
|
|||||||
void set_exist(bool exist);
|
void set_exist(bool exist);
|
||||||
void set_info_pieces(char *buff);
|
void set_info_pieces(char *buff);
|
||||||
void sha1(SHA1 *h, bufferlist &bl, off_t bl_len);
|
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 */
|
#endif /* CEPH_RGW_TORRENT_H */
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "common/Formatter.h"
|
#include "common/Formatter.h"
|
||||||
#include "rgw_formats.h"
|
#include "rgw_formats.h"
|
||||||
|
#include "rgw_user.h"
|
||||||
|
|
||||||
class RGWRados;
|
class RGWRados;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user