提交 aa92d6c4 编写于 作者: P Paolo Bonzini 提交者: Fam Zheng

nfs: move nfs_set_events out of the while loops

nfs_set_events only needs to be called once before entering the
while loop; afterwards, nfs_process_read and nfs_process_write
take care of it.
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-Id: <1477565348-5458-9-git-send-email-pbonzini@redhat.com>
Signed-off-by: NFam Zheng <famz@redhat.com>
上级 88b062c2
......@@ -149,8 +149,8 @@ static int coroutine_fn nfs_co_readv(BlockDriverState *bs,
return -ENOMEM;
}
while (!task.complete) {
nfs_set_events(client);
while (!task.complete) {
qemu_coroutine_yield();
}
......@@ -191,8 +191,8 @@ static int coroutine_fn nfs_co_writev(BlockDriverState *bs,
return -ENOMEM;
}
while (!task.complete) {
nfs_set_events(client);
while (!task.complete) {
qemu_coroutine_yield();
}
......@@ -217,8 +217,8 @@ static int coroutine_fn nfs_co_flush(BlockDriverState *bs)
return -ENOMEM;
}
while (!task.complete) {
nfs_set_events(client);
while (!task.complete) {
qemu_coroutine_yield();
}
......@@ -513,8 +513,8 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs)
return -ENOMEM;
}
while (!task.complete) {
nfs_set_events(client);
while (!task.complete) {
aio_poll(client->aio_context, true);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册