All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Xen Devel <xen-devel@lists.xen.org>
Subject: Re: In blkif.h, sector unit is not clear
Date: Thu, 9 Oct 2014 10:14:17 +0100	[thread overview]
Message-ID: <1412846057.4463.3.camel@citrix.com> (raw)
In-Reply-To: <20141008162053.GB1742@perard.uk.xensource.com>

CCing Konrad who I think knows about this sort of stuff.

On Wed, 2014-10-08 at 17:20 +0100, Anthony PERARD wrote:
> I'm trying to understand the different device properties exposed on
> xenstore for a block device. And there is one property that is
> contradictory within blkif.h, "sectors". There are two possible units for
> it, either "sector-size" or 512-byte. Which one it is?
> 
> My guess is that it does not matter too much since "sector-size" is
> probably always reported as 512.

I'm not so sure of that once large enterprise arrays or iscsi etc get
into the picture.

> 
> Here is the interesting part of xen/include/public/io/blkif.h:
> 
> @@ -198,1 +198,1 @@
>   *------------------------- Backend Device Properties -------------------------
> @@ -241,18 +241,18 @@
>   * sector-size
>   *      Values:         <uint32_t>
>   *
>   *      The logical sector size, in bytes, of the backend device.
>   *
>   * physical-sector-size
>   *      Values:         <uint32_t>
>   *
>   *      The physical sector size, in bytes, of the backend device.
>   *
>   * sectors
>   *      Values:         <uint64_t>
>   *
>   *      The size of the backend device, expressed in units of its logical
>   *      sector size ("sector-size").
> 
> HERE: unit for "sectors" is "sector-size"
> 
> @@ -547,10 +547,10 @@
>  /*
>   * NB. first_sect and last_sect in blkif_request_segment, as well as
>   * sector_number in blkif_request, are always expressed in 512-byte units.
>   * However they must be properly aligned to the real sector size of the
>   * physical disk, which is reported in the "physical-sector-size" node in
>   * the backend xenbus info. Also the xenbus "sectors" node is expressed in
>   * 512-byte units.
>   */
>  struct blkif_request_segment {
>      grant_ref_t gref;        /* reference to I/O buffer frame        */
> 
> HERE: unit for "sectors" is 512-byte
> 
> 
> Regards,
> 

  reply	other threads:[~2014-10-09  9:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 16:20 In blkif.h, sector unit is not clear Anthony PERARD
2014-10-09  9:14 ` Ian Campbell [this message]
2014-10-10  8:13   ` Jan Beulich
2014-10-14 15:49 ` Konrad Rzeszutek Wilk

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=1412846057.4463.3.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /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.