Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/label/g_label_ufs.c
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int what) | ||||
struct g_provider *pp; | struct g_provider *pp; | ||||
struct fs *fs; | struct fs *fs; | ||||
g_topology_assert_not(); | g_topology_assert_not(); | ||||
pp = cp->provider; | pp = cp->provider; | ||||
label[0] = '\0'; | label[0] = '\0'; | ||||
fs = NULL; | fs = NULL; | ||||
KASSERT(pp->sectorsize != 0, ("Tasting a disk with 0 sectorsize")); | |||||
markj: I'd convert the other label types to use KASSERT()s as well. Sure the runtime checks are zero… | |||||
if (SBLOCKSIZE % pp->sectorsize != 0 || ffs_sbget(cp, &fs, UFS_STDSB, | if (SBLOCKSIZE % pp->sectorsize != 0 || ffs_sbget(cp, &fs, UFS_STDSB, | ||||
UFS_NOHASHFAIL | UFS_NOCSUM | UFS_NOMSG, M_GEOM, g_use_g_read_data) | UFS_NOHASHFAIL | UFS_NOCSUM | UFS_NOMSG, M_GEOM, g_use_g_read_data) | ||||
!= 0) { | != 0) { | ||||
KASSERT(fs == NULL, | KASSERT(fs == NULL, | ||||
("g_label_ufs_taste_common: non-NULL fs %p\n", fs)); | ("g_label_ufs_taste_common: non-NULL fs %p\n", fs)); | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |
I'd convert the other label types to use KASSERT()s as well. Sure the runtime checks are zero-cost, but the inconsistency is confusing.