Lines Matching defs:opt
165 vfs_freeopt(struct vfsoptlist *opts, struct vfsopt *opt)
168 TAILQ_REMOVE(opts, opt, link);
169 free(opt->name, M_MOUNT);
170 if (opt->value != NULL)
171 free(opt->value, M_MOUNT);
172 free(opt, M_MOUNT);
179 struct vfsopt *opt;
182 opt = TAILQ_FIRST(opts);
183 vfs_freeopt(opts, opt);
191 struct vfsopt *opt, *temp;
195 TAILQ_FOREACH_SAFE(opt, opts, link, temp) {
196 if (strcmp(opt->name, name) == 0)
197 vfs_freeopt(opts, opt);
202 vfs_isopt_ro(const char *opt)
205 if (strcmp(opt, "ro") == 0 || strcmp(opt, "rdonly") == 0 ||
206 strcmp(opt, "norw") == 0)
212 vfs_isopt_rw(const char *opt)
215 if (strcmp(opt, "rw") == 0 || strcmp(opt, "noro") == 0)
228 /* "opt" vs. "opt" or "noopt" vs. "noopt" */
231 /* "noopt" vs. "opt" */
234 /* "opt" vs. "noopt" */
241 /* "foo.noopt" vs. "foo.opt" */
244 /* "foo.opt" vs. "foo.noopt" */
263 struct vfsopt *opt, *opt2, *tmp;
265 TAILQ_FOREACH_REVERSE(opt, opts, vfsoptlist, link) {
266 opt2 = TAILQ_PREV(opt, vfsoptlist, link);
268 if (vfs_equalopts(opt->name, opt2->name)) {
286 struct vfsopt *opt;
310 opt = malloc(sizeof(struct vfsopt), M_MOUNT, M_WAITOK);
311 opt->name = malloc(namelen, M_MOUNT, M_WAITOK);
312 opt->value = NULL;
313 opt->len = 0;
314 opt->pos = i / 2;
315 opt->seen = 0;
321 TAILQ_INSERT_TAIL(opts, opt, link);
324 bcopy(auio->uio_iov[i].iov_base, opt->name, namelen);
326 error = copyin(auio->uio_iov[i].iov_base, opt->name,
332 if (namelen == 0 || opt->name[namelen - 1] != '\0') {
337 opt->len = optlen;
338 opt->value = malloc(optlen, M_MOUNT, M_WAITOK);
340 bcopy(auio->uio_iov[i + 1].iov_base, opt->value,
344 opt->value, optlen);
369 struct vfsopt *opt, *new;
371 TAILQ_FOREACH(opt, oldopts, link) {
373 new->name = strdup(opt->name, M_MOUNT);
374 if (opt->len != 0) {
375 new->value = malloc(opt->len, M_MOUNT, M_WAITOK);
376 bcopy(opt->value, new->value, opt->len);
379 new->len = opt->len;
380 new->seen = opt->seen;
665 struct vfsopt *opt, *tmp_opt;
710 TAILQ_FOREACH_SAFE(opt, optlist, link, tmp_opt) {
713 if (strcmp(opt->name, "update") == 0) {
717 else if (strcmp(opt->name, "async") == 0)
719 else if (strcmp(opt->name, "force") == 0) {
723 else if (strcmp(opt->name, "reload") == 0) {
727 else if (strcmp(opt->name, "multilabel") == 0)
729 else if (strcmp(opt->name, "noasync") == 0)
731 else if (strcmp(opt->name, "noatime") == 0)
733 else if (strcmp(opt->name, "atime") == 0) {
734 free(opt->name, M_MOUNT);
735 opt->name = strdup("nonoatime", M_MOUNT);
737 else if (strcmp(opt->name, "noclusterr") == 0)
739 else if (strcmp(opt->name, "clusterr") == 0) {
740 free(opt->name, M_MOUNT);
741 opt->name = strdup("nonoclusterr", M_MOUNT);
743 else if (strcmp(opt->name, "noclusterw") == 0)
745 else if (strcmp(opt->name, "clusterw") == 0) {
746 free(opt->name, M_MOUNT);
747 opt->name = strdup("nonoclusterw", M_MOUNT);
749 else if (strcmp(opt->name, "noexec") == 0)
751 else if (strcmp(opt->name, "exec") == 0) {
752 free(opt->name, M_MOUNT);
753 opt->name = strdup("nonoexec", M_MOUNT);
755 else if (strcmp(opt->name, "nosuid") == 0)
757 else if (strcmp(opt->name, "suid") == 0) {
758 free(opt->name, M_MOUNT);
759 opt->name = strdup("nonosuid", M_MOUNT);
761 else if (strcmp(opt->name, "nosymfollow") == 0)
763 else if (strcmp(opt->name, "symfollow") == 0) {
764 free(opt->name, M_MOUNT);
765 opt->name = strdup("nonosymfollow", M_MOUNT);
767 else if (strcmp(opt->name, "noro") == 0) {
771 else if (strcmp(opt->name, "rw") == 0) {
775 else if (strcmp(opt->name, "ro") == 0) {
779 else if (strcmp(opt->name, "rdonly") == 0) {
780 free(opt->name, M_MOUNT);
781 opt->name = strdup("ro", M_MOUNT);
785 else if (strcmp(opt->name, "autoro") == 0) {
789 else if (strcmp(opt->name, "suiddir") == 0)
791 else if (strcmp(opt->name, "sync") == 0)
793 else if (strcmp(opt->name, "union") == 0)
795 else if (strcmp(opt->name, "automounted") == 0) {
798 } else if (strcmp(opt->name, "nocover") == 0) {
801 } else if (strcmp(opt->name, "cover") == 0) {
804 } else if (strcmp(opt->name, "emptydir") == 0) {
807 } else if (strcmp(opt->name, "noemptydir") == 0) {
812 vfs_freeopt(optlist, opt);
1994 struct vfsopt *opt;
1999 TAILQ_FOREACH(opt, opts, link) {
2000 p = opt->name;
2029 TAILQ_FOREACH(opt, opts, link) {
2030 if (strcmp(opt->name, "errmsg") == 0) {
2031 strncpy((char *)opt->value, errmsg, opt->len);
2035 if (opt == NULL)
2052 struct vfsopt *opt;
2056 TAILQ_FOREACH(opt, opts, link) {
2057 if (strcmp(name, opt->name) == 0) {
2058 opt->seen = 1;
2060 *len = opt->len;
2062 *buf = opt->value;
2072 struct vfsopt *opt;
2077 TAILQ_FOREACH(opt, opts, link) {
2078 if (strcmp(name, opt->name) == 0) {
2079 opt->seen = 1;
2080 return (opt->pos);
2130 struct vfsopt *opt;
2133 TAILQ_FOREACH(opt, opts, link) {
2134 if (strcmp(name, opt->name) != 0)
2136 opt->seen = 1;
2137 if (opt->len == 0 ||
2138 ((char *)opt->value)[opt->len - 1] != '\0') {
2142 return (opt->value);
2152 struct vfsopt *opt;
2154 TAILQ_FOREACH(opt, opts, link) {
2155 if (strcmp(name, opt->name) == 0) {
2156 opt->seen = 1;
2171 struct vfsopt *opt;
2176 TAILQ_FOREACH(opt, opts, link) {
2177 if (strcmp(name, opt->name) != 0)
2179 opt->seen = 1;
2180 if (opt->len == 0 || opt->value == NULL)
2182 if (((char *)opt->value)[opt->len - 1] != '\0')
2185 ret = vsscanf(opt->value, fmt, ap);
2195 struct vfsopt *opt;
2197 TAILQ_FOREACH(opt, opts, link) {
2198 if (strcmp(name, opt->name) != 0)
2200 opt->seen = 1;
2201 if (opt->value == NULL)
2202 opt->len = len;
2204 if (opt->len != len)
2206 bcopy(value, opt->value, len);
2216 struct vfsopt *opt;
2218 TAILQ_FOREACH(opt, opts, link) {
2219 if (strcmp(name, opt->name) != 0)
2221 opt->seen = 1;
2222 if (opt->value == NULL)
2223 opt->len = len;
2225 if (opt->len < len)
2227 opt->len = len;
2228 bcopy(value, opt->value, len);
2238 struct vfsopt *opt;
2240 TAILQ_FOREACH(opt, opts, link) {
2241 if (strcmp(name, opt->name) != 0)
2243 opt->seen = 1;
2244 if (opt->value == NULL)
2245 opt->len = strlen(value) + 1;
2246 else if (strlcpy(opt->value, value, opt->len) >= opt->len)
2264 struct vfsopt *opt;
2268 TAILQ_FOREACH(opt, opts, link) {
2269 if (strcmp(name, opt->name) == 0) {
2270 opt->seen = 1;
2271 if (len != opt->len)
2273 bcopy(opt->value, dest, opt->len);
2522 struct vfsopt *opt;
2527 TAILQ_FOREACH(opt, opts, link) {
2528 if (opt->name[0] == '\0' || (opt->len > 0 && *(char *)opt->value == '\0'))
2530 devctl_safe_quote_sb(sb, opt->name);
2531 if (opt->len > 0) {
2533 devctl_safe_quote_sb(sb, opt->value);
2572 mount_devctl_event_mntopt(&sb, "opt", mp->mnt_opt);