All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Yuan <namei.unix@gmail.com>
To: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>,
	sheepdog@lists.wpkg.org, qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: implement .bdrv_co_is_allocated
Date: Mon, 22 Apr 2013 15:00:22 +0800	[thread overview]
Message-ID: <5174E006.4090104@gmail.com> (raw)
In-Reply-To: <874nezf6ik.wl%morita.kazutaka@lab.ntt.co.jp>

On 04/22/2013 02:01 PM, MORITA Kazutaka wrote:
> It looks better to use BDRV_SECTOR_SIZE .  I'd suggest preparing
> another patch to replace all the SECTOR_SIZE with BDRV_SECTOR_SIZE.
> 

Okay

>> > +                  end = start + (nb_sectors * SECTOR_SIZE) / SD_DATA_OBJ_SIZE;
> Using 'start' to calculate 'end' is wrong because 'start' may be
> rounded down.
> 

Good catch. Will updated it in v2

>> > +
>> > +    for (idx = start; idx <= end; idx++) {
>> > +        if (inode->data_vdi_id[idx] == 0) {
>> > +            break;
>> > +        }
>> > +    }
>> > +    if (idx == start) {
>> > +        *pnum = SD_DATA_OBJ_SIZE / SECTOR_SIZE;
> Isn't it better to set the longest length of the unallocated sectors?
> 

Good idea.

Thanks,
Yuan

      reply	other threads:[~2013-04-22  7:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 11:48 [Qemu-devel] [PATCH] sheepdog: implement .bdrv_co_is_allocated Liu Yuan
2013-04-22  3:36 ` Liu Yuan
2013-04-22  6:01 ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-22  7:00   ` Liu Yuan [this message]

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=5174E006.4090104@gmail.com \
    --to=namei.unix@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=morita.kazutaka@lab.ntt.co.jp \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog@lists.wpkg.org \
    --cc=stefanha@redhat.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 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.