Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Aug 2011 21:35:22 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r224855 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201108132135.p7DLZMR3033948@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Sat Aug 13 21:35:22 2011
New Revision: 224855
URL: http://svn.freebsd.org/changeset/base/224855

Log:
  zfs_ioctl.c: improve code readability in zfs_ioc_dataset_list_next()
  
  zvol.c: fix calling of dmu_objset_prefetch() in zvol_create_minors()
  by passing full instead of relative dataset name and prefetching all
  visible datasets to be processed later instead of just the pool name
  
  Reviewed by:	pjd
  Approved by:	re (kib)
  MFC after:	1 week
  > Reviewed by:   If someone else reviewed your modification.
  > Approved by:   If you needed approval for this commit.
  > Obtained from: If the change is from a third party.
  > MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
  > Security:      Vulnerability reference (one per line) or description.
  > Empty fields above will be automatically removed.
  
  M    opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  M    opensolaris/uts/common/fs/zfs/zvol.c

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Sat Aug 13 21:33:50 2011	(r224854)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Sat Aug 13 21:35:22 2011	(r224855)
@@ -1963,9 +1963,10 @@ top:
 		uint64_t cookie = 0;
 		int len = sizeof (zc->zc_name) - (p - zc->zc_name);
 
-		while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0)
-			if (dataset_name_hidden(zc->zc_name) == B_FALSE)
+		while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) {
+			if (!dataset_name_hidden(zc->zc_name))
 				(void) dmu_objset_prefetch(zc->zc_name, NULL);
+		}
 	}
 
 	do {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Aug 13 21:33:50 2011	(r224854)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Aug 13 21:35:22 2011	(r224855)
@@ -2197,11 +2197,11 @@ zvol_create_minors(const char *name)
 	p = osname + strlen(osname);
 	len = MAXPATHLEN - (p - osname);
 
-	if (strchr(name, '/') == NULL) {
-		/* Prefetch only for pool name. */
-		cookie = 0;
-		while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0)
-			(void) dmu_objset_prefetch(p, NULL);
+	/* Prefetch the datasets. */
+	cookie = 0;
+	while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) {
+		if (!dataset_name_hidden(osname))
+			(void) dmu_objset_prefetch(osname, NULL);
 	}
 
 	cookie = 0;



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