From patchwork Thu May 27 11:52:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 53722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9404CB7D1C for ; Thu, 27 May 2010 21:53:49 +1000 (EST) Received: from localhost ([127.0.0.1]:55042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHbej-0005ey-KR for incoming@patchwork.ozlabs.org; Thu, 27 May 2010 07:53:45 -0400 Received: from [140.186.70.92] (port=60511 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHbdW-0004Yn-VN for qemu-devel@nongnu.org; Thu, 27 May 2010 07:52:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHbdV-0006xI-I5 for qemu-devel@nongnu.org; Thu, 27 May 2010 07:52:30 -0400 Received: from mtagate4.de.ibm.com ([195.212.17.164]:47579) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHbdV-0006uq-AT for qemu-devel@nongnu.org; Thu, 27 May 2010 07:52:29 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.1/8.13.1) with ESMTP id o4RBqFAx031499 for ; Thu, 27 May 2010 11:52:15 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4RBqFbW1028328 for ; Thu, 27 May 2010 13:52:15 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o4RBqEPp013113 for ; Thu, 27 May 2010 13:52:14 +0200 Received: from stefan-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-37.manchester-maybrook.uk.ibm.com [9.174.219.37]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o4RBqEfP013095; Thu, 27 May 2010 13:52:14 +0200 From: Stefan Hajnoczi To: Date: Thu, 27 May 2010 12:52:08 +0100 Message-Id: <1274961128-3358-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Stefan Hajnoczi Subject: [Qemu-devel] [PATCH] posix-aio-compat: Expand tabs that have crept in X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch expands tabs on a few lines so the code formats nicely and follows the QEMU coding style. Signed-off-by: Stefan Hajnoczi --- posix-aio-compat.c | 58 ++++++++++++++++++++++++++-------------------------- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/posix-aio-compat.c b/posix-aio-compat.c index b43c531..a67ffe3 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -35,7 +35,7 @@ struct qemu_paiocb { int aio_fildes; union { struct iovec *aio_iov; - void *aio_ioctl_buf; + void *aio_ioctl_buf; }; int aio_niov; 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) { - int ret; - - ret = ioctl(aiocb->aio_fildes, aiocb->aio_ioctl_cmd, aiocb->aio_ioctl_buf); - if (ret == -1) - return -errno; - - /* - * This looks weird, but the aio code only consideres a request - * successfull if it has written the number full number of bytes. - * - * 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() - * happy.. - */ - return aiocb->aio_nbytes; + int ret; + + ret = ioctl(aiocb->aio_fildes, aiocb->aio_ioctl_cmd, aiocb->aio_ioctl_buf); + if (ret == -1) + return -errno; + + /* + * This looks weird, but the aio code only consideres a request + * successfull if it has written the number full number of bytes. + * + * 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() + * happy.. + */ + return aiocb->aio_nbytes; } 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 * buffer if it's not supported. */ - if (preadv_present) { + if (preadv_present) { nbytes = handle_aiocb_rw_vector(aiocb); if (nbytes == aiocb->aio_nbytes) - return nbytes; + return nbytes; if (nbytes < 0 && nbytes != -ENOSYS) return nbytes; preadv_present = 0; @@ -335,19 +335,19 @@ static void *aio_thread(void *unused) switch (aiocb->aio_type & QEMU_AIO_TYPE_MASK) { case QEMU_AIO_READ: case QEMU_AIO_WRITE: - ret = handle_aiocb_rw(aiocb); - break; + ret = handle_aiocb_rw(aiocb); + break; case QEMU_AIO_FLUSH: - ret = handle_aiocb_flush(aiocb); - break; + ret = handle_aiocb_flush(aiocb); + break; case QEMU_AIO_IOCTL: - ret = handle_aiocb_ioctl(aiocb); - break; - default: - fprintf(stderr, "invalid aio request (0x%x)\n", aiocb->aio_type); - ret = -EINVAL; - break; - } + ret = handle_aiocb_ioctl(aiocb); + break; + default: + fprintf(stderr, "invalid aio request (0x%x)\n", aiocb->aio_type); + ret = -EINVAL; + break; + } mutex_lock(&lock); aiocb->ret = ret;