FreeBSD kernel kern code
|
#include "opt_rootdevname.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/fcntl.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mdioctl.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/filedesc.h>
#include <sys/reboot.h>
#include <sys/sbuf.h>
#include <sys/stat.h>
#include <sys/syscallsubr.h>
#include <sys/sysproto.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/vnode.h>
#include <geom/geom.h>
Go to the source code of this file.
Data Structures | |
struct | root_hold_token |
Macros | |
#define | CC_WHITESPACE -1 |
#define | CC_NONWHITESPACE -2 |
#define | PE_EOF -1 |
#define | PE_EOL -2 |
#define | ERRMSGL 255 |
Functions | |
__FBSDID ("$BSDSUniX$") | |
static int | parse_mount (char **) |
static struct mntarg * | parse_mountroot_options (struct mntarg *, const char *) |
MTX_SYSINIT (root_holds,&root_holds_mtx,"root_holds", MTX_DEF) | |
static | LIST_HEAD (root_hold_token) |
TUNABLE_INT ("vfs.mountroot.timeout",&root_mount_timeout) | |
struct root_hold_token * | root_mount_hold (const char *identifier) |
void | root_mount_rel (struct root_hold_token *h) |
int | root_mounted (void) |
void | root_mount_wait (void) |
static void | set_rootvnode (void) |
static int | vfs_mountroot_devfs (struct thread *td, struct mount **mpp) |
static int | vfs_mountroot_shuffle (struct thread *td, struct mount *mpdevfs) |
static __inline int | parse_peek (char **conf) |
static __inline void | parse_poke (char **conf, int c) |
static __inline void | parse_advance (char **conf) |
static int | parse_skipto (char **conf, int mc) |
static int | parse_token (char **conf, char **tok) |
static void | parse_dir_ask_printenv (const char *var) |
static int | parse_dir_ask (char **conf) |
static int | parse_dir_md (char **conf) |
static int | parse_dir_onfail (char **conf) |
static int | parse_dir_timeout (char **conf) |
static int | parse_directive (char **conf) |
static int | parse_mount_dev_present (const char *dev) |
static int | vfs_mountroot_parse (struct sbuf *sb, struct mount *mpdevfs) |
static void | vfs_mountroot_conf0 (struct sbuf *sb) |
static int | vfs_mountroot_readconf (struct thread *td, struct sbuf *sb) |
static void | vfs_mountroot_wait (void) |
void | vfs_mountroot (void) |
Variables | |
struct vnode * | rootvnode |
char * | rootdevnames [2] = {NULL, NULL} |
struct mtx | root_holds_mtx |
static enum action | root_mount_onfail = A_CONTINUE |
static int | root_mount_mddev |
static int | root_mount_complete |
static int | root_mount_timeout = 3 |
#define CC_NONWHITESPACE -2 |
Definition at line 368 of file vfs_mountroot.c.
Referenced by parse_skipto(), parse_token(), and vfs_mountroot_parse().
#define CC_WHITESPACE -1 |
Definition at line 367 of file vfs_mountroot.c.
Referenced by parse_skipto(), and parse_token().
#define ERRMSGL 255 |
Definition at line 670 of file vfs_mountroot.c.
Referenced by parse_mount().
#define PE_EOF -1 |
Definition at line 371 of file vfs_mountroot.c.
Referenced by parse_skipto().
#define PE_EOL -2 |
Definition at line 372 of file vfs_mountroot.c.
Referenced by parse_skipto(), and vfs_mountroot_parse().
__FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
Definition at line 108 of file vfs_mountroot.c.
MTX_SYSINIT | ( | root_holds | , |
& | root_holds_mtx, | ||
"root_holds" | , | ||
MTX_DEF | |||
) |
|
static |
Definition at line 389 of file vfs_mountroot.c.
Referenced by parse_mount(), parse_skipto(), and vfs_mountroot_parse().
|
static |
Definition at line 456 of file vfs_mountroot.c.
References cngets(), hz, name, parse_dir_ask_printenv(), parse_mount(), pause(), and printf().
Referenced by parse_directive().
|
static |
Definition at line 444 of file vfs_mountroot.c.
References freeenv(), getenv(), and printf().
Referenced by parse_dir_ask().
|
static |
Definition at line 506 of file vfs_mountroot.c.
References fd, free(), kern_close(), kern_ioctl(), kern_open(), kern_stat(), malloc(), parse_token(), path, printf(), and root_mount_mddev.
Referenced by parse_directive().
|
static |
Definition at line 583 of file vfs_mountroot.c.
References free(), parse_token(), and printf().
Referenced by parse_directive().
|
static |
Definition at line 610 of file vfs_mountroot.c.
References free(), and parse_token().
Referenced by parse_directive().
|
static |
Definition at line 629 of file vfs_mountroot.c.
References free(), parse_dir_ask(), parse_dir_md(), parse_dir_onfail(), parse_dir_timeout(), parse_skipto(), parse_token(), and printf().
Referenced by vfs_mountroot_parse().
|
static |
Definition at line 672 of file vfs_mountroot.c.
References ERRMSGL, mntarg::error, free(), hz, kernel_mount(), malloc(), mount_arg(), parse_advance(), parse_mount_dev_present(), parse_mountroot_options(), parse_poke(), parse_skipto(), parse_token(), pause(), printf(), root_mount_mddev, timeout(), and vfs_byname().
Referenced by parse_dir_ask(), and vfs_mountroot_parse().
|
static |
Definition at line 657 of file vfs_mountroot.c.
References namei(), NDFREE(), and vput().
Referenced by parse_mount().
Definition at line 997 of file vfs_mountroot.c.
References free(), mount_arg(), and name.
Referenced by parse_mount().
|
static |
Definition at line 375 of file vfs_mountroot.c.
Referenced by parse_skipto(), and vfs_mountroot_parse().
|
static |
Definition at line 382 of file vfs_mountroot.c.
Referenced by parse_mount().
|
static |
Definition at line 396 of file vfs_mountroot.c.
References CC_NONWHITESPACE, CC_WHITESPACE, parse_advance(), parse_peek(), PE_EOF, and PE_EOL.
Referenced by parse_directive(), parse_mount(), parse_token(), and vfs_mountroot_parse().
|
static |
Definition at line 425 of file vfs_mountroot.c.
References CC_NONWHITESPACE, CC_WHITESPACE, malloc(), and parse_skipto().
Referenced by parse_dir_md(), parse_dir_onfail(), parse_dir_timeout(), parse_directive(), parse_mount(), and vfs_mountroot_conf0().
struct root_hold_token* root_mount_hold | ( | const char * | identifier | ) |
Definition at line 128 of file vfs_mountroot.c.
References malloc(), root_holds_mtx, root_mounted(), and root_hold_token::who.
void root_mount_rel | ( | struct root_hold_token * | h | ) |
Definition at line 144 of file vfs_mountroot.c.
References free(), root_holds_mtx, and wakeup().
void root_mount_wait | ( | void | ) |
Definition at line 165 of file vfs_mountroot.c.
References hz, and root_holds_mtx.
int root_mounted | ( | void | ) |
Definition at line 157 of file vfs_mountroot.c.
Referenced by root_mount_hold().
|
static |
Definition at line 183 of file vfs_mountroot.c.
References mountlist, panic(), rootvnode, and vrele().
Referenced by vfs_mountroot_devfs(), and vfs_mountroot_shuffle().
TUNABLE_INT | ( | "vfs.mountroot.timeout" | , |
& | root_mount_timeout | ||
) |
void vfs_mountroot | ( | void | ) |
Definition at line 934 of file vfs_mountroot.c.
References inittodr(), mountlist, mountlist_mtx, prison0, root_holds_mtx, rootvnode, sbuf_clear(), sbuf_delete(), sbuf_finish(), vfs_mountroot_conf0(), vfs_mountroot_devfs(), vfs_mountroot_parse(), vfs_mountroot_readconf(), vfs_mountroot_shuffle(), vfs_mountroot_wait(), vref(), and wakeup().
Referenced by start_init().
|
static |
Definition at line 820 of file vfs_mountroot.c.
References boothowto, free(), freeenv(), getenv(), parse_token(), rootdevnames, and sbuf_printf().
Referenced by vfs_mountroot().
|
static |
Definition at line 209 of file vfs_mountroot.c.
References kern_symlink(), malloc(), mountlist, mountlist_mtx, printf(), set_rootvnode(), vfs_byname(), vfs_mount_alloc(), and vfsconf.
Referenced by vfs_mountroot().
|
static |
Definition at line 756 of file vfs_mountroot.c.
References CC_NONWHITESPACE, kern_reboot(), panic(), parse_advance(), parse_directive(), parse_mount(), parse_peek(), parse_skipto(), PE_EOL, printf(), and sbuf_data().
Referenced by vfs_mountroot().
|
static |
Definition at line 867 of file vfs_mountroot.c.
References buf, NDFREE(), sbuf_printf(), vn_close(), vn_open(), and vn_rdwr().
Referenced by vfs_mountroot().
|
static |
Definition at line 249 of file vfs_mountroot.c.
References bootverbose, cache_purge(), cache_purgevfs(), kern_unlink(), mountlist, mountlist_mtx, namei(), NDFREE(), printf(), rootvnode, set_rootvnode(), vfs_unbusy(), vinvalbuf(), vput(), and vrele().
Referenced by vfs_mountroot().
|
static |
Definition at line 906 of file vfs_mountroot.c.
References hz, ppsratecheck(), printf(), root_holds_mtx, and root_hold_token::who.
Referenced by vfs_mountroot().
struct mtx root_holds_mtx |
Definition at line 100 of file vfs_mountroot.c.
Referenced by root_mount_hold(), root_mount_rel(), root_mount_wait(), vfs_mountroot(), and vfs_mountroot_wait().
|
static |
Definition at line 121 of file vfs_mountroot.c.
|
static |
Definition at line 120 of file vfs_mountroot.c.
Referenced by parse_dir_md(), and parse_mount().
|
static |
Definition at line 118 of file vfs_mountroot.c.
|
static |
Definition at line 124 of file vfs_mountroot.c.
char* rootdevnames[2] = {NULL, NULL} |
Definition at line 98 of file vfs_mountroot.c.
Referenced by vfs_mountroot_conf0().
struct vnode* rootvnode |
Definition at line 96 of file vfs_mountroot.c.
Referenced by change_root(), dounmount(), firmware_modevent(), linker_load_module(), lookup(), mountcheckdirs(), set_rootvnode(), vfs_mountroot(), vfs_mountroot_shuffle(), vn_fullpath1(), and vn_fullpath_global().