1

Here is my code:

// init
int total;
struct aiocb aio;
bzero((char *)&aio, sizeof(struct aiocb));
aio.aio_buf = malloc(BUF_MAX1+1);
aio.aio_nbytes = BUF_MAX1;
aio.aio_fildes = write_file;
aio.aio_offset = 0;

int ret;
while (total <= 900008200){   // 858MB

    ret = aio_write(&aio);
    assert(ret >= 0);

    while ((ret = aio_error(&aio)) == EINPROGRESS);
    assert(ret == 0);

    int n;
    if ((n = aio_return(&aio)) > 0) {
        total += n;
        aio.aio_offset += n;
    } else {
        assert(0);
    }
}

When i run in ext4 filesystem, i got this results "total(900008200) time(12.63s)"

In btr filesystem the result is "total(900008200) time(27.42s)"

Yifan Wang
  • 504
  • 6
  • 13

0 Answers0