Re: [PATCH] fix disk->id abuse

2008-09-02 Thread Christian Franke
Robert Millan wrote: 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 wit

Re: [PATCH] fix disk->id abuse

2008-09-02 Thread Robert Millan
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->dat

Re: [PATCH] fix disk->id abuse

2008-09-02 Thread Robert Millan
On Tue, Sep 02, 2008 at 03:55:18PM +0200, Marco Gerards wrote: > > [...] > > >> We could write a macro for ID comparison that would compare both the > >> "driver ID" (disk->dev->id) and "device ID" (disk->id). In this case, > >> we can omit disk->id initialization in the drivers supporting only

Re: [PATCH] fix disk->id abuse

2008-09-02 Thread Christian Franke
Marco Gerards wrote: [...] We could write a macro for ID comparison that would compare both the "driver ID" (disk->dev->id) and "device ID" (disk->id). In this case, we can omit disk->id initialization in the drivers supporting only one device (e.g. memdisk) and only leave it where it's ind

Re: [PATCH] fix disk->id abuse

2008-09-02 Thread Marco Gerards
[...] >> We could write a macro for ID comparison that would compare both the >> "driver ID" (disk->dev->id) and "device ID" (disk->id). In this case, >> we can omit disk->id initialization in the drivers supporting only one >> device (e.g. memdisk) and only leave it where it's indeed needed for

Re: [PATCH] fix disk->id abuse

2008-09-02 Thread Robert Millan
On Mon, Sep 01, 2008 at 07:39:29PM -0400, Pavel Roskin wrote: > On Sun, 2008-08-31 at 15:33 +0200, Robert Millan wrote: > > On Sat, Aug 30, 2008 at 11:41:18AM -0400, Pavel Roskin wrote: > > > Quoting Robert Millan <[EMAIL PROTECTED]>: > > > > > > >So this patch means to solve both issues; makes s

Re: [PATCH] fix disk->id abuse

2008-09-01 Thread Pavel Roskin
On Sun, 2008-08-31 at 15:33 +0200, Robert Millan wrote: > On Sat, Aug 30, 2008 at 11:41:18AM -0400, Pavel Roskin wrote: > > Quoting Robert Millan <[EMAIL PROTECTED]>: > > > > >So this patch means to solve both issues; makes single-disk drivers use a > > >constant directly (since a pointer to stri

Re: [PATCH] fix disk->id abuse

2008-08-31 Thread Robert Millan
On Sat, Aug 30, 2008 at 11:41:18AM -0400, Pavel Roskin wrote: > Quoting Robert Millan <[EMAIL PROTECTED]>: > > >So this patch means to solve both issues; makes single-disk drivers use a > >constant directly (since a pointer to string is meaningless and confusing), > >and disk/scsi.c use LUNs whic

Re: [PATCH] fix disk->id abuse

2008-08-30 Thread Pavel Roskin
Quoting Robert Millan <[EMAIL PROTECTED]>: So this patch means to solve both issues; makes single-disk drivers use a constant directly (since a pointer to string is meaningless and confusing), and disk/scsi.c use LUNs which (I believe) will work as unique identifiers. Multi-character constant

[PATCH] fix disk->id abuse

2008-08-30 Thread Robert Millan
disk->id is supposed to be filled with a per-disk value so that the disk cache manager can identify individual disks. For single-disk drivers, a constant is enough. But it seems someone started using pointers to strings for them, and then we all (including me) copied. Then I see disk/scsi.c doi