FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/smp.h>
#include <sys/devctl.h>
#include <sys/eventhandler.h>
#include <sys/fcntl.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/libkern.h>
#include <sys/limits.h>
#include <sys/malloc.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/syscallsubr.h>
#include <sys/sysproto.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/taskqueue.h>
#include <sys/vnode.h>
#include <vm/uma.h>
#include <geom/geom.h>
#include <machine/stdarg.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
Go to the source code of this file.
Data Structures | |
struct | nmount_args |
struct | mount_args |
struct | unmount_args |
struct | vfs_op_barrier_ipi |
struct | mntaarg |
struct | mntarg |
Macros | |
#define | VFS_MOUNTARG_SIZE_MAX (1024 * 64) |
#define | DEVCTL_LEN 1024 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | vfs_domount (struct thread *td, const char *fstype, char *fspath, uint64_t fsflags, struct vfsoptlist **optlist) |
static void | free_mntarg (struct mntarg *ma) |
SYSCTL_INT (_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "Unprivileged users may mount and unmount file systems") | |
SYSCTL_BOOL (_vfs, OID_AUTO, default_autoro, CTLFLAG_RW, &default_autoro, 0, "Retry failed r/w mount as r/o if no explicit ro/rw option is specified") | |
SYSCTL_BOOL (_vfs, OID_AUTO, recursive_forced_unmount, CTLFLAG_RW, &recursive_forced_unmount, 0, "Recursively unmount stacked upper mounts" " when a file system is forcibly unmounted") | |
static | SYSCTL_NODE (_vfs, OID_AUTO, deferred_unmount, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "deferred unmount controls") |
SYSCTL_UINT (_vfs_deferred_unmount, OID_AUTO, retry_limit, CTLFLAG_RW, &deferred_unmount_retry_limit, 0, "Maximum number of retries for deferred unmount failure") | |
SYSCTL_INT (_vfs_deferred_unmount, OID_AUTO, retry_delay_hz, CTLFLAG_RW, &deferred_unmount_retry_delay_hz, 0, "Delay in units of [1/kern.hz]s when retrying a failed deferred unmount") | |
SYSCTL_INT (_vfs_deferred_unmount, OID_AUTO, total_retries, CTLFLAG_RD, &deferred_unmount_total_retries, 0, "Total number of retried deferred unmounts") | |
MALLOC_DEFINE (M_MOUNT, "mount", "vfs mount structure") | |
MALLOC_DEFINE (M_STATFS, "statfs", "statfs structure") | |
EVENTHANDLER_LIST_DEFINE (vfs_mounted) | |
EVENTHANDLER_LIST_DEFINE (vfs_unmounted) | |
static void | vfs_deferred_unmount (void *arg, int pending) |
MTX_SYSINIT (deferred_unmount, &deferred_unmount_lock, "deferred_unmount", MTX_DEF) | |
static | STAILQ_HEAD (mount) |
static int | mount_init (void *mem, int size, int flags) |
static void | mount_fini (void *mem, int size) |
static void | vfs_mount_init (void *dummy __unused) |
SYSINIT (vfs_mount, SI_SUB_VFS, SI_ORDER_ANY, vfs_mount_init, NULL) | |
static void | vfs_freeopt (struct vfsoptlist *opts, struct vfsopt *opt) |
void | vfs_freeopts (struct vfsoptlist *opts) |
void | vfs_deleteopt (struct vfsoptlist *opts, const char *name) |
static int | vfs_isopt_ro (const char *opt) |
static int | vfs_isopt_rw (const char *opt) |
static int | vfs_equalopts (const char *opt1, const char *opt2) |
static void | vfs_sanitizeopts (struct vfsoptlist *opts) |
int | vfs_buildopts (struct uio *auio, struct vfsoptlist **options) |
static void | vfs_mergeopts (struct vfsoptlist *toopts, struct vfsoptlist *oldopts) |
int | sys_nmount (struct thread *td, struct nmount_args *uap) |
struct mount * | vfs_ref_from_vp (struct vnode *vp) |
void | vfs_ref (struct mount *mp) |
struct mount * | vfs_register_upper_from_vp (struct vnode *vp, struct mount *ump, struct mount_upper_node *upper) |
void | vfs_register_for_notification (struct mount *mp, struct mount *ump, struct mount_upper_node *upper) |
static void | vfs_drain_upper_locked (struct mount *mp) |
void | vfs_unregister_for_notification (struct mount *mp, struct mount_upper_node *upper) |
void | vfs_unregister_upper (struct mount *mp, struct mount_upper_node *upper) |
void | vfs_rel (struct mount *mp) |
struct mount * | vfs_mount_alloc (struct vnode *vp, struct vfsconf *vfsp, const char *fspath, struct ucred *cred) |
void | vfs_mount_destroy (struct mount *mp) |
static bool | vfs_should_downgrade_to_ro_mount (uint64_t fsflags, int error) |
int | vfs_donmount (struct thread *td, uint64_t fsflags, struct uio *fsoptions) |
int | sys_mount (struct thread *td, struct mount_args *uap) |
static int | vfs_domount_first (struct thread *td, struct vfsconf *vfsp, char *fspath, struct vnode *vp, uint64_t fsflags, struct vfsoptlist **optlist) |
static int | vfs_domount_update (struct thread *td, struct vnode *vp, uint64_t fsflags, struct vfsoptlist **optlist) |
int | sys_unmount (struct thread *td, struct unmount_args *uap) |
int | kern_unmount (struct thread *td, const char *path, int flags) |
static int | vfs_check_usecounts (struct mount *mp) |
static void | dounmount_cleanup (struct mount *mp, struct vnode *coveredvp, int mntkflags) |
void | vfs_op_enter (struct mount *mp) |
void | vfs_op_exit_locked (struct mount *mp) |
void | vfs_op_exit (struct mount *mp) |
static void | vfs_op_action_func (void *arg) |
static void | vfs_op_wait_func (void *arg, int cpu) |
void | vfs_op_barrier_wait (struct mount *mp) |
int | vfs_mount_fetch_counter (struct mount *mp, enum mount_counter which) |
static bool | deferred_unmount_enqueue (struct mount *mp, uint64_t flags, bool requeue, int timeout_ticks) |
static void | vfs_deferred_unmount (void *argi __unused, int pending __unused) |
int | dounmount (struct mount *mp, uint64_t flags, struct thread *td) |
void | vfs_mount_error (struct mount *mp, const char *fmt,...) |
void | vfs_opterror (struct vfsoptlist *opts, const char *fmt,...) |
int | vfs_filteropt (struct vfsoptlist *opts, const char **legal) |
int | vfs_getopt (struct vfsoptlist *opts, const char *name, void **buf, int *len) |
int | vfs_getopt_pos (struct vfsoptlist *opts, const char *name) |
int | vfs_getopt_size (struct vfsoptlist *opts, const char *name, off_t *value) |
char * | vfs_getopts (struct vfsoptlist *opts, const char *name, int *error) |
int | vfs_flagopt (struct vfsoptlist *opts, const char *name, uint64_t *w, uint64_t val) |
int | vfs_scanopt (struct vfsoptlist *opts, const char *name, const char *fmt,...) |
int | vfs_setopt (struct vfsoptlist *opts, const char *name, void *value, int len) |
int | vfs_setopt_part (struct vfsoptlist *opts, const char *name, void *value, int len) |
int | vfs_setopts (struct vfsoptlist *opts, const char *name, const char *value) |
int | vfs_copyopt (struct vfsoptlist *opts, const char *name, void *dest, int len) |
int | __vfs_statfs (struct mount *mp, struct statfs *sbp) |
void | vfs_mountedfrom (struct mount *mp, const char *from) |
struct mntarg * | mount_argb (struct mntarg *ma, int flag, const char *name) |
struct mntarg * | mount_argf (struct mntarg *ma, const char *name, const char *fmt,...) |
struct mntarg * | mount_argsu (struct mntarg *ma, const char *name, const void *val, int len) |
struct mntarg * | mount_arg (struct mntarg *ma, const char *name, const void *val, int len) |
int | kernel_mount (struct mntarg *ma, uint64_t flags) |
static void | mount_devctl_event (const char *type, struct mount *mp, bool donew) |
int | vfs_remount_ro (struct mount *mp) |
void | suspend_all_fs (void) |
void | resume_all_fs (void) |
Variables | |
static int | usermount = 0 |
static bool | default_autoro = false |
static bool | recursive_forced_unmount = false |
static unsigned int | deferred_unmount_retry_limit = 10 |
static int | deferred_unmount_retry_delay_hz |
static int | deferred_unmount_total_retries = 0 |
static uma_zone_t | mount_zone |
struct mntlist | mountlist = TAILQ_HEAD_INITIALIZER(mountlist) |
struct mtx_padalign __exclusive_cache_line | mountlist_mtx |
static struct timeout_task | deferred_unmount_task |
static struct mtx | deferred_unmount_lock |
static struct mntoptnames | optnames [] |
#define DEVCTL_LEN 1024 |
Definition at line 2824 of file vfs_mount.c.
#define VFS_MOUNTARG_SIZE_MAX (1024 * 64) |
Definition at line 79 of file vfs_mount.c.
__FBSDID | ( | "$FreeBSD$" | ) |
int __vfs_statfs | ( | struct mount * | mp, |
struct statfs * | sbp | ||
) |
Definition at line 2612 of file vfs_mount.c.
|
static |
Definition at line 1925 of file vfs_mount.c.
References deferred_unmount_lock, deferred_unmount_task, flags, and taskqueue_enqueue_timeout().
Referenced by dounmount(), and vfs_deferred_unmount().
int dounmount | ( | struct mount * | mp, |
uint64_t | flags, | ||
struct thread * | td | ||
) |
Definition at line 2002 of file vfs_mount.c.
References deferred_unmount_enqueue(), deferred_unmount_retry_limit, dounmount_cleanup(), flags, mount_devctl_event(), mountlist, mountlist_mtx, recursive_forced_unmount, rootdevmp, rootvnode, taskqueue_member(), vdrop(), vfs_allocate_syncvnode(), vfs_cache_root_clear(), vfs_check_usecounts(), vfs_deallocate_syncvnode(), vfs_event_signal(), vfs_mount_destroy(), vfs_op_enter(), vfs_op_exit_locked(), vfs_periodic(), vfs_ref(), vfs_rel(), vfs_setpublicfs(), vfs_suser(), vhold(), vn_finished_write(), vn_irflag_unset_locked(), vn_seqc_write_begin(), vn_seqc_write_end(), vn_seqc_write_end_locked(), vn_start_write(), vrele(), and wakeup().
Referenced by kern_unmount(), unmount_or_warn(), and vfs_deferred_unmount().
|
static |
Definition at line 1701 of file vfs_mount.c.
References vdrop(), vfs_op_exit_locked(), vn_finished_write(), and wakeup().
Referenced by dounmount().
EVENTHANDLER_LIST_DEFINE | ( | vfs_mounted | ) |
EVENTHANDLER_LIST_DEFINE | ( | vfs_unmounted | ) |
|
static |
Definition at line 2782 of file vfs_mount.c.
References free(), and mntarg::v.
Referenced by kernel_mount().
int kern_unmount | ( | struct thread * | td, |
const char * | path, | ||
int | flags | ||
) |
Definition at line 1589 of file vfs_mount.c.
References dounmount(), flags, free(), malloc(), mountlist, mountlist_mtx, namei(), NDFREE(), path, priv_check(), sscanf(), usermount, vfs_getvfs(), vfs_ref(), vfs_rel(), vn_path_to_global_path(), and vput().
Referenced by sys_unmount().
int kernel_mount | ( | struct mntarg * | ma, |
uint64_t | flags | ||
) |
Definition at line 2799 of file vfs_mount.c.
References mntarg::error, flags, free_mntarg(), mntarg::len, mntarg::v, and vfs_donmount().
Referenced by parse_mount().
MALLOC_DEFINE | ( | M_MOUNT | , |
"mount" | , | ||
"vfs mount structure" | |||
) |
MALLOC_DEFINE | ( | M_STATFS | , |
"statfs" | , | ||
"statfs structure" | |||
) |
Definition at line 2753 of file vfs_mount.c.
References mntarg::error, mntarg::len, malloc(), name, realloc(), and mntarg::v.
Referenced by mount_argb(), mount_argsu(), parse_mount(), and parse_mountroot_options().
Definition at line 2672 of file vfs_mount.c.
References flag, mount_arg(), and name.
Referenced by sys_mount().
Definition at line 2685 of file vfs_mount.c.
References mntarg::error, mntarg::len, malloc(), name, realloc(), sbuf_data(), sbuf_delete(), sbuf_finish(), sbuf_len(), sbuf_vprintf(), and mntarg::v.
Definition at line 2727 of file vfs_mount.c.
References mntarg::error, malloc(), mount_arg(), and name.
Referenced by sys_mount().
|
static |
Definition at line 2826 of file vfs_mount.c.
References buf, DEVCTL_LEN, devctl_notify(), devctl_safe_quote_sb(), free(), malloc(), optnames, sbuf_cat(), sbuf_cpy(), sbuf_data(), sbuf_delete(), sbuf_error(), sbuf_finish(), sbuf_new(), sbuf_printf(), sbuf_putc(), and type.
Referenced by dounmount(), vfs_domount_first(), and vfs_domount_update().
|
static |
Definition at line 171 of file vfs_mount.c.
References lockdestroy(), and pcpu_zone_16.
Referenced by vfs_mount_init().
|
static |
Definition at line 155 of file vfs_mount.c.
References lockinit(), and pcpu_zone_16.
Referenced by vfs_mount_init().
MTX_SYSINIT | ( | deferred_unmount | , |
& | deferred_unmount_lock, | ||
"deferred_unmount" | , | ||
MTX_DEF | |||
) |
void resume_all_fs | ( | void | ) |
Definition at line 3004 of file vfs_mount.c.
References mountlist, mountlist_mtx, vfs_unbusy(), and vfs_write_resume().
|
static |
Definition at line 134 of file vfs_mount.c.
Referenced by vfs_deferred_unmount().
void suspend_all_fs | ( | void | ) |
Definition at line 2970 of file vfs_mount.c.
References mountlist, mountlist_mtx, printf(), vfs_busy(), vfs_unbusy(), and vfs_write_suspend().
int sys_mount | ( | struct thread * | td, |
struct mount_args * | uap | ||
) |
Definition at line 1021 of file vfs_mount.c.
References mount_args::data, mntarg::error, flags, mount_args::flags, free(), malloc(), mount_argb(), mount_argsu(), mount_args::path, mount_args::type, vfs_byname_kld(), and vfsconf.
int sys_nmount | ( | struct thread * | td, |
struct nmount_args * | uap | ||
) |
Definition at line 433 of file vfs_mount.c.
References copyinuio(), flags, nmount_args::flags, free(), nmount_args::iovcnt, nmount_args::iovp, and vfs_donmount().
int sys_unmount | ( | struct thread * | td, |
struct unmount_args * | uap | ||
) |
Definition at line 1582 of file vfs_mount.c.
References unmount_args::flags, kern_unmount(), and unmount_args::path.
SYSCTL_BOOL | ( | _vfs | , |
OID_AUTO | , | ||
default_autoro | , | ||
CTLFLAG_RW | , | ||
& | default_autoro, | ||
0 | , | ||
"Retry failed r/w mount as r/o if no explicit ro/rw option is specified" | |||
) |
SYSCTL_BOOL | ( | _vfs | , |
OID_AUTO | , | ||
recursive_forced_unmount | , | ||
CTLFLAG_RW | , | ||
& | recursive_forced_unmount, | ||
0 | , | ||
"Recursively unmount stacked upper mounts" " when a file system is forcibly unmounted" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
usermount | , | ||
CTLFLAG_RW | , | ||
& | usermount, | ||
0 | , | ||
"Unprivileged users may mount and unmount file systems" | |||
) |
SYSCTL_INT | ( | _vfs_deferred_unmount | , |
OID_AUTO | , | ||
retry_delay_hz | , | ||
CTLFLAG_RW | , | ||
& | deferred_unmount_retry_delay_hz, | ||
0 | , | ||
"Delay in units of s when retrying a failed deferred unmount" | [1/kern.hz] | ||
) |
SYSCTL_INT | ( | _vfs_deferred_unmount | , |
OID_AUTO | , | ||
total_retries | , | ||
CTLFLAG_RD | , | ||
& | deferred_unmount_total_retries, | ||
0 | , | ||
"Total number of retried deferred unmounts" | |||
) |
|
static |
SYSCTL_UINT | ( | _vfs_deferred_unmount | , |
OID_AUTO | , | ||
retry_limit | , | ||
CTLFLAG_RW | , | ||
& | deferred_unmount_retry_limit, | ||
0 | , | ||
"Maximum number of retries for deferred unmount failure" | |||
) |
SYSINIT | ( | vfs_mount | , |
SI_SUB_VFS | , | ||
SI_ORDER_ANY | , | ||
vfs_mount_init | , | ||
NULL | |||
) |
int vfs_buildopts | ( | struct uio * | auio, |
struct vfsoptlist ** | options | ||
) |
Definition at line 319 of file vfs_mount.c.
References malloc(), vfs_freeopts(), VFS_MOUNTARG_SIZE_MAX, and vfs_sanitizeopts().
Referenced by kern_jail_get(), kern_jail_set(), and vfs_donmount().
|
static |
Definition at line 1683 of file vfs_mount.c.
Referenced by dounmount().
int vfs_copyopt | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
void * | dest, | ||
int | len | ||
) |
Definition at line 2593 of file vfs_mount.c.
References name.
Referenced by kern_jail_get(), kern_jail_set(), msg_prison_check(), msg_prison_set(), sem_prison_check(), sem_prison_set(), shm_prison_check(), shm_prison_set(), and vfs_domount_update().
|
static |
|
static |
Definition at line 1952 of file vfs_mount.c.
References deferred_unmount_enqueue(), deferred_unmount_lock, deferred_unmount_retry_delay_hz, deferred_unmount_retry_limit, deferred_unmount_total_retries, dounmount(), flags, printf(), STAILQ_HEAD(), and vfs_rel().
void vfs_deleteopt | ( | struct vfsoptlist * | opts, |
const char * | name | ||
) |
Definition at line 225 of file vfs_mount.c.
References name, and vfs_freeopt().
Referenced by vfs_export().
|
static |
Definition at line 1477 of file vfs_mount.c.
References free(), malloc(), namei(), NDFREE(), priv_check(), usermount, vfs_byname(), vfs_byname_kld(), vfs_domount_first(), vfs_domount_update(), vfsconf, vn_path_to_global_path(), and vput().
Referenced by vfs_donmount().
|
static |
Definition at line 1080 of file vfs_mount.c.
References cache_purge(), mount_devctl_event(), mountcheckdirs(), mountlist, mountlist_mtx, printf(), prison_allow(), priv_check_cred(), vdrop(), vfs_allocate_syncvnode(), vfs_cache_root_clear(), vfs_emptydir(), vfs_event_signal(), vfs_freeopts(), vfs_mount_alloc(), vfs_mount_destroy(), vfs_op_exit(), vfs_unbusy(), vhold(), vinvalbuf(), vn_finished_write(), vn_irflag_set_locked(), vn_lock_pair(), vn_seqc_write_begin(), vn_seqc_write_end(), vn_start_write(), vput(), and vrele().
Referenced by vfs_domount().
|
static |
Definition at line 1256 of file vfs_mount.c.
References flag, free(), malloc(), mount_devctl_event(), vfs_allocate_syncvnode(), vfs_busy(), vfs_cache_root_clear(), vfs_copyopt(), vfs_deallocate_syncvnode(), vfs_export(), vfs_freeopts(), vfs_getopt(), vfs_mergeopts(), vfs_op_enter(), vfs_op_exit(), vfs_suser(), vfs_unbusy(), vn_seqc_write_begin(), vn_seqc_write_end(), vput(), and vrele().
Referenced by vfs_domount().
int vfs_donmount | ( | struct thread * | td, |
uint64_t | fsflags, | ||
struct uio * | fsoptions | ||
) |
Definition at line 805 of file vfs_mount.c.
References default_autoro, free(), printf(), vfs_buildopts(), vfs_domount(), vfs_freeopt(), vfs_freeopts(), vfs_getopt(), vfs_getopt_pos(), and vfs_should_downgrade_to_ro_mount().
Referenced by kernel_mount(), and sys_nmount().
|
static |
Definition at line 599 of file vfs_mount.c.
Referenced by vfs_unregister_for_notification(), and vfs_unregister_upper().
|
static |
Definition at line 260 of file vfs_mount.c.
References vfs_isopt_ro(), and vfs_isopt_rw().
Referenced by vfs_sanitizeopts().
int vfs_filteropt | ( | struct vfsoptlist * | opts, |
const char ** | legal | ||
) |
Definition at line 2323 of file vfs_mount.c.
References printf(), and snprintf().
int vfs_flagopt | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
uint64_t * | w, | ||
uint64_t | val | ||
) |
Definition at line 2480 of file vfs_mount.c.
References name.
Referenced by kern_jail_set(), msg_prison_set(), sem_prison_set(), and shm_prison_set().
|
static |
Definition at line 201 of file vfs_mount.c.
References free().
Referenced by vfs_deleteopt(), vfs_donmount(), vfs_freeopts(), and vfs_sanitizeopts().
void vfs_freeopts | ( | struct vfsoptlist * | opts | ) |
Definition at line 213 of file vfs_mount.c.
References free(), and vfs_freeopt().
Referenced by kern_jail_get(), kern_jail_set(), vfs_buildopts(), vfs_domount_first(), vfs_domount_update(), vfs_donmount(), vfs_mount_destroy(), and vfs_remount_ro().
int vfs_getopt | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
void ** | buf, | ||
int * | len | ||
) |
Definition at line 2381 of file vfs_mount.c.
Referenced by kern_jail_get(), kern_jail_set(), vfs_domount_update(), vfs_donmount(), vfs_getopt_size(), vfs_mount_error(), and vfs_opterror().
int vfs_getopt_pos | ( | struct vfsoptlist * | opts, |
const char * | name | ||
) |
Definition at line 2401 of file vfs_mount.c.
References name.
Referenced by kern_jail_get(), kern_jail_set(), and vfs_donmount().
int vfs_getopt_size | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
off_t * | value | ||
) |
Definition at line 2418 of file vfs_mount.c.
References name, value, and vfs_getopt().
char * vfs_getopts | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
int * | error | ||
) |
Definition at line 2459 of file vfs_mount.c.
References name.
|
static |
Definition at line 238 of file vfs_mount.c.
Referenced by vfs_equalopts().
|
static |
Definition at line 248 of file vfs_mount.c.
Referenced by vfs_equalopts().
|
static |
Definition at line 403 of file vfs_mount.c.
References malloc(), and vfs_sanitizeopts().
Referenced by vfs_domount_update(), and vfs_remount_ro().
struct mount * vfs_mount_alloc | ( | struct vnode * | vp, |
struct vfsconf * | vfsp, | ||
const char * | fspath, | ||
struct ucred * | cred | ||
) |
Definition at line 665 of file vfs_mount.c.
References crdup(), mount_zone, panic(), and vfs_busy().
Referenced by vfs_domount_first(), and vfs_mountroot_devfs().
void vfs_mount_destroy | ( | struct mount * | mp | ) |
Definition at line 718 of file vfs_mount.c.
References crfree(), mount_zone, panic(), vfs_freeopts(), vn_printf(), vrele(), and wakeup().
Referenced by dounmount(), and vfs_domount_first().
void vfs_mount_error | ( | struct mount * | mp, |
const char * | fmt, | ||
... | |||
) |
Definition at line 2282 of file vfs_mount.c.
References vfs_getopt(), and vsnprintf().
Referenced by vfs_hang_addrlist().
int vfs_mount_fetch_counter | ( | struct mount * | mp, |
enum mount_counter | which | ||
) |
Definition at line 1890 of file vfs_mount.c.
|
static |
Definition at line 183 of file vfs_mount.c.
References deferred_unmount_retry_delay_hz, deferred_unmount_task, hz, mount_fini(), mount_init(), mount_zone, mountlist_mtx, and vfs_deferred_unmount().
void vfs_mountedfrom | ( | struct mount * | mp, |
const char * | from | ||
) |
Definition at line 2633 of file vfs_mount.c.
Referenced by mqfs_mount().
|
static |
Definition at line 1785 of file vfs_mount.c.
References vfs_op_barrier_ipi::mp, and smp_rendezvous_cpus_done().
Referenced by vfs_op_barrier_wait().
void vfs_op_barrier_wait | ( | struct mount * | mp | ) |
Definition at line 1813 of file vfs_mount.c.
References all_cpus, vfs_op_barrier_ipi::mp, smp_no_rendezvous_barrier(), smp_rendezvous_cpus_retry(), vfs_op_barrier_ipi::srcra, vfs_op_action_func(), and vfs_op_wait_func().
Referenced by vfs_cache_root_fallback(), and vfs_op_enter().
void vfs_op_enter | ( | struct mount * | mp | ) |
Definition at line 1727 of file vfs_mount.c.
References panic(), and vfs_op_barrier_wait().
Referenced by dounmount(), vfs_domount_update(), vfs_remount_ro(), and vfs_write_suspend().
void vfs_op_exit | ( | struct mount * | mp | ) |
Definition at line 1771 of file vfs_mount.c.
References vfs_op_exit_locked().
Referenced by vfs_domount_first(), vfs_domount_update(), vfs_mountroot_devfs(), vfs_remount_ro(), and vfs_write_resume().
void vfs_op_exit_locked | ( | struct mount * | mp | ) |
Definition at line 1759 of file vfs_mount.c.
References panic().
Referenced by dounmount(), dounmount_cleanup(), vfs_op_exit(), and vfs_write_suspend().
|
static |
Definition at line 1798 of file vfs_mount.c.
References vfs_op_barrier_ipi::mp.
Referenced by vfs_op_barrier_wait().
void vfs_opterror | ( | struct vfsoptlist * | opts, |
const char * | fmt, | ||
... | |||
) |
Definition at line 2299 of file vfs_mount.c.
References vfs_getopt(), and vsnprintf().
Referenced by kern_jail_get(), and kern_jail_set().
void vfs_ref | ( | struct mount * | mp | ) |
Definition at line 527 of file vfs_mount.c.
Referenced by dounmount(), kern_reroot(), kern_unmount(), sys_quotactl(), vfs_getvfs(), vfs_unmountall(), vn_start_write(), and vn_vget_ino_gen().
struct mount * vfs_ref_from_vp | ( | struct vnode * | vp | ) |
Definition at line 496 of file vfs_mount.c.
Referenced by kern_fstatfs(), kern_statfs(), and vop_stdgetwritemount().
void vfs_register_for_notification | ( | struct mount * | mp, |
struct mount * | ump, | ||
struct mount_upper_node * | upper | ||
) |
Definition at line 589 of file vfs_mount.c.
struct mount * vfs_register_upper_from_vp | ( | struct vnode * | vp, |
struct mount * | ump, | ||
struct mount_upper_node * | upper | ||
) |
Definition at line 556 of file vfs_mount.c.
void vfs_rel | ( | struct mount * | mp | ) |
Definition at line 645 of file vfs_mount.c.
Referenced by dounmount(), kern_do_statfs(), kern_reroot(), kern_unmount(), sys_quotactl(), sysctl_vfs_ctl(), vfs_deferred_unmount(), vfs_getnewfsid(), vn_start_secondary_write(), and vn_vget_ino_gen().
int vfs_remount_ro | ( | struct mount * | mp | ) |
Definition at line 2881 of file vfs_mount.c.
References malloc(), vfs_cache_root_clear(), vfs_deallocate_syncvnode(), vfs_freeopts(), vfs_mergeopts(), vfs_op_enter(), vfs_op_exit(), vget(), vn_seqc_write_begin(), vn_seqc_write_end(), vput(), and vrele().
|
static |
Definition at line 297 of file vfs_mount.c.
References vfs_equalopts(), and vfs_freeopt().
Referenced by vfs_buildopts(), and vfs_mergeopts().
int vfs_scanopt | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 2499 of file vfs_mount.c.
References name, and vsscanf().
int vfs_setopt | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
void * | value, | ||
int | len | ||
) |
Definition at line 2524 of file vfs_mount.c.
Referenced by kern_jail_get(), msg_prison_get(), sem_prison_get(), and shm_prison_get().
int vfs_setopt_part | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
void * | value, | ||
int | len | ||
) |
Definition at line 2545 of file vfs_mount.c.
Referenced by kern_jail_get().
int vfs_setopts | ( | struct vfsoptlist * | opts, |
const char * | name, | ||
const char * | value | ||
) |
Definition at line 2567 of file vfs_mount.c.
Referenced by kern_jail_get().
|
static |
Definition at line 780 of file vfs_mount.c.
Referenced by vfs_donmount().
void vfs_unregister_for_notification | ( | struct mount * | mp, |
struct mount_upper_node * | upper | ||
) |
Definition at line 614 of file vfs_mount.c.
References vfs_drain_upper_locked().
void vfs_unregister_upper | ( | struct mount * | mp, |
struct mount_upper_node * | upper | ||
) |
Definition at line 628 of file vfs_mount.c.
References vfs_drain_upper_locked(), and wakeup().
|
static |
Definition at line 89 of file vfs_mount.c.
Referenced by vfs_donmount().
|
static |
Definition at line 131 of file vfs_mount.c.
Referenced by deferred_unmount_enqueue(), and vfs_deferred_unmount().
|
static |
Definition at line 106 of file vfs_mount.c.
Referenced by vfs_deferred_unmount(), and vfs_mount_init().
|
static |
Definition at line 101 of file vfs_mount.c.
Referenced by dounmount(), and vfs_deferred_unmount().
|
static |
Definition at line 130 of file vfs_mount.c.
Referenced by deferred_unmount_enqueue(), and vfs_mount_init().
|
static |
Definition at line 111 of file vfs_mount.c.
Referenced by vfs_deferred_unmount().
|
static |
Definition at line 118 of file vfs_mount.c.
Referenced by vfs_mount_alloc(), vfs_mount_destroy(), and vfs_mount_init().
struct mntlist mountlist = TAILQ_HEAD_INITIALIZER(mountlist) |
Definition at line 121 of file vfs_mount.c.
Referenced by bufshutdown(), dounmount(), kern_getfsstat(), kern_reroot(), kern_sync(), kern_unmount(), resume_all_fs(), set_rootvnode(), suspend_all_fs(), vfs_busyfs(), vfs_domount_first(), vfs_getvfs(), vfs_mountroot(), vfs_mountroot_devfs(), vfs_mountroot_shuffle(), and vfs_unmountall().
struct mtx_padalign __exclusive_cache_line mountlist_mtx |
Definition at line 124 of file vfs_mount.c.
Referenced by dounmount(), kern_getfsstat(), kern_reroot(), kern_sync(), kern_unmount(), resume_all_fs(), suspend_all_fs(), vfs_busy(), vfs_busyfs(), vfs_domount_first(), vfs_getvfs(), vfs_mount_init(), vfs_mountroot(), vfs_mountroot_devfs(), and vfs_mountroot_shuffle().
|
static |
Definition at line 2820 of file vfs_mount.c.
Referenced by mount_devctl_event().
|
static |
Definition at line 93 of file vfs_mount.c.
Referenced by dounmount().
|
static |
Definition at line 85 of file vfs_mount.c.
Referenced by kern_unmount(), and vfs_domount().