Diff for /qemu/cutils.c between versions 1.1.1.4 and 1.1.1.5

version 1.1.1.4, 2018/04/24 17:20:27 version 1.1.1.5, 2018/04/24 17:34:00
Line 115  int qemu_fls(int i) Line 115  int qemu_fls(int i)
     return 32 - clz32(i);      return 32 - clz32(i);
 }  }
   
   /*
    * Make sure data goes on disk, but if possible do not bother to
    * write out the inode just for timestamp updates.
    *
    * Unfortunately even in 2009 many operating systems do not support
    * fdatasync and have to fall back to fsync.
    */
   int qemu_fdatasync(int fd)
   {
   #ifdef CONFIG_FDATASYNC
       return fdatasync(fd);
   #else
       return fsync(fd);
   #endif
   }
   
 /* io vectors */  /* io vectors */
   
 void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint)  void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint)
Line 151  void qemu_iovec_add(QEMUIOVector *qiov,  Line 167  void qemu_iovec_add(QEMUIOVector *qiov, 
     ++qiov->niov;      ++qiov->niov;
 }  }
   
   /*
    * Copies iovecs from src to the end dst until src is completely copied or the
    * total size of the copied iovec reaches size. The size of the last copied
    * iovec is changed in order to fit the specified total size if it isn't a
    * perfect fit already.
    */
   void qemu_iovec_concat(QEMUIOVector *dst, QEMUIOVector *src, size_t size)
   {
       int i;
       size_t done;
   
       assert(dst->nalloc != -1);
   
       done = 0;
       for (i = 0; (i < src->niov) && (done != size); i++) {
           if (done + src->iov[i].iov_len > size) {
               qemu_iovec_add(dst, src->iov[i].iov_base, size - done);
               break;
           } else {
               qemu_iovec_add(dst, src->iov[i].iov_base, src->iov[i].iov_len);
           }
           done += src->iov[i].iov_len;
       }
   }
   
 void qemu_iovec_destroy(QEMUIOVector *qiov)  void qemu_iovec_destroy(QEMUIOVector *qiov)
 {  {
     assert(qiov->nalloc != -1);      assert(qiov->nalloc != -1);

Removed from v.1.1.1.4  
changed lines
  Added in v.1.1.1.5


unix.superglobalmegacorp.com