FreeBSD kernel kern code
vfs_init.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/fnv_hash.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/linker.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/sx.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
#include <sys/malloc.h>
Include dependency graph for vfs_init.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
static int vfs_register (struct vfsconf *)
 
static int vfs_unregister (struct vfsconf *)
 
 MALLOC_DEFINE (M_VNODE, "vnodes", "Dynamically allocated vnodes")
 
 SX_SYSINIT (vfsconf, &vfsconf_sx, "vfsconf")
 
 SYSCTL_INT (_vfs, OID_AUTO, typenumhash, CTLFLAG_RDTUN, &vfs_typenumhash, 0, "Set vfc_typenum using a hash calculation on vfc_name, so that it does not" "change when file systems are loaded in a different order.")
 
static struct vfsconfvfs_byname_locked (const char *name)
 
struct vfsconfvfs_byname (const char *name)
 
struct vfsconfvfs_byname_kld (const char *fstype, struct thread *td, int *error)
 
static int vfs_mount_sigdefer (struct mount *mp)
 
static int vfs_unmount_sigdefer (struct mount *mp, int mntflags)
 
static int vfs_root_sigdefer (struct mount *mp, int flags, struct vnode **vpp)
 
static int vfs_cachedroot_sigdefer (struct mount *mp, int flags, struct vnode **vpp)
 
static int vfs_quotactl_sigdefer (struct mount *mp, int cmd, uid_t uid, void *arg, bool *mp_busy)
 
static int vfs_statfs_sigdefer (struct mount *mp, struct statfs *sbp)
 
static int vfs_sync_sigdefer (struct mount *mp, int waitfor)
 
static int vfs_vget_sigdefer (struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
 
static int vfs_fhtovp_sigdefer (struct mount *mp, struct fid *fidp, int flags, struct vnode **vpp)
 
static int vfs_checkexp_sigdefer (struct mount *mp, struct sockaddr *nam, uint64_t *exflg, struct ucred **credp, int *numsecflavors, int *secflavors)
 
static int vfs_extattrctl_sigdefer (struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname)
 
static int vfs_sysctl_sigdefer (struct mount *mp, fsctlop_t op, struct sysctl_req *req)
 
static void vfs_susp_clean_sigdefer (struct mount *mp)
 
static void vfs_reclaim_lowervp_sigdefer (struct mount *mp, struct vnode *vp)
 
static void vfs_unlink_lowervp_sigdefer (struct mount *mp, struct vnode *vp)
 
static void vfs_purge_sigdefer (struct mount *mp)
 
int vfs_modevent (module_t mod, int type, void *data)
 

Variables

int maxvfsconf = VFS_GENERIC + 1
 
struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf)
 
struct sx vfsconf_sx
 
static int vfs_typenumhash = 1
 
struct vattr va_null
 
static struct vfsops vfsops_sigdefer
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_VNODE  ,
"vnodes"  ,
"Dynamically allocated vnodes"   
)

◆ SX_SYSINIT()

SX_SYSINIT ( vfsconf  ,
vfsconf_sx,
"vfsconf"   
)

◆ SYSCTL_INT()

SYSCTL_INT ( _vfs  ,
OID_AUTO  ,
typenumhash  ,
CTLFLAG_RDTUN  ,
vfs_typenumhash,
,
"Set vfc_typenum using a hash calculation on  vfc_name,
so that it does not" "change when file systems are loaded in a different order."   
)

◆ vfs_byname()

struct vfsconf * vfs_byname ( const char *  name)

Definition at line 129 of file vfs_init.c.

References name, vfs_byname_locked(), and vfsconf.

Referenced by parse_mount(), vfs_byname_kld(), vfs_domount(), and vfs_mountroot_devfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfs_byname_kld()

struct vfsconf * vfs_byname_kld ( const char *  fstype,
struct thread *  td,
int *  error 
)

Definition at line 140 of file vfs_init.c.

References kern_kldload(), kern_kldunload(), vfs_byname(), and vfsconf.

Referenced by sys_mount(), and vfs_domount().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfs_byname_locked()

static struct vfsconf * vfs_byname_locked ( const char *  name)
static

Definition at line 114 of file vfs_init.c.

References name, vfsconf, and vfsconf_sx.

Referenced by vfs_byname(), vfs_register(), and vfs_unregister().

Here is the caller graph for this function:

◆ vfs_cachedroot_sigdefer()

static int vfs_cachedroot_sigdefer ( struct mount *  mp,
int  flags,
struct vnode **  vpp 
)
static

Definition at line 204 of file vfs_init.c.

References flags.

◆ vfs_checkexp_sigdefer()

static int vfs_checkexp_sigdefer ( struct mount *  mp,
struct sockaddr *  nam,
uint64_t *  exflg,
struct ucred **  credp,
int *  numsecflavors,
int *  secflavors 
)
static

Definition at line 273 of file vfs_init.c.

◆ vfs_extattrctl_sigdefer()

static int vfs_extattrctl_sigdefer ( struct mount *  mp,
int  cmd,
struct vnode *  filename_vp,
int  attrnamespace,
const char *  attrname 
)
static

Definition at line 286 of file vfs_init.c.

References attrnamespace.

◆ vfs_fhtovp_sigdefer()

static int vfs_fhtovp_sigdefer ( struct mount *  mp,
struct fid *  fidp,
int  flags,
struct vnode **  vpp 
)
static

Definition at line 261 of file vfs_init.c.

References flags.

◆ vfs_modevent()

int vfs_modevent ( module_t  mod,
int  type,
void *  data 
)

Definition at line 572 of file vfs_init.c.

References data, type, vfs_register(), vfs_unregister(), and vfsconf.

Referenced by mq_modload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfs_mount_sigdefer()

static int vfs_mount_sigdefer ( struct mount *  mp)
static

Definition at line 169 of file vfs_init.c.

◆ vfs_purge_sigdefer()

static void vfs_purge_sigdefer ( struct mount *  mp)
static

Definition at line 346 of file vfs_init.c.

◆ vfs_quotactl_sigdefer()

static int vfs_quotactl_sigdefer ( struct mount *  mp,
int  cmd,
uid_t  uid,
void *  arg,
bool *  mp_busy 
)
static

Definition at line 215 of file vfs_init.c.

◆ vfs_reclaim_lowervp_sigdefer()

static void vfs_reclaim_lowervp_sigdefer ( struct mount *  mp,
struct vnode *  vp 
)
static

Definition at line 322 of file vfs_init.c.

◆ vfs_register()

◆ vfs_root_sigdefer()

static int vfs_root_sigdefer ( struct mount *  mp,
int  flags,
struct vnode **  vpp 
)
static

Definition at line 193 of file vfs_init.c.

References flags.

◆ vfs_statfs_sigdefer()

static int vfs_statfs_sigdefer ( struct mount *  mp,
struct statfs *  sbp 
)
static

Definition at line 228 of file vfs_init.c.

◆ vfs_susp_clean_sigdefer()

static void vfs_susp_clean_sigdefer ( struct mount *  mp)
static

Definition at line 310 of file vfs_init.c.

◆ vfs_sync_sigdefer()

static int vfs_sync_sigdefer ( struct mount *  mp,
int  waitfor 
)
static

Definition at line 239 of file vfs_init.c.

◆ vfs_sysctl_sigdefer()

static int vfs_sysctl_sigdefer ( struct mount *  mp,
fsctlop_t  op,
struct sysctl_req *  req 
)
static

Definition at line 299 of file vfs_init.c.

◆ vfs_unlink_lowervp_sigdefer()

static void vfs_unlink_lowervp_sigdefer ( struct mount *  mp,
struct vnode *  vp 
)
static

Definition at line 334 of file vfs_init.c.

◆ vfs_unmount_sigdefer()

static int vfs_unmount_sigdefer ( struct mount *  mp,
int  mntflags 
)
static

Definition at line 182 of file vfs_init.c.

◆ vfs_unregister()

static int vfs_unregister ( struct vfsconf vfc)
static

Definition at line 530 of file vfs_init.c.

References maxvfsconf, vfs_byname_locked(), and vfsconf.

Referenced by vfs_modevent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfs_vget_sigdefer()

static int vfs_vget_sigdefer ( struct mount *  mp,
ino_t  ino,
int  flags,
struct vnode **  vpp 
)
static

Definition at line 250 of file vfs_init.c.

References flags.

Variable Documentation

◆ maxvfsconf

int maxvfsconf = VFS_GENERIC + 1

Definition at line 64 of file vfs_init.c.

Referenced by vfs_register(), vfs_sysctl(), and vfs_unregister().

◆ va_null

struct vattr va_null

Definition at line 90 of file vfs_init.c.

Referenced by vfs_register().

◆ vfs_typenumhash

int vfs_typenumhash = 1
static

Definition at line 80 of file vfs_init.c.

Referenced by vfs_register().

◆ vfsconf

struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf)

◆ vfsconf_sx

struct sx vfsconf_sx

Definition at line 71 of file vfs_init.c.

Referenced by vfs_byname_locked().

◆ vfsops_sigdefer

struct vfsops vfsops_sigdefer
static
Initial value:
= {
.vfs_mount = vfs_mount_sigdefer,
.vfs_unmount = vfs_unmount_sigdefer,
.vfs_root = vfs_root_sigdefer,
.vfs_cachedroot = vfs_cachedroot_sigdefer,
.vfs_quotactl = vfs_quotactl_sigdefer,
.vfs_statfs = vfs_statfs_sigdefer,
.vfs_sync = vfs_sync_sigdefer,
.vfs_vget = vfs_vget_sigdefer,
.vfs_fhtovp = vfs_fhtovp_sigdefer,
.vfs_checkexp = vfs_checkexp_sigdefer,
.vfs_extattrctl = vfs_extattrctl_sigdefer,
.vfs_sysctl = vfs_sysctl_sigdefer,
.vfs_susp_clean = vfs_susp_clean_sigdefer,
.vfs_reclaim_lowervp = vfs_reclaim_lowervp_sigdefer,
.vfs_unlink_lowervp = vfs_unlink_lowervp_sigdefer,
.vfs_purge = vfs_purge_sigdefer,
}
static int vfs_extattrctl_sigdefer(struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname)
Definition: vfs_init.c:286
static int vfs_unmount_sigdefer(struct mount *mp, int mntflags)
Definition: vfs_init.c:182
static int vfs_sysctl_sigdefer(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
Definition: vfs_init.c:299
static int vfs_checkexp_sigdefer(struct mount *mp, struct sockaddr *nam, uint64_t *exflg, struct ucred **credp, int *numsecflavors, int *secflavors)
Definition: vfs_init.c:273
static int vfs_sync_sigdefer(struct mount *mp, int waitfor)
Definition: vfs_init.c:239
static void vfs_purge_sigdefer(struct mount *mp)
Definition: vfs_init.c:346
static void vfs_unlink_lowervp_sigdefer(struct mount *mp, struct vnode *vp)
Definition: vfs_init.c:334
static void vfs_reclaim_lowervp_sigdefer(struct mount *mp, struct vnode *vp)
Definition: vfs_init.c:322
static int vfs_statfs_sigdefer(struct mount *mp, struct statfs *sbp)
Definition: vfs_init.c:228
static int vfs_fhtovp_sigdefer(struct mount *mp, struct fid *fidp, int flags, struct vnode **vpp)
Definition: vfs_init.c:261
static int vfs_quotactl_sigdefer(struct mount *mp, int cmd, uid_t uid, void *arg, bool *mp_busy)
Definition: vfs_init.c:215
static void vfs_susp_clean_sigdefer(struct mount *mp)
Definition: vfs_init.c:310
static int vfs_mount_sigdefer(struct mount *mp)
Definition: vfs_init.c:169
static int vfs_root_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
Definition: vfs_init.c:193
static int vfs_cachedroot_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
Definition: vfs_init.c:204
static int vfs_vget_sigdefer(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
Definition: vfs_init.c:250

Definition at line 355 of file vfs_init.c.

Referenced by vfs_register().