On Tue, Sep 02, 2008 at 09:12:04PM +0200, Christian Franke wrote:
> 
> If disk->id is supposed to be a GUID ('Grub Unique Identifier' in this 
> case :-), then a pointer to the private data structure for the disk 
> should work. This id is unique until disk close.
> 
> For drivers without disk->data, simply use the address of e.g. the open 
> function itself.

This is fine for single-disk drivers, but for multi-disk ones we need it to
be unique among different disks provided by the same driver.

Although, of course, I don't see why can't we just make it use a pointer to
itself:

  disk->id = (unsigned long) &disk->id;

but then what's the point of storing that in a variable anyway.  We might as
well just remove this variable and whoever uses it can use a pointer to the
structure instead?

This works on the assumption that disk structures are never reallocated, but
I suppose that's a sane thing to assume...

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to