Date: Tue, 14 Jun 2011 15:58:47 -0600 From: "Justin T. Gibbs" <gibbs@scsiguy.com> To: fs@freebsd.org Subject: [CFR][ZFS] Use vdev_path instead of vdev_physpath in sysevent Message-ID: <4DF7D997.8020100@scsiguy.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------030808090403080204000900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In spa_async_autoexpand(), we can avoid the creation of a valid devfs name (which is currently performed using Solaris' "/devices") by just using the vdev_path. Since the device is online, there is no benefit to using the physical path location. Further, the physical path data may include prefix data (e.g. physical path quality) that will require more code to strip out. -- Justin --------------030808090403080204000900 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="spa.diffs" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="spa.diffs" diff -u -r -x cscope.out -x out -x ctl -x compile vendor/FreeBSD/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c SpectraBSD/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c --- vendor/FreeBSD/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c 2011-02-28 13:51:27.986816115 -0700 +++ SpectraBSD/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c 2011-06-06 15:50:11.169668215 -0600 @@ -5051,7 +5067,6 @@ { sysevent_id_t eid; nvlist_t *attr; - char *physpath; if (!spa->spa_autoexpand) return; @@ -5061,20 +5076,16 @@ spa_async_autoexpand(spa, cvd); } - if (!vd->vdev_ops->vdev_op_leaf || vd->vdev_physpath == NULL) + if (!vd->vdev_ops->vdev_op_leaf || vd->vdev_path == NULL) return; - physpath = kmem_zalloc(MAXPATHLEN, KM_SLEEP); - (void) snprintf(physpath, MAXPATHLEN, "/devices%s", vd->vdev_physpath); - VERIFY(nvlist_alloc(&attr, NV_UNIQUE_NAME, KM_SLEEP) == 0); - VERIFY(nvlist_add_string(attr, DEV_PHYS_PATH, physpath) == 0); + VERIFY(nvlist_add_string(attr, DEV_PATH, vd->vdev_path) == 0); (void) ddi_log_sysevent(zfs_dip, SUNW_VENDOR, EC_DEV_STATUS, ESC_ZFS_VDEV_AUTOEXPAND, attr, &eid, DDI_SLEEP); nvlist_free(attr); - kmem_free(physpath, MAXPATHLEN); } static void --------------030808090403080204000900--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DF7D997.8020100>