]> granicus.if.org Git - zfs/commitdiff
Fix gcc missing case warnings
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Aug 2010 16:52:41 +0000 (09:52 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 27 Aug 2010 22:34:03 +0000 (15:34 -0700)
Gcc ASSERT() missing cases are impossible

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 files changed:
cmd/zinject/translate.c
cmd/ztest/ztest.c
lib/libzfs/libzfs_changelist.c
lib/libzfs/libzfs_dataset.c
lib/libzfs/libzfs_pool.c
module/zfs/arc.c
module/zfs/dmu_send.c
module/zfs/dsl_prop.c
module/zfs/sa.c
module/zfs/spa.c
module/zfs/vdev_label.c
module/zfs/zfs_ioctl.c

index 87751e315e89e932a088e3d4bde3713e4d4421c9..996075283c9121968b74800a5485146cab7f33e5 100644 (file)
@@ -233,6 +233,8 @@ calculate_range(const char *dataset, err_type_t type, int level, char *range,
        }
 
        switch (type) {
+       default:
+               break;
        case TYPE_DATA:
                break;
 
@@ -347,6 +349,8 @@ translate_record(err_type_t type, const char *object, const char *range,
                 * MOS objects are treated specially.
                 */
                switch (type) {
+               default:
+                       break;
                case TYPE_MOS:
                        record->zi_type = 0;
                        break;
@@ -473,6 +477,8 @@ translate_device(const char *pool, const char *device, err_type_t label_type,
        }
 
        switch (label_type) {
+       default:
+               break;
        case TYPE_LABEL_UBERBLOCK:
                record->zi_start = offsetof(vdev_label_t, vl_uberblock[0]);
                record->zi_end = record->zi_start + VDEV_UBERBLOCK_RING - 1;
index fbc3c2cc98662ccb99887d1060eab7c5cfb102d6..5677dcb85f2c7d77e6d947e1ad4ef47c7927922d 100644 (file)
@@ -1998,6 +1998,8 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
        case ZTEST_IO_SETATTR:
                (void) ztest_setattr(zd, object);
                break;
+       default:
+               break;
        }
 
        umem_free(data, blocksize);
index 4328d38a2c36369c6e69fe7699e9d1ade5271a66..0bcfc0423b6b5e6d4c00addecbfa52f898377fd7 100644 (file)
@@ -131,6 +131,8 @@ changelist_prefix(prop_changelist_t *clp)
                        case ZFS_PROP_SHARESMB:
                                (void) zfs_unshare_smb(cn->cn_handle, NULL);
                                break;
+                       default:
+                               break;
                        }
                }
        }
index 089be7e041b500ddfe5f15f4bb8e749799e69b42..e2c4c1e161fa5eb31680d07976560a1e5b20a19d 100644 (file)
@@ -72,6 +72,8 @@ zfs_type_to_name(zfs_type_t type)
                return (dgettext(TEXT_DOMAIN, "snapshot"));
        case ZFS_TYPE_VOLUME:
                return (dgettext(TEXT_DOMAIN, "volume"));
+       default:
+               break;
        }
 
        return (NULL);
@@ -180,6 +182,8 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
                                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
                                    "reserved disk name"));
                                break;
+                       default:
+                               break;
                        }
                }
 
@@ -1015,6 +1019,8 @@ badlabel:
                                            "component of '%s' is too long"),
                                            propname);
                                        break;
+                               default:
+                                       break;
                                }
                                (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
                                goto error;
@@ -1139,6 +1145,8 @@ badlabel:
                case ZFS_PROP_NORMALIZE:
                        chosen_normal = (int)intval;
                        break;
+               default:
+                       break;
                }
 
                /*
@@ -1187,6 +1195,8 @@ badlabel:
                                        goto error;
                                }
                                break;
+                       default:
+                               break;
                        }
                }
        }
@@ -1674,6 +1684,8 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
                mntopt_on = MNTOPT_NBMAND;
                mntopt_off = MNTOPT_NONBMAND;
                break;
+       default:
+               break;
        }
 
        /*
index eac5a4c4d6b858c90bd8c415357e4f170331d2c6..f1edb77f0f6a5bf1bf88d4cd07c8458c7e861e55 100644 (file)
@@ -178,6 +178,8 @@ char *
 zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
 {
        switch (state) {
+       default:
+               break;
        case VDEV_STATE_CLOSED:
        case VDEV_STATE_OFFLINE:
                return (gettext("OFFLINE"));
@@ -421,6 +423,8 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
                 * Perform additional checking for specific properties.
                 */
                switch (prop) {
+               default:
+                       break;
                case ZPOOL_PROP_VERSION:
                        if (intval < version || intval > SPA_VERSION) {
                                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -730,7 +734,10 @@ zpool_name_valid(libzfs_handle_t *hdl, boolean_t isopen, const char *pool)
                                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
                                    "multiple '@' delimiters in name"));
                                break;
-
+                       case NAME_ERR_NO_AT:
+                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+                                   "permission set is missing '@'"));
+                               break;
                        }
                }
                return (B_FALSE);
index d6d648c65edb3f007576d0c0b60920d032529fd3..d38d9a367294b873e28e30370d754b8f51e8547d 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;
index e47d533a44f4d0584de832c0f29736790b76604f..3ddea95d00d68ffea718825bf4df4373757cc124 100644 (file)
@@ -1012,6 +1012,8 @@ backup_byteswap(dmu_replay_record_t *drr)
                DO64(drr_end.drr_checksum.zc_word[3]);
                DO64(drr_end.drr_toguid);
                break;
+       default:
+               break;
        }
 #undef DO64
 #undef DO32
index aa66b32e79388cbe0b7cc68caf33a33c30ca9bdf..6492701c5ff50448e98cc62910abb31da807a81d 100644 (file)
@@ -413,6 +413,8 @@ dsl_prop_check_prediction(dsl_dir_t *dd, dsl_prop_setarg_t *psa)
                case ZFS_PROP_QUOTA:
                case ZFS_PROP_RESERVATION:
                        return;
+               default:
+                       break;
                }
        }
 
index cf87c867e7ea6994254d12a7ee0cf70a0f26ed21..b6e61bec03060b057a062b1c684116eb6fbdc48d 100644 (file)
@@ -398,6 +398,8 @@ sa_attr_op(sa_handle_t *hdl, sa_bulk_attr_t *bulk, int count,
                        if (error)
                                return (error);
                        break;
+               default:
+                       break;
                }
        }
        return (error);
index 9ae16d316367da89dc36ae5048426b54753ba876..64f5e067ca97bdd99faa5cb469314439fd7fe618 100644 (file)
@@ -471,6 +471,9 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
                            intval != 0 && intval < ZIO_DEDUPDITTO_MIN)
                                error = EINVAL;
                        break;
+
+               default:
+                       break;
                }
 
                if (error)
@@ -1425,6 +1428,8 @@ static int
 spa_check_logs(spa_t *spa)
 {
        switch (spa->spa_log_state) {
+       default:
+               break;
        case SPA_LOG_MISSING:
                /* need to recheck in case slog has been restored */
        case SPA_LOG_UNKNOWN:
index 528710eaf2c00765206cfd7c35b4e1dba2d6f94a..8b400879b23a611b7f7badda0777b6fc182921dc 100644 (file)
@@ -565,6 +565,8 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason,
 
                case VDEV_LABEL_SPARE:
                        return (spa_has_spare(spa, device_guid));
+               default:
+                       break;
                }
        }
 
index ff31144d3633b952f81166ac45c3d04401b5156a..b7f6c1ed791096150e6d814b2b60d29886fe1635 100644 (file)
@@ -483,6 +483,8 @@ zfs_secpolicy_setprop(const char *dsname, zfs_prop_t prop, nvpair_t *propval,
         * Check permissions for special properties.
         */
        switch (prop) {
+       default:
+               break;
        case ZFS_PROP_ZONED:
                /*
                 * Disallow setting of 'zoned' from within a local zone.
@@ -3380,6 +3382,8 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr)
                                return (ENOTSUP);
                }
                break;
+       default:
+               break;
        }
 
        return (zfs_secpolicy_setprop(dsname, prop, pair, CRED()));