lkml.org 
[lkml]   [2011]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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".


\
 
 \ /
  Last update: 2011-02-25 16:41    [W:0.028 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site