All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO
@ 2010-06-14  9:44 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-06-14  9:44 UTC (permalink / raw)
  To: Gerd Hoffmann, Kevin Wolf, FUJITA Tomonori
  Cc: Hannes Reinecke, Paul Brook, Christoph Hellwig, kvm-devel,
	qemu-devel, Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

This patch adds posix-aio-compat.c:paio_submit_len(), which is a identical
to paio_submit() expect that in expected nb_len instead of nb_sectors (* 512)
so that it can be used by BSG AIO for write()/read() of struct sg_io_v4.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 block/raw-posix-aio.h |    3 +++
 posix-aio-compat.c    |   28 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

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)
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO
@ 2010-06-14  9:44 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-06-14  9:44 UTC (permalink / raw)
  To: Gerd Hoffmann, Kevin Wolf, FUJITA Tomonori
  Cc: kvm-devel, qemu-devel, Nicholas Bellinger, Hannes Reinecke,
	Christoph Hellwig, Paul Brook

From: Nicholas Bellinger <nab@linux-iscsi.org>

This patch adds posix-aio-compat.c:paio_submit_len(), which is a identical
to paio_submit() expect that in expected nb_len instead of nb_sectors (* 512)
so that it can be used by BSG AIO for write()/read() of struct sg_io_v4.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 block/raw-posix-aio.h |    3 +++
 posix-aio-compat.c    |   28 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

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)
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO
  2010-06-14  9:44 ` [Qemu-devel] " Nicholas A. Bellinger
@ 2010-06-14 11:42   ` Christoph Hellwig
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2010-06-14 11:42 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: Gerd Hoffmann, Kevin Wolf, FUJITA Tomonori, Hannes Reinecke,
	Paul Brook, Christoph Hellwig, kvm-devel, qemu-devel

On Mon, Jun 14, 2010 at 02:44:31AM -0700, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> This patch adds posix-aio-compat.c:paio_submit_len(), which is a identical
> to paio_submit() expect that in expected nb_len instead of nb_sectors (* 512)
> so that it can be used by BSG AIO for write()/read() of struct sg_io_v4.

Jusre remove the nb_sectors argument, we already get the length passed
in the iovec.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] Re: [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO
@ 2010-06-14 11:42   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2010-06-14 11:42 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: Kevin Wolf, kvm-devel, Hannes Reinecke, qemu-devel,
	FUJITA Tomonori, Paul Brook, Christoph Hellwig, Gerd Hoffmann

On Mon, Jun 14, 2010 at 02:44:31AM -0700, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> This patch adds posix-aio-compat.c:paio_submit_len(), which is a identical
> to paio_submit() expect that in expected nb_len instead of nb_sectors (* 512)
> so that it can be used by BSG AIO for write()/read() of struct sg_io_v4.

Jusre remove the nb_sectors argument, we already get the length passed
in the iovec.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO
  2010-06-14 11:42   ` [Qemu-devel] " Christoph Hellwig
@ 2010-06-14 12:14     ` Nicholas A. Bellinger
  -1 siblings, 0 replies; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-06-14 12:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Gerd Hoffmann, Kevin Wolf, FUJITA Tomonori, Hannes Reinecke,
	Paul Brook, Christoph Hellwig, kvm-devel, qemu-devel

On Mon, 2010-06-14 at 07:42 -0400, Christoph Hellwig wrote:
> On Mon, Jun 14, 2010 at 02:44:31AM -0700, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@linux-iscsi.org>
> > 
> > This patch adds posix-aio-compat.c:paio_submit_len(), which is a identical
> > to paio_submit() expect that in expected nb_len instead of nb_sectors (* 512)
> > so that it can be used by BSG AIO for write()/read() of struct sg_io_v4.
> 
> Jusre remove the nb_sectors argument, we already get the length passed
> in the iovec.
> 

Mmmm, should this stay in a seperate paio_submit_len() function..?  Or
would it be preferred to calculate struct qemu_paiocb->aio_nbytes from
the passed iov[i].iov_len for the BlockDriverState->sg == BDS_BSG
case..?

Best,

--nab


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] Re: [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO
@ 2010-06-14 12:14     ` Nicholas A. Bellinger
  0 siblings, 0 replies; 6+ messages in thread
From: Nicholas A. Bellinger @ 2010-06-14 12:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Kevin Wolf, kvm-devel, Hannes Reinecke, qemu-devel,
	FUJITA Tomonori, Paul Brook, Christoph Hellwig, Gerd Hoffmann

On Mon, 2010-06-14 at 07:42 -0400, Christoph Hellwig wrote:
> On Mon, Jun 14, 2010 at 02:44:31AM -0700, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@linux-iscsi.org>
> > 
> > This patch adds posix-aio-compat.c:paio_submit_len(), which is a identical
> > to paio_submit() expect that in expected nb_len instead of nb_sectors (* 512)
> > so that it can be used by BSG AIO for write()/read() of struct sg_io_v4.
> 
> Jusre remove the nb_sectors argument, we already get the length passed
> in the iovec.
> 

Mmmm, should this stay in a seperate paio_submit_len() function..?  Or
would it be preferred to calculate struct qemu_paiocb->aio_nbytes from
the passed iov[i].iov_len for the BlockDriverState->sg == BDS_BSG
case..?

Best,

--nab

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-14 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-14  9:44 [PATCH 3/5] [block]: Add paio_submit_len() non sector sized AIO Nicholas A. Bellinger
2010-06-14  9:44 ` [Qemu-devel] " Nicholas A. Bellinger
2010-06-14 11:42 ` Christoph Hellwig
2010-06-14 11:42   ` [Qemu-devel] " Christoph Hellwig
2010-06-14 12:14   ` Nicholas A. Bellinger
2010-06-14 12:14     ` [Qemu-devel] " Nicholas A. Bellinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.