Re: Further madness in fs/partitions/check.c?

From: James Bottomley (James.Bottomley@steeleye.com)
Date: Sat Jul 13 2002 - 09:49:37 EST


> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:26 EST