]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge remote branch 'origin/stable'
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 16 Jun 2011 00:43:35 +0000 (17:43 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 16 Jun 2011 00:43:35 +0000 (17:43 -0700)
1  2 
src/librbd.cc
src/osd/PG.cc

diff --cc src/librbd.cc
index 36da1ade9b76da2b02fde7f88036cf7200ff9c10,35f34c84c4962e56478cfe138b74ebfe2af3dc8d..d66dfcf92f0e2ddc39eaf026b3f04250e9c21385
@@@ -1326,12 -1327,11 +1350,13 @@@ int aio_write(ImageCtx *ictx, uint64_t 
    if (r < 0)
      return r;
  
+   c->get();
    for (uint64_t i = start_block; i <= end_block; i++) {
      bufferlist bl;
 -    string oid = get_block_oid(&ictx->header, i);
 -    uint64_t block_ofs = get_block_ofs(&ictx->header, off + total_write);
 +    ictx->lock.Lock();
 +    string oid = get_block_oid(ictx->header, i);
 +    uint64_t block_ofs = get_block_ofs(ictx->header, off + total_write);
 +    ictx->lock.Unlock();
      uint64_t write_len = min(block_size - block_ofs, left);
      bl.append(buf + total_write, write_len);
      AioBlockCompletion *block_completion = new AioBlockCompletion(c, off, len, NULL);
@@@ -1375,19 -1377,16 +1402,20 @@@ int aio_read(ImageCtx *ictx, uint64_t o
  
    int64_t ret;
    int total_read = 0;
 -  uint64_t start_block = get_block_num(&ictx->header, off);
 -  uint64_t end_block = get_block_num(&ictx->header, off + len);
 -  uint64_t block_size = get_block_size(&ictx->header);
 +  ictx->lock.Lock();
 +  uint64_t start_block = get_block_num(ictx->header, off);
 +  uint64_t end_block = get_block_num(ictx->header, off + len);
 +  uint64_t block_size = get_block_size(ictx->header);
 +  ictx->lock.Unlock();
    uint64_t left = len;
  
+   c->get();
    for (uint64_t i = start_block; i <= end_block; i++) {
      bufferlist bl;
 -    string oid = get_block_oid(&ictx->header, i);
 -    uint64_t block_ofs = get_block_ofs(&ictx->header, off + total_read);
 +    ictx->lock.Lock();
 +    string oid = get_block_oid(ictx->header, i);
 +    uint64_t block_ofs = get_block_ofs(ictx->header, off + total_read);
 +    ictx->lock.Unlock();
      uint64_t read_len = min(block_size - block_ofs, left);
  
      map<uint64_t,uint64_t> m;
diff --cc src/osd/PG.cc
Simple merge