Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2011 13:49:18 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222652 - head/sys/geom
Message-ID:  <201106031349.p53DnI8M066550@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Jun  3 13:49:18 2011
New Revision: 222652
URL: http://svn.freebsd.org/changeset/base/222652

Log:
  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.

Modified:
  head/sys/geom/geom_disk.c

Modified: head/sys/geom/geom_disk.c
==============================================================================
--- head/sys/geom/geom_disk.c	Fri Jun  3 13:47:05 2011	(r222651)
+++ head/sys/geom/geom_disk.c	Fri Jun  3 13:49:18 2011	(r222652)
@@ -154,6 +154,12 @@ g_disk_access(struct g_provider *pp, int
 		}
 		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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106031349.p53DnI8M066550>