Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 2014 15:21:37 +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: r265821 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common
Message-ID:  <201405101521.s4AFLbTR074017@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat May 10 15:21:37 2014
New Revision: 265821
URL: http://svnweb.freebsd.org/changeset/base/265821

Log:
  Comment out some pointless device open/close around reading device IDs.
  
  FreeBSD ZFS port unlike OpenSolaris does not use device IDs, and does not
  implement respective devid_*() fuctions.  It is pointless to open devices
  just to close them back immediately.
  
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c	Sat May 10 14:47:53 2014	(r265820)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c	Sat May 10 15:21:37 2014	(r265821)
@@ -512,6 +512,7 @@ make_leaf_vdev(const char *arg, uint64_t
 		verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK,
 		    (uint64_t)wholedisk) == 0);
 
+#ifdef have_devid
 	/*
 	 * For a whole disk, defer getting its devid until after labeling it.
 	 */
@@ -546,6 +547,7 @@ make_leaf_vdev(const char *arg, uint64_t
 
 		(void) close(fd);
 	}
+#endif
 
 	return (vdev);
 }

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Sat May 10 14:47:53 2014	(r265820)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Sat May 10 15:21:37 2014	(r265821)
@@ -94,6 +94,7 @@ typedef struct pool_list {
 static char *
 get_devid(const char *path)
 {
+#ifdef have_devid
 	int fd;
 	ddi_devid_t devid;
 	char *minor, *ret;
@@ -113,6 +114,9 @@ get_devid(const char *path)
 	(void) close(fd);
 
 	return (ret);
+#else
+	return (NULL);
+#endif
 }
 
 

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Sat May 10 14:47:53 2014	(r265820)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Sat May 10 15:21:37 2014	(r265821)
@@ -3324,6 +3324,7 @@ devid_to_path(char *devid_str)
 static char *
 path_to_devid(const char *path)
 {
+#ifdef have_devid
 	int fd;
 	ddi_devid_t devid;
 	char *minor, *ret;
@@ -3343,6 +3344,9 @@ path_to_devid(const char *path)
 	(void) close(fd);
 
 	return (ret);
+#else
+	return (NULL);
+#endif
 }
 
 /*



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