Return -1 from arc_shrinker_func()
[zfs.git] / module / zfs / arc.c
index 97c897d..62f167e 100644 (file)
@@ -501,7 +501,6 @@ struct arc_buf_hdr {
 
        kmutex_t                b_freeze_lock;
        zio_cksum_t             *b_freeze_cksum;
-       void                    *b_thawed;
 
        arc_buf_hdr_t           *b_hash_next;
        arc_buf_t               *b_buf;
@@ -1033,12 +1032,6 @@ arc_buf_thaw(arc_buf_t *buf)
                buf->b_hdr->b_freeze_cksum = NULL;
        }
 
-       if (zfs_flags & ZFS_DEBUG_MODIFY) {
-               if (buf->b_hdr->b_thawed)
-                       kmem_free(buf->b_hdr->b_thawed, 1);
-               buf->b_hdr->b_thawed = kmem_alloc(1, KM_SLEEP);
-       }
-
        mutex_exit(&buf->b_hdr->b_freeze_lock);
 }
 
@@ -1260,23 +1253,6 @@ arc_space_return(uint64_t space, arc_space_type_t type)
        atomic_add_64(&arc_size, -space);
 }
 
-void *
-arc_data_buf_alloc(uint64_t size)
-{
-       if (arc_evict_needed(ARC_BUFC_DATA))
-               cv_signal(&arc_reclaim_thr_cv);
-       atomic_add_64(&arc_size, size);
-       return (zio_data_buf_alloc(size));
-}
-
-void
-arc_data_buf_free(void *buf, uint64_t size)
-{
-       zio_data_buf_free(buf, size);
-       ASSERT(arc_size >= size);
-       atomic_add_64(&arc_size, -size);
-}
-
 arc_buf_t *
 arc_buf_alloc(spa_t *spa, int size, void *tag, arc_buf_contents_t type)
 {
@@ -1581,10 +1557,6 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr)
                kmem_free(hdr->b_freeze_cksum, sizeof (zio_cksum_t));
                hdr->b_freeze_cksum = NULL;
        }
-       if (hdr->b_thawed) {
-               kmem_free(hdr->b_thawed, 1);
-               hdr->b_thawed = NULL;
-       }
 
        ASSERT(!list_link_active(&hdr->b_arc_node));
        ASSERT3P(hdr->b_hash_next, ==, NULL);
@@ -2402,10 +2374,8 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
         */
        if (pages > 0) {
                arc_kmem_reap_now(ARC_RECLAIM_AGGR, ptob(sc->nr_to_scan));
-               pages = btop(arc_evictable_memory());
        } else {
                arc_kmem_reap_now(ARC_RECLAIM_CONS, ptob(sc->nr_to_scan));
-               pages = -1;
        }
 
        /*
@@ -2425,7 +2395,7 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
 
        mutex_exit(&arc_reclaim_thr_lock);
 
-       return (pages);
+       return (-1);
 }
 SPL_SHRINKER_CALLBACK_WRAPPER(arc_shrinker_func);