]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bug fix: librados segmentation fault, extra modify supports aio_xxx() methods
authorminchen <minchen@ubuntukylin.com>
Sun, 30 Aug 2015 09:34:12 +0000 (17:34 +0800)
committerMin Chen <minchen@ubuntukylin.com>
Sun, 30 Aug 2015 09:40:18 +0000 (17:40 +0800)
Signed-off-by: Min Chen <minchen@ubuntukylin.com>
src/librados/IoCtxImpl.cc

index 50a600beb1b0e48477669e54161160dc3d5d9522..945dbec2126d75f0903fce8c740eef965f916112 100644 (file)
@@ -694,12 +694,12 @@ int librados::IoCtxImpl::aio_write(const object_t &oid, AioCompletionImpl *c,
   if (snap_seq != CEPH_NOSNAP)
     return -EROFS;
 
-  c->io = this;
-  queue_aio_write(c);
-
   Context *onack = new C_aio_Ack(c);
   Context *onsafe = new C_aio_Safe(c);
 
+  c->io = this;
+  queue_aio_write(c);
+
   c->tid = objecter->write(oid, oloc,
                  off, len, snapc, bl, ut, 0,
                  onack, onsafe, &c->objver);
@@ -718,12 +718,12 @@ int librados::IoCtxImpl::aio_append(const object_t &oid, AioCompletionImpl *c,
   if (snap_seq != CEPH_NOSNAP)
     return -EROFS;
 
-  c->io = this;
-  queue_aio_write(c);
-
   Context *onack = new C_aio_Ack(c);
   Context *onsafe = new C_aio_Safe(c);
 
+  c->io = this;
+  queue_aio_write(c);
+
   c->tid = objecter->append(oid, oloc,
                   len, snapc, bl, ut, 0,
                   onack, onsafe, &c->objver);
@@ -743,12 +743,12 @@ int librados::IoCtxImpl::aio_write_full(const object_t &oid,
   if (snap_seq != CEPH_NOSNAP)
     return -EROFS;
 
-  c->io = this;
-  queue_aio_write(c);
-
   Context *onack = new C_aio_Ack(c);
   Context *onsafe = new C_aio_Safe(c);
 
+  c->io = this;
+  queue_aio_write(c);
+
   c->tid = objecter->write_full(oid, oloc,
                       snapc, bl, ut, 0,
                       onack, onsafe, &c->objver);
@@ -764,12 +764,12 @@ int librados::IoCtxImpl::aio_remove(const object_t &oid, AioCompletionImpl *c)
   if (snap_seq != CEPH_NOSNAP)
     return -EROFS;
 
-  c->io = this;
-  queue_aio_write(c);
-
   Context *onack = new C_aio_Ack(c);
   Context *onsafe = new C_aio_Safe(c);
 
+  c->io = this;
+  queue_aio_write(c);
+
   c->tid = objecter->remove(oid, oloc,
                   snapc, ut, 0,
                   onack, onsafe, &c->objver);
@@ -781,9 +781,9 @@ int librados::IoCtxImpl::aio_remove(const object_t &oid, AioCompletionImpl *c)
 int librados::IoCtxImpl::aio_stat(const object_t& oid, AioCompletionImpl *c,
                                  uint64_t *psize, time_t *pmtime)
 {
-  c->io = this;
   C_aio_stat_Ack *onack = new C_aio_stat_Ack(c, pmtime);
 
+  c->io = this;
   c->tid = objecter->stat(oid, oloc,
                 snap_seq, psize, &onack->mtime, 0,
                 onack, &c->objver);