Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Nov 2011 10:26:35 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r227703 - in stable/9/cddl/contrib/opensolaris: cmd/zdb head lib/libzpool/common
Message-ID:  <201111191026.pAJAQZIP038200@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sat Nov 19 10:26:34 2011
New Revision: 227703
URL: http://svn.freebsd.org/changeset/base/227703

Log:
  MFC r226613,r226615,r226616:
  
  r226613:
  
  libzpool task_alloc: pass only valid flags to kmem_alloc
  
  tqflags may contain other flags besided those that are suitable for
  kmem_alloc == umem_alloc
  
  Submitted by:	avg
  
  r226615:
  
  thr_create: new_thread_ID may be NULL
  
  Submitted by:	avg
  
  r226616:
  
  zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS
  
  Submitted by:	avg
  
  Approved by:	re (kib)

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  stable/9/cddl/contrib/opensolaris/head/thread.h
  stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Sat Nov 19 10:24:46 2011	(r227702)
+++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Sat Nov 19 10:26:34 2011	(r227703)
@@ -2190,8 +2190,10 @@ dump_block_stats(spa_t *spa)
 	 */
 	(void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj,
 	    count_block_cb, &zcb, NULL);
-	(void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
-	    count_block_cb, &zcb, NULL);
+	if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
+		(void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
+		    count_block_cb, &zcb, NULL);
+	}
 
 	if (dump_opt['c'] > 1)
 		flags |= TRAVERSE_PREFETCH_DATA;

Modified: stable/9/cddl/contrib/opensolaris/head/thread.h
==============================================================================
--- stable/9/cddl/contrib/opensolaris/head/thread.h	Sat Nov 19 10:24:46 2011	(r227702)
+++ stable/9/cddl/contrib/opensolaris/head/thread.h	Sat Nov 19 10:26:34 2011	(r227703)
@@ -76,6 +76,7 @@ static __inline int
 thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*),
     void *arg, long flags, thread_t *new_thread_ID)
 {
+	pthread_t dummy;
 	int ret;
 
 	assert(stack_base == NULL);
@@ -85,9 +86,12 @@ thr_create(void *stack_base, size_t stac
 	pthread_attr_t attr;
 	pthread_attr_init(&attr);
 
-	if(flags & THR_DETACHED)
+	if (flags & THR_DETACHED)
 		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
+	if (new_thread_ID == NULL)
+		new_thread_ID = &dummy;
+
 	/* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */
 
 	ret = pthread_create(new_thread_ID, &attr, start_func, arg);

Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c	Sat Nov 19 10:24:46 2011	(r227702)
+++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c	Sat Nov 19 10:26:34 2011	(r227703)
@@ -87,7 +87,7 @@ again:	if ((t = tq->tq_freelist) != NULL
 		}
 		mutex_exit(&tq->tq_lock);
 
-		t = kmem_alloc(sizeof (task_t), tqflags);
+		t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP);
 
 		mutex_enter(&tq->tq_lock);
 		if (t != NULL)



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