qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Dongxu Wang <wdongxu@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, wdongxu@cn.ibm.com, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH V19 7/8] add-cow file format core code.
Date: Wed, 5 Jun 2013 16:21:27 +0200	[thread overview]
Message-ID: <20130605142127.GH31478@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1369908025-9556-8-git-send-email-wdongxu@linux.vnet.ibm.com>

On Thu, May 30, 2013 at 06:00:24PM +0800, Dongxu Wang wrote:
> +static coroutine_fn int add_cow_co_writev(BlockDriverState *bs,
> +                                          int64_t sector_num,
> +                                          int remaining_sectors,
> +                                          QEMUIOVector *qiov)
> +{
> +    BDRVAddCowState *s = bs->opaque;
> +    int ret = 0, i;
> +    QEMUIOVector hd_qiov;
> +    uint8_t *table;
> +    uint64_t offset;
> +    int mask = s->cluster_sectors - 1;
> +    int cluster_mask = s->cluster_size - 1;
> +    AddCowMeta *meta = NULL;
> +
> +    if (remaining_sectors == 0) {
> +        return ret;
> +    }
> +
> +    qemu_co_mutex_lock(&s->lock);
> +
> +    meta = g_malloc0(sizeof(*meta));
> +again:
> +    *meta = (AddCowMeta) {
> +        .next           = QLIST_FIRST(&s->cluster_allocs),
> +        .start_sector   = sector_num,
> +        .remaining_sectors  = remaining_sectors,
> +    };
> +    if (handle_dependencies(bs, sector_num, remaining_sectors) == -EAGAIN) {
> +        goto again;
> +    }
> +    qemu_co_queue_init(&meta->dependent_requests);
> +    QLIST_INSERT_HEAD(&s->cluster_allocs, meta, next_in_flight);
> +    qemu_iovec_init(&hd_qiov, qiov->niov);

hd_qiov is unused.

> +    ret = bdrv_co_writev(s->image_hd, sector_num, remaining_sectors, qiov);

s->lock is held so write requests block other requests, this is not
parallel.

  reply	other threads:[~2013-06-05 14:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 10:00 [Qemu-devel] [PATCH V19 0/8] add-cow file format Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 1/8] V18: docs: document for " Dongxu Wang
2013-06-03  1:48   ` Fam Zheng
2013-06-03  1:55     ` Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 2/8] make path_has_protocol non static Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 3/8] qed_read_string to bdrv_read_string Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 4/8] rename qcow2-cache.c to block-cache.c Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 5/8] Make block-cache.c be common interface Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 6/8] add debug event for add-cow Dongxu Wang
2013-06-05 13:35   ` Stefan Hajnoczi
2013-06-05 13:46   ` Kevin Wolf
2013-06-06  7:30     ` Stefan Hajnoczi
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 7/8] add-cow file format core code Dongxu Wang
2013-06-05 14:21   ` Stefan Hajnoczi [this message]
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 8/8] qemu-iotests: add add-cow iotests support Dongxu Wang
2013-06-03  1:47 ` [Qemu-devel] [PATCH V19 0/8] add-cow file format Fam Zheng
2013-07-22  5:10 ` Wenchao Xia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130605142127.GH31478@stefanha-thinkpad.muc.redhat.com \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wdongxu@cn.ibm.com \
    --cc=wdongxu@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).