From owner-freebsd-fs@FreeBSD.ORG Tue Jun 14 21:58:54 2011 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 107A2106564A for ; Tue, 14 Jun 2011 21:58:54 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (mail.scsiguy.com [70.89.174.89]) by mx1.freebsd.org (Postfix) with ESMTP id BCB408FC08 for ; Tue, 14 Jun 2011 21:58:53 +0000 (UTC) Received: from Justins-MacBook-Pro.local (207-225-98-3.dia.static.qwest.net [207.225.98.3]) (authenticated bits=0) by aslan.scsiguy.com (8.14.4/8.14.4) with ESMTP id p5EM0EnE016000 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Tue, 14 Jun 2011 16:00:14 -0600 (MDT) (envelope-from gibbs@scsiguy.com) Message-ID: <4DF7D997.8020100@scsiguy.com> Date: Tue, 14 Jun 2011 15:58:47 -0600 From: "Justin T. Gibbs" User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: fs@freebsd.org Content-Type: multipart/mixed; boundary="------------030808090403080204000900" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (aslan.scsiguy.com [70.89.174.89]); Tue, 14 Jun 2011 16:00:14 -0600 (MDT) Cc: Subject: [CFR][ZFS] Use vdev_path instead of vdev_physpath in sysevent X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 21:58:54 -0000 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--