mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
geli: Move check for DEVT_DISK into geli_probe_and_attach
We only work on DEVT_DISK disks, so move that into the probe to drive the point home better. Sponsored by: Netflix
This commit is contained in:
parent
0080f30ff1
commit
bb3230e40b
|
@ -63,9 +63,7 @@ devopen(struct open_file *f, const char *fname, const char **file)
|
||||||
* pw if needed), this will attach the geli code to the open_file by
|
* pw if needed), this will attach the geli code to the open_file by
|
||||||
* replacing f->f_dev and f_devdata with pointers to a geli_devdesc.
|
* replacing f->f_dev and f_devdata with pointers to a geli_devdesc.
|
||||||
*/
|
*/
|
||||||
if (f->f_dev->dv_type == DEVT_DISK) {
|
geli_probe_and_attach(f);
|
||||||
geli_probe_and_attach(f);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|
|
@ -301,6 +301,9 @@ geli_probe_and_attach(struct open_file *f)
|
||||||
|
|
||||||
hdesc = (struct disk_devdesc *)(f->f_devdata);
|
hdesc = (struct disk_devdesc *)(f->f_devdata);
|
||||||
|
|
||||||
|
/* We only work on DEVT_DISKs */
|
||||||
|
if (hdesc->dd.d_dev->dv_type != DEVT_DISK)
|
||||||
|
return;
|
||||||
/* Get the last block number for the host provider. */
|
/* Get the last block number for the host provider. */
|
||||||
if (hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize) != 0)
|
if (hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue