|
NAMEfree_mntarg , kernel_mount ,
kernel_vmount , mount_arg ,
mount_argb , mount_argf ,
mount_argsu —
functions provided as part of the kernel mount interface
SYNOPSISvoidfree_mntarg (struct
mntarg *ma);
int
int
struct mntarg *
struct mntarg *
struct mntarg *
struct mntarg *
DESCRIPTIONThekernel_mount () family of functions are provided as
an API for building a list of mount arguments which will be used to mount file
systems from inside the kernel. By accumulating a list of arguments, the API
takes shape and provides the information necessary for the kernel to control
the
mount(8)
utility. When an error occurs, the process will stop. This will not cause a
panic(9).
The header of the structure is stored in src/sys/kern/vfs_mount.c which permits automatic structure creation to ease the mount process. Memory allocation must always be freed when the entire process is complete, it is an error otherwise. The The The The The The The EXAMPLESAn example of the*_cmount () function:
static int msdosfs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td) { struct msdosfs_args args; int error; if (data == NULL) return (EINVAL); error = copyin(data, &args, sizeof(args)); if (error) return (error); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mask", "%d", args.mask); ma = mount_argf(ma, "dirmask", "%d", args.dirmask); ma = mount_argb(ma, args.flags & MSDOSFSMNT_SHORTNAME, "noshortname"); ma = mount_argb(ma, args.flags & MSDOSFSMNT_LONGNAME, "nolongname"); ma = mount_argb(ma, !(args.flags & MSDOSFSMNT_NOWIN95), "nowin95"); ma = mount_argb(ma, args.flags & MSDOSFSMNT_KICONV, "nokiconv"); ma = mount_argsu(ma, "cs_win", args.cs_win, MAXCSLEN); ma = mount_argsu(ma, "cs_dos", args.cs_dos, MAXCSLEN); ma = mount_argsu(ma, "cs_local", args.cs_local, MAXCSLEN); error = kernel_mount(ma, flags); return (error); } When working with error = kernel_vmount( MNT_RDONLY, "fstype", vfsname, "fspath", "/", "from", path, NULL); SEE ALSOVFS(9), VFS_MOUNT(9)HISTORYThekernel_mount () family of functions and this manual
page first appeared in FreeBSD 6.0.
AUTHORSThekernel_mount () family of functions and API was
developed by Poul-Henning Kamp
<phk@FreeBSD.org>. This
manual page was written by Tom Rhodes
<trhodes@FreeBSD.org>.
Visit the GSP FreeBSD Man Page Interface. |