[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1102251528480.2156@kaball-desktop>
Date: Fri, 25 Feb 2011 15:38:35 +0000
From: Stefano Stabellini <stefano.stabellini@...citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC: Stefano Stabellini <Stefano.Stabellini@...citrix.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...rix.com>
Subject: Re: [PATCH 3/7] xen-blkfront: handle Xen major numbers other than
XENVBD
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".
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists