Lines Matching defs:label
48 #include <geom/label/g_label.h>
53 SYSCTL_NODE(_kern_geom, OID_AUTO, label, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
68 #define G_LABEL_DIRPREFIX "label/"
93 * 6. Add your file system to manual page sbin/geom/class/label/glabel.8.
114 g_label_rtrim(char *label, size_t size)
119 if (label[i] == '\0')
121 else if (label[i] == ' ')
122 label[i] = '\0';
170 g_label_is_name_ok(const char *label)
174 /* Check if the label starts from ../ */
175 if (strncmp(label, "../", 3) == 0)
177 /* Check if the label contains /../ */
178 if (strstr(label, "/../") != NULL)
180 /* Check if the label ends at ../ */
181 if ((s = strstr(label, "/..")) != NULL && s[3] == '\0')
187 g_label_mangle_name(char *label, size_t size)
194 len = strlen(label);
196 if (isspace(label[i - 1]))
197 label[i - 1] = '\0';
201 if (*label == '\0')
205 for (c = label; *c != '\0'; c++) {
215 label[0] = '\0';
217 strlcpy(label, sbuf_data(sb), size);
223 const char *label, const char *dirprefix, off_t mediasize)
232 if (!g_label_is_name_ok(label)) {
233 G_LABEL_DEBUG(0, "%s contains suspicious label, skipping.",
235 G_LABEL_DEBUG(1, "%s suspicious label is: %s", pp->name, label);
237 gctl_error(req, "Label name %s is invalid.", label);
242 if (snprintf(name, sizeof(name), "%s%s", dirprefix, label) >= sizeof(name)) {
244 gctl_error(req, "Label name %s is too long.", label);
255 label, name, pp->name);
265 G_LABEL_DEBUG(0, "Cannot create slice %s.", label);
267 gctl_error(req, "Cannot create slice %s.", label);
348 g_label_generic_taste(struct g_consumer *cp, char *label, size_t size)
354 label[0] = '\0';
375 strlcpy(label, md.md_label, size);
402 gp = g_new_geomf(mp, "label:taste");
413 char label[128];
418 g_labels[i]->ld_taste(cp, label, sizeof(label));
419 g_label_mangle_name(label, sizeof(label));
421 if (label[0] == '\0')
428 g_label_create(NULL, mp, pp, label,
465 * arg0 is the label.
549 gctl_error(req, "Cannot destroy label %s (error=%d).",