Lines Matching refs:ma
80 static void free_mntarg(struct mntarg *ma);
1055 struct mntarg *ma = NULL; in sys_mount() local
1095 ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); in sys_mount()
1096 ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); in sys_mount()
1097 ma = mount_argb(ma, flags & MNT_RDONLY, "noro"); in sys_mount()
1098 ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); in sys_mount()
1099 ma = mount_argb(ma, !(flags & MNT_NOEXEC), "noexec"); in sys_mount()
1102 return (vfsp->vfc_vfsops_sd->vfs_cmount(ma, uap->data, flags)); in sys_mount()
1103 return (vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, flags)); in sys_mount()
2811 mount_argb(struct mntarg *ma, int flag, const char *name) in mount_argb() argument
2817 return (mount_arg(ma, name + (flag ? 2 : 0), NULL, 0)); in mount_argb()
2824 mount_argf(struct mntarg *ma, const char *name, const char *fmt, ...) in mount_argf() argument
2831 if (ma == NULL) { in mount_argf()
2832 ma = malloc(sizeof *ma, M_MOUNT, M_WAITOK | M_ZERO); in mount_argf()
2833 SLIST_INIT(&ma->list); in mount_argf()
2835 if (ma->error) in mount_argf()
2836 return (ma); in mount_argf()
2838 ma->v = realloc(ma->v, sizeof *ma->v * (ma->len + 2), in mount_argf()
2840 ma->v[ma->len].iov_base = (void *)(uintptr_t)name; in mount_argf()
2841 ma->v[ma->len].iov_len = strlen(name) + 1; in mount_argf()
2842 ma->len++; in mount_argf()
2851 SLIST_INSERT_HEAD(&ma->list, maa, next); in mount_argf()
2855 ma->v[ma->len].iov_base = maa + 1; in mount_argf()
2856 ma->v[ma->len].iov_len = len; in mount_argf()
2857 ma->len++; in mount_argf()
2859 return (ma); in mount_argf()
2866 mount_argsu(struct mntarg *ma, const char *name, const void *val, int len) in mount_argsu() argument
2872 return (ma); in mount_argsu()
2873 if (ma == NULL) { in mount_argsu()
2874 ma = malloc(sizeof *ma, M_MOUNT, M_WAITOK | M_ZERO); in mount_argsu()
2875 SLIST_INIT(&ma->list); in mount_argsu()
2877 if (ma->error) in mount_argsu()
2878 return (ma); in mount_argsu()
2880 SLIST_INSERT_HEAD(&ma->list, maa, next); in mount_argsu()
2882 ma->error = copyinstr(val, tbuf, len, NULL); in mount_argsu()
2883 return (mount_arg(ma, name, tbuf, -1)); in mount_argsu()
2892 mount_arg(struct mntarg *ma, const char *name, const void *val, int len) in mount_arg() argument
2895 if (ma == NULL) { in mount_arg()
2896 ma = malloc(sizeof *ma, M_MOUNT, M_WAITOK | M_ZERO); in mount_arg()
2897 SLIST_INIT(&ma->list); in mount_arg()
2899 if (ma->error) in mount_arg()
2900 return (ma); in mount_arg()
2902 ma->v = realloc(ma->v, sizeof *ma->v * (ma->len + 2), in mount_arg()
2904 ma->v[ma->len].iov_base = (void *)(uintptr_t)name; in mount_arg()
2905 ma->v[ma->len].iov_len = strlen(name) + 1; in mount_arg()
2906 ma->len++; in mount_arg()
2908 ma->v[ma->len].iov_base = (void *)(uintptr_t)val; in mount_arg()
2910 ma->v[ma->len].iov_len = strlen(val) + 1; in mount_arg()
2912 ma->v[ma->len].iov_len = len; in mount_arg()
2913 ma->len++; in mount_arg()
2914 return (ma); in mount_arg()
2921 free_mntarg(struct mntarg *ma) in free_mntarg() argument
2925 while (!SLIST_EMPTY(&ma->list)) { in free_mntarg()
2926 maa = SLIST_FIRST(&ma->list); in free_mntarg()
2927 SLIST_REMOVE_HEAD(&ma->list, next); in free_mntarg()
2930 free(ma->v, M_MOUNT); in free_mntarg()
2931 free(ma, M_MOUNT); in free_mntarg()
2938 kernel_mount(struct mntarg *ma, uint64_t flags) in kernel_mount() argument
2943 KASSERT(ma != NULL, ("kernel_mount NULL ma")); in kernel_mount()
2944 KASSERT(ma->error != 0 || ma->v != NULL, ("kernel_mount NULL ma->v")); in kernel_mount()
2945 KASSERT(!(ma->len & 1), ("kernel_mount odd ma->len (%d)", ma->len)); in kernel_mount()
2947 error = ma->error; in kernel_mount()
2949 auio.uio_iov = ma->v; in kernel_mount()
2950 auio.uio_iovcnt = ma->len; in kernel_mount()
2954 free_mntarg(ma); in kernel_mount()