* Re: Further madness in fs/partitions/check.c?
@ 2002-07-13 14:49 James Bottomley
2002-07-13 15:19 ` Thunder from the hill
0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2002-07-13 14:49 UTC (permalink / raw)
To: Thunder from the hill; +Cc: linux-kernel, James.Bottomley
> struct device contains a void * driver_data. It should certainly point
> to a couple of bytes where the driver data was saved.
> In line 288, we have this:
> current_driverfs_dev->driver_data = (void *)__mkdev(hd->major,
> minor+part);
> What kind of pointer should we get here? ;-)
> Can the author please explain what was intented here?
This is transient code to save the device in the driver_data. It is later
picked back out at line 229. It conforms to the old programmer principle that
if you can always guarantee your data takes up less space than a pointer (on
all archs), then you might as well just cast the data into the pointer instead
of wasting a malloc for it.
The driverfs code is still in flux. However, partition handling (if it
belongs anywhere at all) will probably be in the unwritten class handlers and
greatly tidied up.
The idea behind this code is to get a quick and dirty view of what partitions
might be seen as in driverfs and thus to stimulate debate about how they
should be done.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Further madness in fs/partitions/check.c?
2002-07-13 14:49 Further madness in fs/partitions/check.c? James Bottomley
@ 2002-07-13 15:19 ` Thunder from the hill
0 siblings, 0 replies; 3+ messages in thread
From: Thunder from the hill @ 2002-07-13 15:19 UTC (permalink / raw)
To: James Bottomley; +Cc: Linux Kernel Mailing List
Hi,
On Sat, 13 Jul 2002, James Bottomley wrote:
> This is transient code to save the device in the driver_data. It is
> later picked back out at line 229. It conforms to the old programmer
> principle that if you can always guarantee your data takes up less space
> than a pointer (on all archs), then you might as well just cast the data
> into the pointer instead of wasting a malloc for it.
However, it issues a warning.
Regards,
Thunder
--
(Use http://www.ebb.org/ungeek if you can't decode)
------BEGIN GEEK CODE BLOCK------
Version: 3.12
GCS/E/G/S/AT d- s++:-- a? C++$ ULAVHI++++$ P++$ L++++(+++++)$ E W-$
N--- o? K? w-- O- M V$ PS+ PE- Y- PGP+ t+ 5+ X+ R- !tv b++ DI? !D G
e++++ h* r--- y-
------END GEEK CODE BLOCK------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Further madness in fs/partitions/check.c?
@ 2002-07-13 3:31 Thunder from the hill
0 siblings, 0 replies; 3+ messages in thread
From: Thunder from the hill @ 2002-07-13 3:31 UTC (permalink / raw)
To: Linux Kernel Mailing List
Hi,
struct device contains a void * driver_data. It should certainly point to
a couple of bytes where the driver data was saved.
In line 288, we have this:
current_driverfs_dev->driver_data = (void *)__mkdev(hd->major, minor+part);
What kind of pointer should we get here? ;-)
Can the author please explain what was intented here?
Regards,
Thunder
--
(Use http://www.ebb.org/ungeek if you can't decode)
------BEGIN GEEK CODE BLOCK------
Version: 3.12
GCS/E/G/S/AT d- s++:-- a? C++$ ULAVHI++++$ P++$ L++++(+++++)$ E W-$
N--- o? K? w-- O- M V$ PS+ PE- Y- PGP+ t+ 5+ X+ R- !tv b++ DI? !D G
e++++ h* r--- y-
------END GEEK CODE BLOCK------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-07-13 15:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-13 14:49 Further madness in fs/partitions/check.c? James Bottomley
2002-07-13 15:19 ` Thunder from the hill
-- strict thread matches above, loose matches on Subject: below --
2002-07-13 3:31 Thunder from the hill
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.