posix-aio-compat: Expand tabs that have crept in
This patch expands tabs on a few lines so the code formats nicely and follows the QEMU coding style. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
dc33bb3411
commit
b587a52c00
@ -35,7 +35,7 @@ struct qemu_paiocb {
|
|||||||
int aio_fildes;
|
int aio_fildes;
|
||||||
union {
|
union {
|
||||||
struct iovec *aio_iov;
|
struct iovec *aio_iov;
|
||||||
void *aio_ioctl_buf;
|
void *aio_ioctl_buf;
|
||||||
};
|
};
|
||||||
int aio_niov;
|
int aio_niov;
|
||||||
size_t aio_nbytes;
|
size_t aio_nbytes;
|
||||||
@ -119,21 +119,21 @@ static void thread_create(pthread_t *thread, pthread_attr_t *attr,
|
|||||||
|
|
||||||
static ssize_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)
|
static ssize_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = ioctl(aiocb->aio_fildes, aiocb->aio_ioctl_cmd, aiocb->aio_ioctl_buf);
|
ret = ioctl(aiocb->aio_fildes, aiocb->aio_ioctl_cmd, aiocb->aio_ioctl_buf);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This looks weird, but the aio code only consideres a request
|
* This looks weird, but the aio code only consideres a request
|
||||||
* successfull if it has written the number full number of bytes.
|
* successfull if it has written the number full number of bytes.
|
||||||
*
|
*
|
||||||
* Now we overload aio_nbytes as aio_ioctl_cmd for the ioctl command,
|
* Now we overload aio_nbytes as aio_ioctl_cmd for the ioctl command,
|
||||||
* so in fact we return the ioctl command here to make posix_aio_read()
|
* so in fact we return the ioctl command here to make posix_aio_read()
|
||||||
* happy..
|
* happy..
|
||||||
*/
|
*/
|
||||||
return aiocb->aio_nbytes;
|
return aiocb->aio_nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t handle_aiocb_flush(struct qemu_paiocb *aiocb)
|
static ssize_t handle_aiocb_flush(struct qemu_paiocb *aiocb)
|
||||||
@ -249,10 +249,10 @@ static ssize_t handle_aiocb_rw(struct qemu_paiocb *aiocb)
|
|||||||
* Try preadv/pwritev first and fall back to linearizing the
|
* Try preadv/pwritev first and fall back to linearizing the
|
||||||
* buffer if it's not supported.
|
* buffer if it's not supported.
|
||||||
*/
|
*/
|
||||||
if (preadv_present) {
|
if (preadv_present) {
|
||||||
nbytes = handle_aiocb_rw_vector(aiocb);
|
nbytes = handle_aiocb_rw_vector(aiocb);
|
||||||
if (nbytes == aiocb->aio_nbytes)
|
if (nbytes == aiocb->aio_nbytes)
|
||||||
return nbytes;
|
return nbytes;
|
||||||
if (nbytes < 0 && nbytes != -ENOSYS)
|
if (nbytes < 0 && nbytes != -ENOSYS)
|
||||||
return nbytes;
|
return nbytes;
|
||||||
preadv_present = 0;
|
preadv_present = 0;
|
||||||
@ -335,19 +335,19 @@ static void *aio_thread(void *unused)
|
|||||||
switch (aiocb->aio_type & QEMU_AIO_TYPE_MASK) {
|
switch (aiocb->aio_type & QEMU_AIO_TYPE_MASK) {
|
||||||
case QEMU_AIO_READ:
|
case QEMU_AIO_READ:
|
||||||
case QEMU_AIO_WRITE:
|
case QEMU_AIO_WRITE:
|
||||||
ret = handle_aiocb_rw(aiocb);
|
ret = handle_aiocb_rw(aiocb);
|
||||||
break;
|
break;
|
||||||
case QEMU_AIO_FLUSH:
|
case QEMU_AIO_FLUSH:
|
||||||
ret = handle_aiocb_flush(aiocb);
|
ret = handle_aiocb_flush(aiocb);
|
||||||
break;
|
break;
|
||||||
case QEMU_AIO_IOCTL:
|
case QEMU_AIO_IOCTL:
|
||||||
ret = handle_aiocb_ioctl(aiocb);
|
ret = handle_aiocb_ioctl(aiocb);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "invalid aio request (0x%x)\n", aiocb->aio_type);
|
fprintf(stderr, "invalid aio request (0x%x)\n", aiocb->aio_type);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&lock);
|
mutex_lock(&lock);
|
||||||
aiocb->ret = ret;
|
aiocb->ret = ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user