Fix gcc unused variable warnings
[zfs.git] / module / zfs / arc.c
index 6b57f51..96c3fb7 100644 (file)
@@ -1143,6 +1143,8 @@ arc_space_consume(uint64_t space, arc_space_type_t type)
        ASSERT(type >= 0 && type < ARC_SPACE_NUMTYPES);
 
        switch (type) {
+       default:
+               break;
        case ARC_SPACE_DATA:
                ARCSTAT_INCR(arcstat_data_size, space);
                break;
@@ -1167,6 +1169,8 @@ arc_space_return(uint64_t space, arc_space_type_t type)
        ASSERT(type >= 0 && type < ARC_SPACE_NUMTYPES);
 
        switch (type) {
+       default:
+               break;
        case ARC_SPACE_DATA:
                ARCSTAT_INCR(arcstat_data_size, -space);
                break;
@@ -1745,13 +1749,14 @@ static void
 arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes)
 {
        arc_buf_hdr_t *ab, *ab_prev;
-       arc_buf_hdr_t marker = { 0 };
+       arc_buf_hdr_t marker;
        list_t *list = &state->arcs_list[ARC_BUFC_DATA];
        kmutex_t *hash_lock;
        uint64_t bytes_deleted = 0;
        uint64_t bufs_skipped = 0;
 
        ASSERT(GHOST_STATE(state));
+       bzero(&marker, sizeof(marker));
 top:
        mutex_enter(&state->arcs_mtx);
        for (ab = list_tail(list); ab; ab = ab_prev) {
@@ -1984,9 +1989,8 @@ arc_shrink(void)
 static int
 arc_reclaim_needed(void)
 {
-       uint64_t extra;
-
 #ifdef _KERNEL
+       uint64_t extra;
 
        if (needfree)
                return (1);
@@ -3409,7 +3413,7 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
         * in order to compress/encrypt/etc the data.  We therefor need to
         * make sure that there is sufficient available memory for this.
         */
-       if (error = arc_memory_throttle(reserve, anon_size, txg))
+       if ((error = arc_memory_throttle(reserve, anon_size, txg)))
                return (error);
 
        /*