* Find and copy a mount option. * * The size of the buffer has to be specified * in len, if it is not the same length as the * mount option, EINVAL is returned. * Returns ENOENT if the option is not found. */
| 2221 | * Returns ENOENT if the option is not found. |
| 2222 | */ |
| 2223 | int |
| 2224 | vfs_copyopt(struct vfsoptlist *opts, const char *name, void *dest, int len) |
| 2225 | { |
| 2226 | struct vfsopt *opt; |
| 2227 | |
| 2228 | KASSERT(opts != NULL, ("vfs_copyopt: caller passed 'opts' as NULL")); |
| 2229 | |
| 2230 | TAILQ_FOREACH(opt, opts, link) { |
| 2231 | if (strcmp(name, opt->name) == 0) { |
| 2232 | opt->seen = 1; |
| 2233 | if (len != opt->len) |
| 2234 | return (EINVAL); |
| 2235 | bcopy(opt->value, dest, opt->len); |
| 2236 | return (0); |
| 2237 | } |
| 2238 | } |
| 2239 | return (ENOENT); |
| 2240 | } |
| 2241 | |
| 2242 | int |
| 2243 | __vfs_statfs(struct mount *mp, struct statfs *sbp) |
no test coverage detected