| P2K(3) | Library Functions Manual | P2K(3) |
p2k — puffs to
kernel vfs translation library
p2k Library (libp2k, -lp2k)
#include
<rump/p2k.h>
struct p2k_mount *
p2k_init(uint32_t
puffs_flags);
void
p2k_cancel(struct
p2k_mount *p2m, int
error);
int
p2k_setup_fs(struct p2k_mount
*p2m, const char *vfsname, const
char *devpath, const char *mountpath,
int mntflags, void *arg,
size_t alen);
int
p2k_setup_diskfs(struct p2k_mount
*p2m, const char *vfsname, const
char *devpath, struct ukfs_part *part,
const char *mountpath, int
mntflags, void *arg, size_t
alen);
int
p2k_mainloop(struct
p2k_mount *p2m);
int
p2k_run_fs(const char *vfsname,
const char *devpath, const char
*mountpath, int mntflags, void
*arg, size_t alen, uint32_t
puffs_flags);
int
p2k_run_diskfs(const char
*vfsname, const char *devpath,
struct ukfs_part *part, const char
*mountpath, int mntflags, void
*arg, size_t alen, uint32_t
puffs_flags);
The p2k library translates the puffs
protocol to the kernel vfs(9)
protocol and back again. It can therefore be used to mount and run kernel
file system code as a userspace daemon.
Calling the library interface function mounts the
file system and, if successful, starts handling requests. The parameters are
handled by
ukfs_mount()
(see ukfs(3)), with the
exception that mountpath and
puffs_flags are handled by
puffs(3). The
"run_fs" variants of the interfaces are provided as a convenience
for the common case. They execute all of init, setup and mainloop in one
call.
The following environment variables affect the behaviour of
p2k. They are useful mostly for debugging purposes.
The flags are environment variables because typically the command line
arguments to p2k utilities are parsed using versions
not aware of p2k options; for example, the
rump_cd9660(8) arguments
are really parsed by
mount_cd9660(8).
P2K_DEBUGSIGINFO (typically
from ctrl-T), it dumps out the status of the mount point. Sending
SIGUSR1 causes a dump of all the vnodes
(verbose).P2K_NODETACHP2K_NOCACHE_PAGEP2K_NOCACHE_NAMEP2K_NOCACHEP2K_WIZARDUIDpuffs(3), rump(3), ukfs(3), rump_cd9660(8), rump_efs(8), rump_ext2fs(8), rump_ffs(8), rump_hfs(8), rump_lfs(8), rump_msdos(8), rump_nfs(8), rump_ntfs(8), rump_syspuffs(8), rump_sysvbfs(8), rump_tmpfs(8), rump_udf(8)
| October 13, 2024 | NetBSD 11.0 |