@@ -1873,9 +1873,9 @@ int mirror_mode_set(librados::IoCtx *ioctx,
18731873 bufferlist in_bl;
18741874 encode (static_cast <uint32_t >(mirror_mode), in_bl);
18751875
1876- bufferlist out_bl ;
1877- int r = ioctx-> exec (RBD_MIRRORING, " rbd" , " mirror_mode_set" , in_bl,
1878- out_bl );
1876+ librados::ObjectWriteOperation op ;
1877+ op. exec (" rbd" , " mirror_mode_set" , in_bl);
1878+ int r = ioctx-> operate (RBD_MIRRORING, &op );
18791879 if (r < 0 ) {
18801880 return r;
18811881 }
@@ -2002,9 +2002,9 @@ int mirror_peer_remove(librados::IoCtx *ioctx,
20022002 bufferlist in_bl;
20032003 encode (uuid, in_bl);
20042004
2005- bufferlist out_bl ;
2006- int r = ioctx-> exec (RBD_MIRRORING, " rbd" , " mirror_peer_remove" , in_bl,
2007- out_bl );
2005+ librados::ObjectWriteOperation op ;
2006+ op. exec (" rbd" , " mirror_peer_remove" , in_bl);
2007+ int r = ioctx-> operate (RBD_MIRRORING, &op );
20082008 if (r < 0 ) {
20092009 return r;
20102010 }
@@ -2018,9 +2018,9 @@ int mirror_peer_set_client(librados::IoCtx *ioctx,
20182018 encode (uuid, in_bl);
20192019 encode (client_name, in_bl);
20202020
2021- bufferlist out_bl ;
2022- int r = ioctx-> exec (RBD_MIRRORING, " rbd" , " mirror_peer_set_client" ,
2023- in_bl, out_bl );
2021+ librados::ObjectWriteOperation op ;
2022+ op. exec (" rbd" , " mirror_peer_set_client" , in_bl);
2023+ int r = ioctx-> operate (RBD_MIRRORING, &op );
20242024 if (r < 0 ) {
20252025 return r;
20262026 }
@@ -2034,9 +2034,9 @@ int mirror_peer_set_cluster(librados::IoCtx *ioctx,
20342034 encode (uuid, in_bl);
20352035 encode (cluster_name, in_bl);
20362036
2037- bufferlist out_bl ;
2038- int r = ioctx-> exec (RBD_MIRRORING, " rbd" , " mirror_peer_set_cluster" ,
2039- in_bl, out_bl );
2037+ librados::ObjectWriteOperation op ;
2038+ op. exec (" rbd" , " mirror_peer_set_cluster" , in_bl);
2039+ int r = ioctx-> operate (RBD_MIRRORING, &op );
20402040 if (r < 0 ) {
20412041 return r;
20422042 }
@@ -2050,9 +2050,9 @@ int mirror_peer_set_direction(
20502050 encode (uuid, in_bl);
20512051 encode (static_cast <uint8_t >(mirror_peer_direction), in_bl);
20522052
2053- bufferlist out_bl ;
2054- int r = ioctx-> exec (RBD_MIRRORING, " rbd" , " mirror_peer_set_direction" ,
2055- in_bl, out_bl );
2053+ librados::ObjectWriteOperation op ;
2054+ op. exec (" rbd" , " mirror_peer_set_direction" , in_bl);
2055+ int r = ioctx-> operate (RBD_MIRRORING, &op );
20562056 if (r < 0 ) {
20572057 return r;
20582058 }
@@ -2630,39 +2630,47 @@ int group_dir_list(librados::IoCtx *ioctx, const std::string &oid,
26302630int group_dir_add (librados::IoCtx *ioctx, const std::string &oid,
26312631 const std::string &name, const std::string &id)
26322632{
2633- bufferlist in, out ;
2633+ bufferlist in;
26342634 encode (name, in);
26352635 encode (id, in);
2636- return ioctx->exec (oid, " rbd" , " group_dir_add" , in, out);
2636+ librados::ObjectWriteOperation op;
2637+ op.exec (" rbd" , " group_dir_add" , in);
2638+ return ioctx->operate (oid, &op);
26372639}
26382640
26392641int group_dir_rename (librados::IoCtx *ioctx, const std::string &oid,
26402642 const std::string &src, const std::string &dest,
26412643 const std::string &id)
26422644{
2643- bufferlist in, out ;
2645+ bufferlist in;
26442646 encode (src, in);
26452647 encode (dest, in);
26462648 encode (id, in);
2647- return ioctx->exec (oid, " rbd" , " group_dir_rename" , in, out);
2649+ librados::ObjectWriteOperation op;
2650+ op.exec (" rbd" , " group_dir_rename" , in);
2651+ return ioctx->operate (oid, &op);
26482652}
26492653
26502654int group_dir_remove (librados::IoCtx *ioctx, const std::string &oid,
26512655 const std::string &name, const std::string &id)
26522656{
2653- bufferlist in, out ;
2657+ bufferlist in;
26542658 encode (name, in);
26552659 encode (id, in);
2656- return ioctx->exec (oid, " rbd" , " group_dir_remove" , in, out);
2660+ librados::ObjectWriteOperation op;
2661+ op.exec (" rbd" , " group_dir_remove" , in);
2662+ return ioctx->operate (oid, &op);
26572663}
26582664
26592665int group_image_remove (librados::IoCtx *ioctx, const std::string &oid,
26602666 const cls::rbd::GroupImageSpec &spec)
26612667{
2662- bufferlist bl, bl2 ;
2668+ bufferlist bl;
26632669 encode (spec, bl);
26642670
2665- return ioctx->exec (oid, " rbd" , " group_image_remove" , bl, bl2);
2671+ librados::ObjectWriteOperation op;
2672+ op.exec (" rbd" , " group_image_remove" , bl);
2673+ return ioctx->operate (oid, &op);
26662674}
26672675
26682676int group_image_list (librados::IoCtx *ioctx,
@@ -2692,28 +2700,34 @@ int group_image_list(librados::IoCtx *ioctx,
26922700int group_image_set (librados::IoCtx *ioctx, const std::string &oid,
26932701 const cls::rbd::GroupImageStatus &st)
26942702{
2695- bufferlist bl, bl2 ;
2703+ bufferlist bl;
26962704 encode (st, bl);
26972705
2698- return ioctx->exec (oid, " rbd" , " group_image_set" , bl, bl2);
2706+ librados::ObjectWriteOperation op;
2707+ op.exec (" rbd" , " group_image_set" , bl);
2708+ return ioctx->operate (oid, &op);
26992709}
27002710
27012711int image_group_add (librados::IoCtx *ioctx, const std::string &oid,
27022712 const cls::rbd::GroupSpec &group_spec)
27032713{
2704- bufferlist bl, bl2 ;
2714+ bufferlist bl;
27052715 encode (group_spec, bl);
27062716
2707- return ioctx->exec (oid, " rbd" , " image_group_add" , bl, bl2);
2717+ librados::ObjectWriteOperation op;
2718+ op.exec (" rbd" , " image_group_add" , bl);
2719+ return ioctx->operate (oid, &op);
27082720}
27092721
27102722int image_group_remove (librados::IoCtx *ioctx, const std::string &oid,
27112723 const cls::rbd::GroupSpec &group_spec)
27122724{
2713- bufferlist bl, bl2 ;
2725+ bufferlist bl;
27142726 encode (group_spec, bl);
27152727
2716- return ioctx->exec (oid, " rbd" , " image_group_remove" , bl, bl2);
2728+ librados::ObjectWriteOperation op;
2729+ op.exec (" rbd" , " image_group_remove" , bl);
2730+ return ioctx->operate (oid, &op);
27172731}
27182732
27192733void image_group_get_start (librados::ObjectReadOperation *op)
@@ -2753,19 +2767,23 @@ int group_snap_set(librados::IoCtx *ioctx, const std::string &oid,
27532767 const cls::rbd::GroupSnapshot &snapshot)
27542768{
27552769 using ceph::encode;
2756- bufferlist inbl, outbl ;
2770+ bufferlist inbl;
27572771 encode (snapshot, inbl);
2758- int r = ioctx->exec (oid, " rbd" , " group_snap_set" , inbl, outbl);
2772+ librados::ObjectWriteOperation op;
2773+ op.exec (" rbd" , " group_snap_set" , inbl);
2774+ int r = ioctx->operate (oid, &op);
27592775 return r;
27602776}
27612777
27622778int group_snap_remove (librados::IoCtx *ioctx, const std::string &oid,
27632779 const std::string &snap_id)
27642780{
27652781 using ceph::encode;
2766- bufferlist inbl, outbl ;
2782+ bufferlist inbl;
27672783 encode (snap_id, inbl);
2768- return ioctx->exec (oid, " rbd" , " group_snap_remove" , inbl, outbl);
2784+ librados::ObjectWriteOperation op;
2785+ op.exec (" rbd" , " group_snap_remove" , inbl);
2786+ return ioctx->operate (oid, &op);
27692787}
27702788
27712789int group_snap_get_by_id (librados::IoCtx *ioctx, const std::string &oid,
0 commit comments