In article <n8do3t$ndb$1...@serpens.de>,
Michael van Elst <mlel...@serpens.de> wrote:
>chris...@astron.com (Christos Zoulas) writes:
>
>>It is not easy to go from dev_t -> device_t to exclude...
>
>Ideally its impossible because both aren't related. But
>the common idiom is to search for the device with the
>same name.
>
>Something like:
>
>bool is_the_dump_device(device_t dev)
>{
>       const char *driver;
>       device_t d;
>
>       if (bdev_type(dumpdev) != D_DISK)
>               return false;
>
>       driver = devswblk2name(major(dumpdev));
>       d = device_find_by_driver_unit(driver, DISKUNIT(dumpdev));
>
>       return d == dev;
>}

Yes.. Or we can revert my change to prevent detaching if DUMP and
document that you need to set nosync if you want to dump...

christos

Reply via email to