version 1.5, 2011/11/20 02:54:25 |
version 1.6, 2015/12/08 20:56:21 |
|
|
* Determine the actual size of the device. |
* Determine the actual size of the device. |
* XXXNETBSD wedges. |
* XXXNETBSD wedges. |
*/ |
*/ |
error = VOP_IOCTL(vp, DIOCGPART, &pinfo, FREAD|FWRITE, |
error = VOP_IOCTL(vp, DIOCGPARTINFO, &pinfo, FREAD|FWRITE, |
kauth_cred_get()); |
kauth_cred_get()); |
if (error != 0) { |
if (error != 0) { |
vrele(vp); |
vrele(vp); |
vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; |
vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; |
return error; |
return error; |
} |
} |
*psize = (uint64_t)pinfo.part->p_size * pinfo.disklab->d_secsize; |
*psize = pinfo.pi_size * pinfo.pi_secsize; |
*ashift = highbit(MAX(pinfo.disklab->d_secsize, SPA_MINBLOCKSIZE)) - 1; |
*ashift = highbit(MAX(pinfo.pi_secsize, SPA_MINBLOCKSIZE)) - 1; |
vd->vdev_wholedisk = (pinfo.part->p_offset == 0); /* XXXNETBSD */ |
vd->vdev_wholedisk = (pinfo.pi_offset == 0); /* XXXNETBSD */ |
|
|
/* |
/* |
* Create a workqueue to process cache-flushes concurrently. |
* Create a workqueue to process cache-flushes concurrently. |