WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 3/7] xen-blkfront: handle Xen major numbers other

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 3/7] xen-blkfront: handle Xen major numbers other than XENVBD
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Fri, 25 Feb 2011 15:38:35 +0000
Cc: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 25 Feb 2011 07:38:32 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110222191948.GA17866@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1102161739370.2826@kaball-desktop> <1297878787-378-3-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <20110222191948.GA17866@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Tue, 22 Feb 2011, Konrad Rzeszutek Wilk wrote:
> > @@ -120,6 +120,10 @@ static DEFINE_SPINLOCK(minor_lock);
> >  #define EXTENDED (1<<EXT_SHIFT)
> >  #define VDEV_IS_EXTENDED(dev) ((dev)&(EXTENDED))
> >  #define BLKIF_MINOR_EXT(dev) ((dev)&(~EXTENDED))
> > +#define EMULATED_HD_DISK_MINOR_OFFSET (0)
> > +#define EMULATED_HD_DISK_NAME_OFFSET (EMULATED_HD_DISK_MINOR_OFFSET / 256)
> 
> 0 / 256 ? Why not just 0?

Because if we set EMULATED_HD_DISK_MINOR_OFFSET to something different
from 0, then the divison by 256 would matter.
If you look at the code below you'll see that:

offset = minor / nr_parts;

where nr_parts is 256 and offset is the the device name offset.
EMULATED_HD_DISK_MINOR_OFFSET is the offset of the variable "minor" and
EMULATED_HD_DISK_NAME_OFFSET is the offset of the variable "offset".

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel