Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2011 09:18:43 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r222921 - stable/8/sys/geom
Message-ID:  <201106100918.p5A9Ih4t018713@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Jun 10 09:18:43 2011
New Revision: 222921
URL: http://svn.freebsd.org/changeset/base/222921

Log:
  MFC r222652:
  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:
  stable/8/sys/geom/geom_disk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/geom/geom_disk.c
==============================================================================
--- stable/8/sys/geom/geom_disk.c	Fri Jun 10 09:12:09 2011	(r222920)
+++ stable/8/sys/geom/geom_disk.c	Fri Jun 10 09:18:43 2011	(r222921)
@@ -141,6 +141,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?201106100918.p5A9Ih4t018713>