summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-06-03 13:49:18 +0000
committermav <mav@FreeBSD.org>2011-06-03 13:49:18 +0000
commite43f9045296b6f5823d53836a7a651d2e678c070 (patch)
tree4d4954ebf4bee4290abfdd76aad49b4673927f14 /sys/geom
parentb37cdd581de9839703780a582cfe8488eabf3f5b (diff)
downloadFreeBSD-src-e43f9045296b6f5823d53836a7a651d2e678c070.zip
FreeBSD-src-e43f9045296b6f5823d53836a7a651d2e678c070.tar.gz
Update disk's stripesize and stripeoffset parameters on provider open.
They are media-dependent and may change in run-time, same as sectorsize and/or mediasize. SCSI devices return physical sector size and offset via READ CAPACITY(16) command and so can not report it until media inserted or at least until probe sequence completed. UNMAP support is also reported there.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_disk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index a051772..e663e3d 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -154,6 +154,12 @@ g_disk_access(struct g_provider *pp, int r, int w, int e)
}
pp->mediasize = dp->d_mediasize;
pp->sectorsize = dp->d_sectorsize;
+ if (dp->d_flags & DISKFLAG_CANDELETE)
+ pp->flags |= G_PF_CANDELETE;
+ else
+ pp->flags &= ~G_PF_CANDELETE;
+ pp->stripeoffset = dp->d_stripeoffset;
+ pp->stripesize = dp->d_stripesize;
dp->d_flags |= DISKFLAG_OPEN;
if (dp->d_maxsize == 0) {
printf("WARNING: Disk drive %s%d has no d_maxsize\n",
OpenPOWER on IntegriCloud