Add gcc-missing-case branch

This commit is contained in:
Brian Behlendorf 2008-11-20 14:04:07 -08:00
parent 34dc7c2f25
commit b31c53455e
7 changed files with 39 additions and 0 deletions

1
.topdeps Normal file
View File

@ -0,0 +1 @@
master

8
.topmsg Normal file
View File

@ -0,0 +1,8 @@
From: Brian Behlendorf <behlendorf1@llnl.gov>
Subject: [PATCH] gcc warning missing case
Gcc ASSERT() missing cases are impossible
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
---

View File

@ -325,6 +325,8 @@ zfs_secpolicy_setprop(const char *name, zfs_prop_t prop, cred_t *cr)
return (EPERM);
}
break;
default:
break;
}
return (zfs_secpolicy_write_perms(name, zfs_prop_to_name(prop), cr));
@ -1418,6 +1420,8 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl)
if (zpl_check_version(name, ZPL_VERSION_FUID))
return (ENOTSUP);
break;
default:
break;
}
if ((error = zfs_secpolicy_setprop(name, prop, CRED())) != 0)
return (error);

View File

@ -141,6 +141,8 @@ changelist_prefix(prop_changelist_t *clp)
*/
(void) zfs_unshare_iscsi(cn->cn_handle);
break;
default:
break;
}
} else {
/*
@ -157,6 +159,8 @@ changelist_prefix(prop_changelist_t *clp)
case ZFS_PROP_SHARESMB:
(void) zfs_unshare_smb(cn->cn_handle, NULL);
break;
default:
break;
}
}
}

View File

@ -74,6 +74,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);
@ -183,6 +185,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;
}
}
@ -676,6 +680,8 @@ zfs_validate_properties(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
"component of '%s' is too long"),
propname);
break;
default:
break;
}
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
goto error;
@ -800,6 +806,8 @@ zfs_validate_properties(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
case ZFS_PROP_NORMALIZE:
chosen_normal = (int)intval;
break;
default:
break;
}
/*
@ -848,6 +856,8 @@ zfs_validate_properties(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
goto error;
}
break;
default:
break;
}
}
}
@ -1090,6 +1100,8 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms,
dgettext(TEXT_DOMAIN,
"set definition must begin with an '@' "
"character"));
default:
break;
}
return (zfs_error(zhp->zfs_hdl,
EZFS_BADPERMSET, whostr));
@ -1519,6 +1531,8 @@ zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms)
&nvpair_name(who_pair)[3]);
tree = &zallowp->z_sets;
break;
default:
break;
}
/*
@ -1671,6 +1685,8 @@ zfs_deleg_perm_type_str(zfs_deleg_perm_type_t type)
return (dgettext(TEXT_DOMAIN, "property"));
case ZFS_DELEG_OTHER:
return (dgettext(TEXT_DOMAIN, "other"));
default:
break;
}
return ("");
}
@ -2053,6 +2069,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;
}
/*

View File

@ -386,6 +386,8 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
strcmp(slash, "/..") == 0)
error = EINVAL;
break;
default:
break;
}
if (error)

View File

@ -441,6 +441,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;
}
}