From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIWM-0007LM-8z for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:19:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUIWL-0006Xv-74 for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:19:10 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:51758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIWL-0006Xd-1L for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:19:09 -0400 Received: by mail-pd0-f178.google.com with SMTP id w11so3664113pde.37 for ; Mon, 22 Apr 2013 08:19:08 -0700 (PDT) Message-ID: <517554DB.6060204@gmail.com> Date: Mon, 22 Apr 2013 23:18:51 +0800 From: Liu Yuan MIME-Version: 1.0 References: <1366613950-10918-1-git-send-email-namei.unix@gmail.com> <1366613950-10918-3-git-send-email-namei.unix@gmail.com> <20130422120007.GB21317@stefanha-thinkpad.redhat.com> <517528D2.1040409@gmail.com> <20130422150348.GC28049@stefanha-thinkpad.redhat.com> In-Reply-To: <20130422150348.GC28049@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] sheepdog: implement .bdrv_co_is_allocated() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Stefan Hajnoczi , sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, MORITA Kazutaka On 04/22/2013 11:03 PM, Stefan Hajnoczi wrote: > Imagine sector_num = 0 and nb_sectors = SD_DATA_OBJ_SIZE / BDRV_SECTOR_SIZE. > > start = 0 > end = 1 > > You don't want object 1, only object 0. Hmm, math, ouch. So nb_sectors include sector_num? What I mean is If [start, end] mean a range of sectors,so 1. nb_sectors = end - start + 1 (I assume this one) 2. nb_sectors = end - start (you meant this one?) which one is correct for .co_is_allocated? Thanks, Yuan