tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mount root hooks for non-disk-device devices



On Fri, Aug 12, 2022 at 05:31:31PM +1000, Simon Burge wrote:
>  - A new bdev/cdev device flag D_STORAGEPOOL, which indicates that the
>    device can contain other storage device.

I see from the diff that this is replacing the list of device type names
in raidframe's rf_find_raid_components().  but I don't think that this change
is actually an improvement.  it moves the knowledge of what kinds of disk devices
that raidframe wants to examine to look for its labels out of the raidframe code
and into every other block device driver.  if you really want to get rid of
this list of device types in the raidframe code then we should find
a better way to express the intent.


+mountroot_rootspec_hook_establish(const char *prefix,
+    device_t (*hookfn)(const char *), void (*printfn)(void))
+{
+       struct rootspec_hook_desc *hd;
+
+       hd = malloc(sizeof(*hd), M_DEVBUF, M_NOWAIT);
+       if (hd == NULL)
+               return (NULL);

is there any reason for this to be nowait?  all memory allocations should be
M_WAITOK / KM_SLEEP unless there's a good reason why you have to use nowait.

-Chuck


Home | Main Index | Thread Index | Old Index