diff options
author | ivoras <ivoras@FreeBSD.org> | 2010-12-06 12:18:02 +0000 |
---|---|---|
committer | ivoras <ivoras@FreeBSD.org> | 2010-12-06 12:18:02 +0000 |
commit | e41ab538e48407fa736557b719bbee57f1425175 (patch) | |
tree | 07950c9521147cbf7b6a620d2d24dba4c47681ec /sys/cddl | |
parent | 49fb72e297bb1e730b57e70bcaa86a0b69151b66 (diff) | |
download | FreeBSD-src-e41ab538e48407fa736557b719bbee57f1425175.zip FreeBSD-src-e41ab538e48407fa736557b719bbee57f1425175.tar.gz |
Use GEOM stripesize field when calculating ashift. This will enable correct
alignment on drives with large sector sizes (e.g. 4 KiB) but the
implementation might need to be revisited if devices with large stripesizes
appear (e.g. if RAID controllers or flash drives start using the field),
probably by introducing a physsectorsize field in GEOM providers.
Discussed with: mav, mostly silence on freebsd-geom@ and freebsd-fs@
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c index d0d5137..36550a5 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c @@ -496,7 +496,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) /* * Determine the device's minimum transfer size. */ - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + if (pp->stripesize > pp->sectorsize) + *ashift = highbit(MIN(pp->stripesize, SPA_MAXBLOCKSIZE)) - 1; + else + *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; /* * Clear the nowritecache bit, so that on a vdev_reopen() we will |