MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mount_argsu

Function mount_argsu

freebsd/kern/vfs_mount.c:2357–2376  ·  view source on GitHub ↗

* Add an argument which is a userland string. */

Source from the content-addressed store, hash-verified

2355 * Add an argument which is a userland string.
2356 */
2357struct mntarg *
2358mount_argsu(struct mntarg *ma, const char *name, const void *val, int len)
2359{
2360 struct mntaarg *maa;
2361 char *tbuf;
2362
2363 if (val == NULL)
2364 return (ma);
2365 if (ma == NULL) {
2366 ma = malloc(sizeof *ma, M_MOUNT, M_WAITOK | M_ZERO);
2367 SLIST_INIT(&ma->list);
2368 }
2369 if (ma->error)
2370 return (ma);
2371 maa = malloc(sizeof *maa + len, M_MOUNT, M_WAITOK | M_ZERO);
2372 SLIST_INSERT_HEAD(&ma->list, maa, next);
2373 tbuf = (void *)(maa + 1);
2374 ma->error = copyinstr(val, tbuf, len, NULL);
2375 return (mount_arg(ma, name, tbuf, -1));
2376}
2377
2378/*
2379 * Plain argument.

Callers 1

sys_mountFunction · 0.85

Calls 3

mallocFunction · 0.85
mount_argFunction · 0.85
copyinstrFunction · 0.50

Tested by

no test coverage detected