From patchwork Mon Jun 14 09:44:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 105906 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5E9iNmb029234 for ; Mon, 14 Jun 2010 09:44:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755912Ab0FNJoH (ORCPT ); Mon, 14 Jun 2010 05:44:07 -0400 Received: from smtp128.sbc.mail.sp1.yahoo.com ([69.147.65.187]:32764 "HELO smtp128.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753234Ab0FNJoG (ORCPT ); Mon, 14 Jun 2010 05:44:06 -0400 Received: (qmail 38021 invoked from network); 14 Jun 2010 09:44:04 -0000 Received: from adsl-70-231-239-201.dsl.snfc21.sbcglobal.net (nab@70.231.239.201 with login) by smtp128.sbc.mail.sp1.yahoo.com with SMTP; 14 Jun 2010 02:44:04 -0700 PDT X-Yahoo-SMTP: fzDSGlOswBCWnIOrNw7KwwK1j9PqyNbe5PtLKiS4dDU.UNl_t6bdEZu9tTLW X-YMail-OSG: CSygGqsVM1ksWOa1r.QNhHi7ArCAAtSChWETtwVTUK_S0uKo_vC8ElGB00p5eiBm1wGJ4qdyJZeplEwGFIdCT4GqnW3rPvIpGyjRrMPUtBdGwS_NwMFnYUVC5v4v6uP3rCyp62.O164FQQ5tIwal.DHNgUMQya6V_ucHuiFkI_X2zpdWGJvPmZ8POt5U9VLqdB65FCw9t8ZiefHxMlGLt.xOX2YuFl0TpA.yMAieMHEkRkfLLBCMW_Q_o0p1Mtl4lZOfn9s_I6lo7IB2tP7ltK3LcQrbl_5GAH3_icpJRXD5n6MYxjlld2nFhaNLI2z3UGIVVplDjXXW3pSytwo7VENjQjSmhnKObRP5Seul8jepWg-- X-Yahoo-Newman-Property: ymail-3 From: "Nicholas A. Bellinger" To: Gerd Hoffmann , Kevin Wolf , FUJITA Tomonori Cc: Hannes Reinecke , Paul Brook , Christoph Hellwig , kvm-devel , qemu-devel , Nicholas Bellinger Subject: [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO Date: Mon, 14 Jun 2010 02:44:31 -0700 Message-Id: <1276508671-3062-1-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.5.6.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 14 Jun 2010 09:44:23 +0000 (UTC) diff --git a/block/raw-posix-aio.h b/block/raw-posix-aio.h index dfc63b8..29df842 100644 --- a/block/raw-posix-aio.h +++ b/block/raw-posix-aio.h @@ -30,6 +30,9 @@ int paio_init(void); BlockDriverAIOCB *paio_submit(BlockDriverState *bs, int fd, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, int type); +BlockDriverAIOCB *paio_submit_len(BlockDriverState *bs, int fd, + int64_t sector_num, QEMUIOVector *qiov, int nb_len, + BlockDriverCompletionFunc *cb, void *opaque, int type); BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd, unsigned long int req, void *buf, BlockDriverCompletionFunc *cb, void *opaque); diff --git a/posix-aio-compat.c b/posix-aio-compat.c index 272e998..ac9276c 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -585,6 +585,34 @@ BlockDriverAIOCB *paio_submit(BlockDriverState *bs, int fd, return &acb->common; } +BlockDriverAIOCB *paio_submit_len(BlockDriverState *bs, int fd, + int64_t sector_num, QEMUIOVector *qiov, int nb_len, + BlockDriverCompletionFunc *cb, void *opaque, int type) +{ + struct qemu_paiocb *acb; + + acb = qemu_aio_get(&raw_aio_pool, bs, cb, opaque); + if (!acb) + return NULL; + acb->aio_type = type; + acb->aio_fildes = fd; + acb->ev_signo = SIGUSR2; + acb->async_context_id = get_async_context_id(); + + if (qiov) { + acb->aio_iov = qiov->iov; + acb->aio_niov = qiov->niov; + } + acb->aio_nbytes = nb_len; + acb->aio_offset = 0; + + acb->next = posix_aio_state->first_aio; + posix_aio_state->first_aio = acb; + + qemu_paio_submit(acb); + return &acb->common; +} + BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd, unsigned long int req, void *buf, BlockDriverCompletionFunc *cb, void *opaque)