Add -p switch to "zpool get"
[zfs.git] / module / zfs / refcount.c
index 600132f..e43807c 100644 (file)
@@ -72,13 +72,13 @@ refcount_destroy_many(refcount_t *rc, uint64_t number)
        reference_t *ref;
 
        ASSERT(rc->rc_count == number);
-       while (ref = list_head(&rc->rc_list)) {
+       while ((ref = list_head(&rc->rc_list))) {
                list_remove(&rc->rc_list, ref);
                kmem_cache_free(reference_cache, ref);
        }
        list_destroy(&rc->rc_list);
 
-       while (ref = list_head(&rc->rc_removed)) {
+       while ((ref = list_head(&rc->rc_removed))) {
                list_remove(&rc->rc_removed, ref);
                kmem_cache_free(reference_history_cache, ref->ref_removed);
                kmem_cache_free(reference_cache, ref);
@@ -110,11 +110,11 @@ refcount_count(refcount_t *rc)
 int64_t
 refcount_add_many(refcount_t *rc, uint64_t number, void *holder)
 {
-       reference_t *ref;
+       reference_t *ref = NULL;
        int64_t count;
 
        if (reference_tracking_enable) {
-               ref = kmem_cache_alloc(reference_cache, KM_SLEEP);
+               ref = kmem_cache_alloc(reference_cache, KM_PUSHPAGE);
                ref->ref_holder = holder;
                ref->ref_number = number;
        }
@@ -158,7 +158,7 @@ refcount_remove_many(refcount_t *rc, uint64_t number, void *holder)
                        if (reference_history > 0) {
                                ref->ref_removed =
                                    kmem_cache_alloc(reference_history_cache,
-                                   KM_SLEEP);
+                                   KM_PUSHPAGE);
                                list_insert_head(&rc->rc_removed, ref);
                                rc->rc_removed_count++;
                                if (rc->rc_removed_count >= reference_history) {