is_read(false), blp(nullptr), out_buf(nullptr),
io(NULL), aio_write_seq(0), aio_write_list_item(this) { }
+ bool wants_ack() {
+ return is_read || callback_complete;
+ }
+
int set_complete_callback(void *cb_arg, rados_callback_t cb) {
lock.Lock();
callback_complete = cb;
if (snap_seq != CEPH_NOSNAP)
return -EROFS;
- Context *onack = new C_aio_Ack(c);
+ Context *onack = c->wants_ack() ? new C_aio_Ack(c) : NULL;
Context *oncommit = new C_aio_Safe(c);
c->io = this;
if (snap_seq != CEPH_NOSNAP)
return -EROFS;
- Context *onack = new C_aio_Ack(c);
+ Context *onack = c->wants_ack() ? new C_aio_Ack(c) : NULL;
Context *onsafe = new C_aio_Safe(c);
c->io = this;
if (snap_seq != CEPH_NOSNAP)
return -EROFS;
- Context *onack = new C_aio_Ack(c);
+ Context *onack = c->wants_ack() ? new C_aio_Ack(c) : NULL;
Context *onsafe = new C_aio_Safe(c);
c->io = this;
if (snap_seq != CEPH_NOSNAP)
return -EROFS;
- Context *onack = new C_aio_Ack(c);
+ Context *onack = c->wants_ack() ? new C_aio_Ack(c) : NULL;
Context *onsafe = new C_aio_Safe(c);
c->io = this;
if (snap_seq != CEPH_NOSNAP)
return -EROFS;
- Context *onack = new C_aio_Ack(c);
+ Context *onack = c->wants_ack() ? new C_aio_Ack(c) : NULL;
Context *onsafe = new C_aio_Safe(c);
c->io = this;
if (snap_seq != CEPH_NOSNAP)
return -EROFS;
- Context *onack = new C_aio_Ack(c);
+ Context *onack = c->wants_ack() ? new C_aio_Ack(c) : NULL;
Context *onsafe = new C_aio_Safe(c);
c->io = this;