FreeBSD kernel kern code
vfs_subr.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_watchdog.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/asan.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/capsicum.h>
#include <sys/condvar.h>
#include <sys/conf.h>
#include <sys/counter.h>
#include <sys/dirent.h>
#include <sys/event.h>
#include <sys/eventhandler.h>
#include <sys/extattr.h>
#include <sys/file.h>
#include <sys/fcntl.h>
#include <sys/jail.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
#include <sys/ktr.h>
#include <sys/lockf.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/pctrie.h>
#include <sys/priv.h>
#include <sys/reboot.h>
#include <sys/refcount.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/sleepqueue.h>
#include <sys/smr.h>
#include <sys/smp.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/vmmeter.h>
#include <sys/vnode.h>
#include <sys/watchdog.h>
#include <machine/stdarg.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_object.h>
#include <vm/vm_extern.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_page.h>
#include <vm/vm_kern.h>
#include <vm/uma.h>

Go to the source code of this file.

Macros

#define SYNCER_MAXDELAY   32
 
#define VDBATCH_SIZE   8
 
#define SYNCER_SHUTDOWN_SPEEDUP   4
 
#define vnsz2log   8
 
#define MAXVNODES_MAX   (512UL * 1024 * 1024 / 64) /* 8M */
 
#define NFS_NCLNODE_SZ   (360 + 32)
 
#define NC_SZ   92
 
#define FSID_CACHE_SIZE   256
 
#define VNLRU_FREEVNODES_SLOP   128
 
#define KINFO_VNODESLOP   10
 
#define sync_close   ((int (*)(struct vop_close_args *))nullop)
 

Enumerations

enum  { SYNCER_RUNNING , SYNCER_SHUTTING_DOWN , SYNCER_FINAL_DELAY }
 
enum  { TSP_SEC , TSP_HZ , TSP_USEC , TSP_NSEC }
 
enum  vput_op { VRELE , VPUT , VUNREF }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static void delmntque (struct vnode *vp)
 
static int flushbuflist (struct bufv *bufv, int flags, struct bufobj *bo, int slpflag, int slptimeo)
 
static void syncer_shutdown (void *arg, int howto)
 
static int vtryrecycle (struct vnode *vp)
 
static void v_init_counters (struct vnode *)
 
static void vn_seqc_init (struct vnode *)
 
static void vn_seqc_write_end_free (struct vnode *vp)
 
static void vgonel (struct vnode *)
 
static bool vhold_recycle_free (struct vnode *)
 
static void vdropl_recycle (struct vnode *vp)
 
static void vdrop_recycle (struct vnode *vp)
 
static void vfs_knllock (void *arg)
 
static void vfs_knlunlock (void *arg)
 
static void vfs_knl_assert_lock (void *arg, int what)
 
static void destroy_vpollinfo (struct vpollinfo *vi)
 
static int v_inval_buf_range_locked (struct vnode *vp, struct bufobj *bo, daddr_t startlbn, daddr_t endlbn)
 
static void vnlru_recalc (void)
 
 SYSCTL_ULONG (_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, "Number of vnodes in existence")
 
 SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, "Number of vnodes created by getnewvnode")
 
static TAILQ_HEAD (freelst, vnode)
 
 DPCPU_DEFINE_STATIC (struct vdbatch, vd)
 
static void vdbatch_dequeue (struct vnode *vp)
 
static u_long vnlru_read_freevnodes (void)
 
static int sysctl_maxvnodes (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_kern, KERN_MAXVNODES, maxvnodes, CTLTYPE_ULONG|CTLFLAG_MPSAFE|CTLFLAG_RW, NULL, 0, sysctl_maxvnodes, "LU", "Target for maximum number of vnodes")
 
static int sysctl_wantfreevnodes (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_vfs, OID_AUTO, wantfreevnodes, CTLTYPE_ULONG|CTLFLAG_MPSAFE|CTLFLAG_RW, NULL, 0, sysctl_wantfreevnodes, "LU", "Target for minimum number of \"free\" vnodes")
 
 SYSCTL_ULONG (_kern, OID_AUTO, minvnodes, CTLFLAG_RW, &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)")
 
 SYSCTL_INT (_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, &vnlru_nowhere, 0, "Number of times the vnlru process ran without success")
 
static int sysctl_try_reclaim_vnode (SYSCTL_HANDLER_ARGS)
 
static int sysctl_ftry_reclaim_vnode (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_debug, OID_AUTO, try_reclaim_vnode, CTLTYPE_STRING|CTLFLAG_MPSAFE|CTLFLAG_WR, NULL, 0, sysctl_try_reclaim_vnode, "A", "Try to reclaim a vnode by its pathname")
 
 SYSCTL_PROC (_debug, OID_AUTO, ftry_reclaim_vnode, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_WR, NULL, 0, sysctl_ftry_reclaim_vnode, "I", "Try to reclaim a vnode by its file descriptor")
 
 _Static_assert (sizeof(struct vnode) >=1UL<< vnsz2log &&sizeof(struct vnode)< 1UL<<(vnsz2log+1), "vnsz2log needs to be updated")
 
static void * buf_trie_alloc (struct pctrie *ptree)
 
static void buf_trie_free (struct pctrie *ptree, void *node)
 
 PCTRIE_DEFINE_SMR (BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free, buf_trie_smr)
 
static MALLOC_DEFINE (M_VNODE_MARKER, "vnodemarker", "vnode marker")
 
static struct vnode * vn_alloc_marker (struct mount *mp)
 
static void vn_free_marker (struct vnode *vp)
 
static int vnode_init (void *mem, int size, int flags)
 
static void vnode_fini (void *mem, int size)
 
static void vntblinit (void *dummy __unused)
 
 SYSINIT (vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL)
 
int vfs_busy (struct mount *mp, int flags)
 
void vfs_unbusy (struct mount *mp)
 
struct mount * vfs_getvfs (fsid_t *fsid)
 
struct mount * vfs_busyfs (fsid_t *fsid)
 
int vfs_suser (struct mount *mp, struct thread *td)
 
void vfs_getnewfsid (struct mount *mp)
 
 SYSCTL_INT (_vfs, OID_AUTO, timestamp_precision, CTLFLAG_RW, &timestamp_precision, 0, "File timestamp precision (0: seconds, " "1: sec + ns accurate to 1/HZ, 2: sec + ns truncated to us, " "3+: sec + ns (max. precision))")
 
void vfs_timestamp (struct timespec *tsp)
 
void vattr_null (struct vattr *vap)
 
static int vlrureclaim (bool reclaim_nc_src, int trigger, u_long target)
 
 SYSCTL_INT (_debug, OID_AUTO, max_vnlru_free, CTLFLAG_RW, &max_vnlru_free, 0, "limit on vnode free requests per call to the vnlru_free routine")
 
static int vnlru_free_impl (int count, struct vfsops *mnt_op, struct vnode *mvp)
 
static int vnlru_free_locked (int count)
 
void vnlru_free_vfsops (int count, struct vfsops *mnt_op, struct vnode *mvp)
 
struct vnode * vnlru_alloc_marker (void)
 
void vnlru_free_marker (struct vnode *mvp)
 
static __inline void vfs_freevnodes_inc (void)
 
static __inline void vfs_freevnodes_dec (void)
 
static bool vnlru_under (u_long rnumvnodes, u_long limit)
 
static bool vnlru_under_unlocked (u_long rnumvnodes, u_long limit)
 
static void vnlru_kick (void)
 
static void vnlru_proc (void)
 
 SYSINIT (vnlru, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &vnlru_kp)
 
static struct vnode *__noinline vn_alloc_hard (struct mount *mp)
 
static struct vnode * vn_alloc (struct mount *mp)
 
static void vn_free (struct vnode *vp)
 
int getnewvnode (const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp)
 
void getnewvnode_reserve (void)
 
void getnewvnode_drop_reserve (void)
 
static void __noinline freevnode (struct vnode *vp)
 
static int insmntque1_int (struct vnode *vp, struct mount *mp, bool dtr)
 
int insmntque (struct vnode *vp, struct mount *mp)
 
int insmntque1 (struct vnode *vp, struct mount *mp)
 
int bufobj_invalbuf (struct bufobj *bo, int flags, int slpflag, int slptimeo)
 
int vinvalbuf (struct vnode *vp, int flags, int slpflag, int slptimeo)
 
int bnoreuselist (struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn)
 
int vtruncbuf (struct vnode *vp, off_t length, int blksize)
 
void v_inval_buf_range (struct vnode *vp, daddr_t startlbn, daddr_t endlbn, int blksize)
 
static void buf_vlist_remove (struct buf *bp)
 
static void buf_vlist_add (struct buf *bp, struct bufobj *bo, b_xflags_t xflags)
 
struct bufgbincore (struct bufobj *bo, daddr_t lblkno)
 
struct bufgbincore_unlocked (struct bufobj *bo, daddr_t lblkno)
 
void bgetvp (struct vnode *vp, struct buf *bp)
 
void brelvp (struct buf *bp)
 
static void vn_syncer_add_to_worklist (struct bufobj *bo, int delay)
 
static int sysctl_vfs_worklist_len (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_vfs, OID_AUTO, worklist_len, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RD, NULL, 0, sysctl_vfs_worklist_len, "I", "Syncer thread worklist length")
 
static void sched_sync (void)
 
 SYSINIT (syncer, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &up_kp)
 
static int sync_vnode (struct synclist *slp, struct bufobj **bo, struct thread *td)
 
int speedup_syncer (void)
 
void syncer_suspend (void)
 
void syncer_resume (void)
 
void reassignbuf (struct buf *bp)
 
enum vgetstate vget_prep_smr (struct vnode *vp)
 
enum vgetstate vget_prep (struct vnode *vp)
 
void vget_abort (struct vnode *vp, enum vgetstate vs)
 
int vget (struct vnode *vp, int flags)
 
int vget_finish (struct vnode *vp, int flags, enum vgetstate vs)
 
void vget_finish_ref (struct vnode *vp, enum vgetstate vs)
 
void vref (struct vnode *vp)
 
void vrefact (struct vnode *vp)
 
void vlazy (struct vnode *vp)
 
static void vunlazy (struct vnode *vp)
 
static void vunlazy_gone (struct vnode *vp)
 
static void vdefer_inactive (struct vnode *vp)
 
static void vdefer_inactive_unlocked (struct vnode *vp)
 
static void vput_final (struct vnode *vp, enum vput_op func)
 
void vrele (struct vnode *vp)
 
void vput (struct vnode *vp)
 
void vunref (struct vnode *vp)
 
void vhold (struct vnode *vp)
 
void vholdnz (struct vnode *vp)
 
bool vhold_smr (struct vnode *vp)
 
static void __noinline vdbatch_process (struct vdbatch *vd)
 
static void vdbatch_enqueue (struct vnode *vp)
 
static void __noinline vdropl_final (struct vnode *vp)
 
void vdrop (struct vnode *vp)
 
static void __always_inline vdropl_impl (struct vnode *vp, bool enqueue)
 
void vdropl (struct vnode *vp)
 
static int vinactivef (struct vnode *vp)
 
int vinactive (struct vnode *vp)
 
int vflush (struct mount *mp, int rootrefs, int flags, struct thread *td)
 
int vrecycle (struct vnode *vp)
 
int vrecyclel (struct vnode *vp)
 
void vgone (struct vnode *vp)
 
void vfs_notify_upper (struct vnode *vp, enum vfs_notify_upper_type event)
 
 _Static_assert ((VHOLD_ALL_FLAGS &~VHOLD_NO_SMR)==0, "new hold count flag not added to vn_printf")
 
void vn_printf (struct vnode *vp, const char *fmt,...)
 
static int vfsconf2x (struct sysctl_req *req, struct vfsconf *vfsp)
 
static int sysctl_vfs_conflist (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_vfs, OID_AUTO, conflist, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_vfs_conflist, "S,xvfsconf", "List of all configured filesystems")
 
static int sysctl_ovfs_conf (SYSCTL_HANDLER_ARGS)
 
static int vfs_sysctl (SYSCTL_HANDLER_ARGS)
 
static SYSCTL_NODE (_vfs, VFS_GENERIC, generic, CTLFLAG_RD|CTLFLAG_SKIP|CTLFLAG_MPSAFE, vfs_sysctl, "Generic filesystem")
 
static void unmount_or_warn (struct mount *mp)
 
void vfs_unmountall (void)
 
static void vfs_deferred_inactive (struct vnode *vp, int lkflags)
 
static int vfs_periodic_inactive_filter (struct vnode *vp, void *arg)
 
static void __noinline vfs_periodic_inactive (struct mount *mp, int flags)
 
static bool vfs_want_msync (struct vnode *vp)
 
static int vfs_periodic_msync_inactive_filter (struct vnode *vp, void *arg __unused)
 
static void __noinline vfs_periodic_msync_inactive (struct mount *mp, int flags)
 
void vfs_periodic (struct mount *mp, int flags)
 
static void destroy_vpollinfo_free (struct vpollinfo *vi)
 
void v_addpollinfo (struct vnode *vp)
 
int vn_pollrecord (struct vnode *vp, struct thread *td, int events)
 
static int sync_fsync (struct vop_fsync_args *)
 
static int sync_inactive (struct vop_inactive_args *)
 
static int sync_reclaim (struct vop_reclaim_args *)
 
 VFS_VOP_VECTOR_REGISTER (sync_vnodeops)
 
void vfs_allocate_syncvnode (struct mount *mp)
 
void vfs_deallocate_syncvnode (struct mount *mp)
 
int vn_need_pageq_flush (struct vnode *vp)
 
bool vn_isdisk_error (struct vnode *vp, int *errp)
 
bool vn_isdisk (struct vnode *vp)
 
int vaccess_vexec_smr (mode_t file_mode, uid_t file_uid, gid_t file_gid, struct ucred *cred)
 
int vaccess (enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, accmode_t accmode, struct ucred *cred)
 
int extattr_check_cred (struct vnode *vp, int attrnamespace, struct ucred *cred, struct thread *td, accmode_t accmode)
 
void vop_rename_fail (struct vop_rename_args *ap)
 
void vop_rename_pre (void *ap)
 
void vop_create_pre (void *ap)
 
void vop_create_post (void *ap, int rc)
 
void vop_whiteout_pre (void *ap)
 
void vop_whiteout_post (void *ap, int rc)
 
void vop_deleteextattr_pre (void *ap)
 
void vop_deleteextattr_post (void *ap, int rc)
 
void vop_link_pre (void *ap)
 
void vop_link_post (void *ap, int rc)
 
void vop_mkdir_pre (void *ap)
 
void vop_mkdir_post (void *ap, int rc)
 
void vop_mknod_pre (void *ap)
 
void vop_mknod_post (void *ap, int rc)
 
void vop_reclaim_post (void *ap, int rc)
 
void vop_remove_pre (void *ap)
 
void vop_remove_post (void *ap, int rc)
 
void vop_rename_post (void *ap, int rc)
 
void vop_rmdir_pre (void *ap)
 
void vop_rmdir_post (void *ap, int rc)
 
void vop_setattr_pre (void *ap)
 
void vop_setattr_post (void *ap, int rc)
 
void vop_setacl_pre (void *ap)
 
void vop_setacl_post (void *ap, int rc __unused)
 
void vop_setextattr_pre (void *ap)
 
void vop_setextattr_post (void *ap, int rc)
 
void vop_symlink_pre (void *ap)
 
void vop_symlink_post (void *ap, int rc)
 
void vop_open_post (void *ap, int rc)
 
void vop_close_post (void *ap, int rc)
 
void vop_read_post (void *ap, int rc)
 
void vop_read_pgcache_post (void *ap, int rc)
 
void vop_readdir_post (void *ap, int rc)
 
static void vfs_event_init (void *arg)
 
 SYSINIT (vfs_knlist, SI_SUB_VFS, SI_ORDER_ANY, vfs_event_init, NULL)
 
void vfs_event_signal (fsid_t *fsid, uint32_t event, intptr_t data __unused)
 
static int filt_fsattach (struct knote *kn)
 
static void filt_fsdetach (struct knote *kn)
 
static int filt_fsevent (struct knote *kn, long hint)
 
static int sysctl_vfs_ctl (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_vfs, OID_AUTO, ctl, CTLTYPE_OPAQUE|CTLFLAG_MPSAFE|CTLFLAG_WR, NULL, 0, sysctl_vfs_ctl, "", "Sysctl by fsid")
 
u_quad_t init_va_filerev (void)
 
static int filt_vfsread (struct knote *kn, long hint)
 
static int filt_vfswrite (struct knote *kn, long hint)
 
static int filt_vfsvnode (struct knote *kn, long hint)
 
static void filt_vfsdetach (struct knote *kn)
 
int vfs_kqfilter (struct vop_kqfilter_args *ap)
 
int vfs_emptydir (struct vnode *vp)
 
int vfs_read_dirent (struct vop_readdir_args *ap, struct dirent *dp, off_t off)
 
int vfs_unixify_accmode (accmode_t *accmode)
 
static int __noinline vfs_cache_root_fallback (struct mount *mp, int flags, struct vnode **vpp)
 
int vfs_cache_root (struct mount *mp, int flags, struct vnode **vpp)
 
struct vnode * vfs_cache_root_clear (struct mount *mp)
 
void vfs_cache_root_set (struct mount *mp, struct vnode *vp)
 
struct vnode * __mnt_vnode_next_all (struct vnode **mvp, struct mount *mp)
 
struct vnode * __mnt_vnode_first_all (struct vnode **mvp, struct mount *mp)
 
void __mnt_vnode_markerfree_all (struct vnode **mvp, struct mount *mp)
 
static void mnt_vnode_markerfree_lazy (struct vnode **mvp, struct mount *mp)
 
static bool mnt_vnode_next_lazy_relock (struct vnode *mvp, struct mount *mp, struct vnode *vp)
 
static struct vnode * mnt_vnode_next_lazy (struct vnode **mvp, struct mount *mp, mnt_lazy_cb_t *cb, void *cbarg)
 
struct vnode * __mnt_vnode_next_lazy (struct vnode **mvp, struct mount *mp, mnt_lazy_cb_t *cb, void *cbarg)
 
struct vnode * __mnt_vnode_first_lazy (struct vnode **mvp, struct mount *mp, mnt_lazy_cb_t *cb, void *cbarg)
 
void __mnt_vnode_markerfree_lazy (struct vnode **mvp, struct mount *mp)
 
int vn_dir_check_exec (struct vnode *vp, struct componentname *cnp)
 
void vn_seqc_write_begin_locked (struct vnode *vp)
 
void vn_seqc_write_begin (struct vnode *vp)
 
void vn_seqc_write_end_locked (struct vnode *vp)
 
void vn_seqc_write_end (struct vnode *vp)
 
void vn_irflag_set_locked (struct vnode *vp, short toset)
 
void vn_irflag_set (struct vnode *vp, short toset)
 
void vn_irflag_set_cond_locked (struct vnode *vp, short toset)
 
void vn_irflag_set_cond (struct vnode *vp, short toset)
 
void vn_irflag_unset_locked (struct vnode *vp, short tounset)
 
void vn_irflag_unset (struct vnode *vp, short tounset)
 

Variables

static u_long __exclusive_cache_line numvnodes
 
static counter_u64_t vnodes_created
 
enum vtype iftovt_tab [16]
 
int vttoif_tab [10]
 
static int sync_vnode_count
 
static int syncer_worklist_len
 
static enum { ... }  syncer_state
 
u_long desiredvnodes
 
static u_long gapvnodes
 
static u_long vhiwat
 
static u_long vlowat
 
static u_long vstir
 
static volatile int vsmalltrigger = 8
 
static int vnlru_nowhere
 
static int timestamp_precision = TSP_USEC
 
static int max_vnlru_free = 10000
 
static struct proc * vnlruproc
 
static int vnlruproc_sig
 
static struct kproc_desc vnlru_kp
 
static u_long vn_alloc_cyclecount
 
static struct proc * updateproc
 
static struct kproc_desc up_kp
 
static int first_printf = 1
 
static const char *const typename []
 
static struct vop_vector sync_vnodeops
 
static struct knlist fs_knlist
 
struct filterops fs_filtops
 
static struct filterops vfsread_filtops
 
static struct filterops vfswrite_filtops
 
static struct filterops vfsvnode_filtops
 

Macro Definition Documentation

◆ FSID_CACHE_SIZE

#define FSID_CACHE_SIZE   256

◆ KINFO_VNODESLOP

#define KINFO_VNODESLOP   10

Definition at line 4651 of file vfs_subr.c.

◆ MAXVNODES_MAX

#define MAXVNODES_MAX   (512UL * 1024 * 1024 / 64) /* 8M */

Definition at line 497 of file vfs_subr.c.

◆ NC_SZ

#define NC_SZ   92

Definition at line 657 of file vfs_subr.c.

◆ NFS_NCLNODE_SZ

#define NFS_NCLNODE_SZ   (360 + 32)

Definition at line 656 of file vfs_subr.c.

◆ sync_close

#define sync_close   ((int (*)(struct vop_close_args *))nullop)

Definition at line 5004 of file vfs_subr.c.

◆ SYNCER_MAXDELAY

#define SYNCER_MAXDELAY   32

◆ SYNCER_SHUTDOWN_SPEEDUP

#define SYNCER_SHUTDOWN_SPEEDUP   4

Definition at line 296 of file vfs_subr.c.

◆ VDBATCH_SIZE

#define VDBATCH_SIZE   8

◆ VNLRU_FREEVNODES_SLOP

#define VNLRU_FREEVNODES_SLOP   128

Definition at line 1410 of file vfs_subr.c.

◆ vnsz2log

#define vnsz2log   8

Definition at line 465 of file vfs_subr.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SYNCER_RUNNING 
SYNCER_SHUTTING_DOWN 
SYNCER_FINAL_DELAY 

Definition at line 299 of file vfs_subr.c.

◆ anonymous enum

anonymous enum
Enumerator
TSP_SEC 
TSP_HZ 
TSP_USEC 
TSP_NSEC 

Definition at line 1046 of file vfs_subr.c.

◆ vput_op

enum vput_op
Enumerator
VRELE 
VPUT 
VUNREF 

Definition at line 3199 of file vfs_subr.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ __mnt_vnode_first_all()

struct vnode * __mnt_vnode_first_all ( struct vnode **  mvp,
struct mount *  mp 
)

Definition at line 6690 of file vfs_subr.c.

References vn_alloc_marker(), and vn_free_marker().

Here is the call graph for this function:

◆ __mnt_vnode_first_lazy()

struct vnode * __mnt_vnode_first_lazy ( struct vnode **  mvp,
struct mount *  mp,
mnt_lazy_cb_t *  cb,
void *  cbarg 
)

Definition at line 6884 of file vfs_subr.c.

References mnt_vnode_markerfree_lazy(), mnt_vnode_next_lazy(), and vn_alloc_marker().

Here is the call graph for this function:

◆ __mnt_vnode_markerfree_all()

void __mnt_vnode_markerfree_all ( struct vnode **  mvp,
struct mount *  mp 
)

Definition at line 6722 of file vfs_subr.c.

References vn_free_marker().

Referenced by __mnt_vnode_next_all().

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

◆ __mnt_vnode_markerfree_lazy()

void __mnt_vnode_markerfree_lazy ( struct vnode **  mvp,
struct mount *  mp 
)

Definition at line 6909 of file vfs_subr.c.

References mnt_vnode_markerfree_lazy().

Here is the call graph for this function:

◆ __mnt_vnode_next_all()

struct vnode * __mnt_vnode_next_all ( struct vnode **  mvp,
struct mount *  mp 
)

Definition at line 6657 of file vfs_subr.c.

References __mnt_vnode_markerfree_all(), kern_yield(), and should_yield().

Here is the call graph for this function:

◆ __mnt_vnode_next_lazy()

struct vnode * __mnt_vnode_next_lazy ( struct vnode **  mvp,
struct mount *  mp,
mnt_lazy_cb_t *  cb,
void *  cbarg 
)

Definition at line 6873 of file vfs_subr.c.

References kern_yield(), mnt_vnode_next_lazy(), and should_yield().

Here is the call graph for this function:

◆ _Static_assert() [1/2]

_Static_assert ( (VHOLD_ALL_FLAGS &~VHOLD_NO_SMR)  = =0,
"new hold count flag not added to vn_printf  
)

◆ _Static_assert() [2/2]

_Static_assert ( )

◆ bgetvp()

void bgetvp ( struct vnode *  vp,
struct buf bp 
)

Definition at line 2501 of file vfs_subr.c.

References buf_vlist_add(), and vhold().

Referenced by getblkx().

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

◆ bnoreuselist()

int bnoreuselist ( struct bufv *  bufv,
struct bufobj *  bo,
daddr_t  startn,
daddr_t  endn 
)

Definition at line 2205 of file vfs_subr.c.

References brelse(), bremfree(), and buf.

Referenced by vop_stdadvise().

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

◆ brelvp()

void brelvp ( struct buf bp)

Definition at line 2526 of file vfs_subr.c.

References buf_vlist_remove(), syncer_worklist_len, and vdrop().

Referenced by brelse().

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

◆ buf_trie_alloc()

static void * buf_trie_alloc ( struct pctrie *  ptree)
static

Definition at line 476 of file vfs_subr.c.

◆ buf_trie_free()

static void buf_trie_free ( struct pctrie *  ptree,
void *  node 
)
static

Definition at line 482 of file vfs_subr.c.

◆ buf_vlist_add()

static void buf_vlist_add ( struct buf bp,
struct bufobj *  bo,
b_xflags_t  xflags 
)
static

Definition at line 2427 of file vfs_subr.c.

References buf, and panic().

Referenced by bgetvp(), and reassignbuf().

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

◆ buf_vlist_remove()

static void buf_vlist_remove ( struct buf bp)
static

Definition at line 2398 of file vfs_subr.c.

References flags.

Referenced by brelvp(), and reassignbuf().

Here is the caller graph for this function:

◆ bufobj_invalbuf()

int bufobj_invalbuf ( struct bufobj *  bo,
int  flags,
int  slpflag,
int  slptimeo 
)

Definition at line 2034 of file vfs_subr.c.

References bufobj_wwait(), flags, flushbuflist(), and panic().

Referenced by vinvalbuf().

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

◆ delmntque()

static void delmntque ( struct vnode *  vp)
static

Definition at line 1940 of file vfs_subr.c.

Referenced by vgonel().

Here is the caller graph for this function:

◆ destroy_vpollinfo()

static void destroy_vpollinfo ( struct vpollinfo *  vi)
static

Definition at line 4935 of file vfs_subr.c.

References destroy_vpollinfo_free(), and seldrain().

Referenced by freevnode().

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

◆ destroy_vpollinfo_free()

static void destroy_vpollinfo_free ( struct vpollinfo *  vi)
static

Definition at line 4926 of file vfs_subr.c.

References free(), and knlist_destroy().

Referenced by destroy_vpollinfo(), and v_addpollinfo().

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

◆ DPCPU_DEFINE_STATIC()

DPCPU_DEFINE_STATIC ( struct vdbatch  ,
vd   
)

◆ extattr_check_cred()

int extattr_check_cred ( struct vnode *  vp,
int  attrnamespace,
struct ucred *  cred,
struct thread *  td,
accmode_t  accmode 
)

Definition at line 5396 of file vfs_subr.c.

References accmode, attrnamespace, and priv_check_cred().

Here is the call graph for this function:

◆ filt_fsattach()

static int filt_fsattach ( struct knote kn)
static

Definition at line 6153 of file vfs_subr.c.

References fs_knlist, and knlist_add().

Here is the call graph for this function:

◆ filt_fsdetach()

static void filt_fsdetach ( struct knote kn)
static

Definition at line 6162 of file vfs_subr.c.

References fs_knlist, and knlist_remove().

Here is the call graph for this function:

◆ filt_fsevent()

static int filt_fsevent ( struct knote kn,
long  hint 
)
static

Definition at line 6169 of file vfs_subr.c.

◆ filt_vfsdetach()

static void filt_vfsdetach ( struct knote kn)
static

Definition at line 6310 of file vfs_subr.c.

References knlist_remove(), and vdrop().

Here is the call graph for this function:

◆ filt_vfsread()

static int filt_vfsread ( struct knote kn,
long  hint 
)
static

Definition at line 6321 of file vfs_subr.c.

References res.

◆ filt_vfsvnode()

static int filt_vfsvnode ( struct knote kn,
long  hint 
)
static

Definition at line 6369 of file vfs_subr.c.

References res.

◆ filt_vfswrite()

static int filt_vfswrite ( struct knote kn,
long  hint 
)
static

Definition at line 6350 of file vfs_subr.c.

◆ flushbuflist()

static int flushbuflist ( struct bufv *  bufv,
int  flags,
struct bufobj *  bo,
int  slpflag,
int  slptimeo 
)
static

Definition at line 2136 of file vfs_subr.c.

References brelse(), bremfree(), buf, flags, and gbincore().

Referenced by bufobj_invalbuf().

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

◆ freevnode()

static void __noinline freevnode ( struct vnode *  vp)
static

Definition at line 1878 of file vfs_subr.c.

References destroy_vpollinfo(), vn_free(), and vn_seqc_write_end_free().

Referenced by vdropl_final().

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

◆ gbincore()

struct buf * gbincore ( struct bufobj *  bo,
daddr_t  lblkno 
)

Definition at line 2468 of file vfs_subr.c.

References buf.

Referenced by cluster_read(), cluster_wbuild(), flushbuflist(), getblkx(), and vfs_bio_clcheck().

Here is the caller graph for this function:

◆ gbincore_unlocked()

struct buf * gbincore_unlocked ( struct bufobj *  bo,
daddr_t  lblkno 
)

Definition at line 2486 of file vfs_subr.c.

References buf.

Referenced by getblkx(), and incore().

Here is the caller graph for this function:

◆ getnewvnode()

int getnewvnode ( const char *  tag,
struct mount *  mp,
struct vop_vector *  vops,
struct vnode **  vpp 
)

Definition at line 1770 of file vfs_subr.c.

References buf_ops_bio, printf(), v_init_counters(), vn_alloc(), vn_seqc_init(), vnodes_created, and vnsz2log.

Referenced by mqfs_allocv(), nameiinit(), and vfs_allocate_syncvnode().

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

◆ getnewvnode_drop_reserve()

void getnewvnode_drop_reserve ( void  )

Definition at line 1866 of file vfs_subr.c.

References vn_free().

Here is the call graph for this function:

◆ getnewvnode_reserve()

void getnewvnode_reserve ( void  )

Definition at line 1856 of file vfs_subr.c.

References vn_alloc().

Here is the call graph for this function:

◆ init_va_filerev()

u_quad_t init_va_filerev ( void  )

Definition at line 6213 of file vfs_subr.c.

References bintime(), bt, and getbinuptime().

Here is the call graph for this function:

◆ insmntque()

int insmntque ( struct vnode *  vp,
struct mount *  mp 
)

Definition at line 2018 of file vfs_subr.c.

References insmntque1_int().

Referenced by mqfs_allocv().

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

◆ insmntque1()

int insmntque1 ( struct vnode *  vp,
struct mount *  mp 
)

Definition at line 2024 of file vfs_subr.c.

References insmntque1_int().

Referenced by vfs_allocate_syncvnode().

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

◆ insmntque1_int()

static int insmntque1_int ( struct vnode *  vp,
struct mount *  mp,
bool  dtr 
)
static

Definition at line 1962 of file vfs_subr.c.

References vgone(), and vput().

Referenced by insmntque(), and insmntque1().

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

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_VNODE_MARKER  ,
"vnodemarker"  ,
"vnode marker"   
)
static

◆ mnt_vnode_markerfree_lazy()

static void mnt_vnode_markerfree_lazy ( struct vnode **  mvp,
struct mount *  mp 
)
static

Definition at line 6745 of file vfs_subr.c.

References vn_free_marker().

Referenced by __mnt_vnode_first_lazy(), __mnt_vnode_markerfree_lazy(), and mnt_vnode_next_lazy().

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

◆ mnt_vnode_next_lazy()

static struct vnode * mnt_vnode_next_lazy ( struct vnode **  mvp,
struct mount *  mp,
mnt_lazy_cb_t *  cb,
void *  cbarg 
)
static

Definition at line 6811 of file vfs_subr.c.

References kern_yield(), mnt_vnode_markerfree_lazy(), mnt_vnode_next_lazy_relock(), and should_yield().

Referenced by __mnt_vnode_first_lazy(), and __mnt_vnode_next_lazy().

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

◆ mnt_vnode_next_lazy_relock()

static bool mnt_vnode_next_lazy_relock ( struct vnode *  mvp,
struct mount *  mp,
struct vnode *  vp 
)
static

Definition at line 6767 of file vfs_subr.c.

References maybe_yield(), vdropl(), and vhold().

Referenced by mnt_vnode_next_lazy().

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

◆ PCTRIE_DEFINE_SMR()

PCTRIE_DEFINE_SMR ( BUF  ,
buf  ,
b_lblkno  ,
buf_trie_alloc  ,
buf_trie_free  ,
buf_trie_smr   
)

◆ reassignbuf()

void reassignbuf ( struct buf bp)

Definition at line 2855 of file vfs_subr.c.

References buf_vlist_add(), buf_vlist_remove(), syncer_worklist_len, and vn_syncer_add_to_worklist().

Referenced by bdirty(), bundirty(), and cluster_wbuild().

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

◆ sched_sync()

static void sched_sync ( void  )
static

◆ speedup_syncer()

int speedup_syncer ( void  )

Definition at line 2799 of file vfs_subr.c.

◆ sync_fsync()

static int sync_fsync ( struct vop_fsync_args *  ap)
static

Definition at line 5098 of file vfs_subr.c.

References vfs_busy(), vfs_periodic(), vfs_unbusy(), and vn_syncer_add_to_worklist().

Here is the call graph for this function:

◆ sync_inactive()

static int sync_inactive ( struct vop_inactive_args *  ap)
static

Definition at line 5143 of file vfs_subr.c.

References vgone().

Here is the call graph for this function:

◆ sync_reclaim()

static int sync_reclaim ( struct vop_reclaim_args *  ap)
static

Definition at line 5156 of file vfs_subr.c.

References sync_vnode_count, and syncer_worklist_len.

◆ sync_vnode()

static int sync_vnode ( struct synclist *  slp,
struct bufobj **  bo,
struct thread *  td 
)
static

Definition at line 2606 of file vfs_subr.c.

References vdrop(), vn_finished_write(), vn_start_write(), and vn_syncer_add_to_worklist().

Referenced by sched_sync().

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

◆ syncer_resume()

void syncer_resume ( void  )

Definition at line 2840 of file vfs_subr.c.

References first_printf, kproc_resume(), SYNCER_RUNNING, syncer_state, and updateproc.

Here is the call graph for this function:

◆ syncer_shutdown()

static void syncer_shutdown ( void *  arg,
int  howto 
)
static

Definition at line 2819 of file vfs_subr.c.

References kproc_shutdown(), SYNCER_SHUTTING_DOWN, and syncer_state.

Referenced by sched_sync(), and syncer_suspend().

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

◆ syncer_suspend()

void syncer_suspend ( void  )

Definition at line 2833 of file vfs_subr.c.

References syncer_shutdown(), and updateproc.

Here is the call graph for this function:

◆ SYSCTL_COUNTER_U64()

SYSCTL_COUNTER_U64 ( _vfs  ,
OID_AUTO  ,
vnodes_created  ,
CTLFLAG_RD  ,
vnodes_created,
"Number of vnodes created by getnewvnode  
)

◆ sysctl_ftry_reclaim_vnode()

static int sysctl_ftry_reclaim_vnode ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 425 of file vfs_subr.c.

References cap_fcntl_rights, fd, getvnode(), sysctl_handle_int(), and vgone().

Here is the call graph for this function:

◆ SYSCTL_INT() [1/3]

SYSCTL_INT ( _debug  ,
OID_AUTO  ,
max_vnlru_free  ,
CTLFLAG_RW  ,
max_vnlru_free,
,
"limit on vnode free requests per call to the vnlru_free routine"   
)

◆ SYSCTL_INT() [2/3]

SYSCTL_INT ( _debug  ,
OID_AUTO  ,
vnlru_nowhere  ,
CTLFLAG_RW  ,
vnlru_nowhere,
,
"Number of times the vnlru process ran without success"   
)

◆ SYSCTL_INT() [3/3]

SYSCTL_INT ( _vfs  ,
OID_AUTO  ,
timestamp_precision  ,
CTLFLAG_RW  ,
timestamp_precision,
,
"File timestamp precision (0: seconds, " "1: sec + ns accurate to 1/HZ, 2: sec + ns truncated to us, " "3+: sec + ns (max. precision))"   
)

◆ sysctl_maxvnodes()

static int sysctl_maxvnodes ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 316 of file vfs_subr.c.

References cache_changesize(), desiredvnodes, sysctl_handle_long(), vfs_hash_changesize(), and vnlru_recalc().

Here is the call graph for this function:

◆ SYSCTL_NODE()

static SYSCTL_NODE ( _vfs  ,
VFS_GENERIC  ,
generic  ,
CTLFLAG_RD|CTLFLAG_SKIP|  CTLFLAG_MPSAFE,
vfs_sysctl  ,
"Generic filesystem"   
)
static

◆ sysctl_ovfs_conf()

static int sysctl_ovfs_conf ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 4624 of file vfs_subr.c.

References vfsconf.

Referenced by vfs_sysctl().

Here is the caller graph for this function:

◆ SYSCTL_PROC() [1/7]

SYSCTL_PROC ( _debug  ,
OID_AUTO  ,
ftry_reclaim_vnode  ,
CTLTYPE_INT|CTLFLAG_MPSAFE|  CTLFLAG_WR,
NULL  ,
,
sysctl_ftry_reclaim_vnode  ,
"I"  ,
"Try to reclaim a vnode by its file descriptor"   
)

◆ SYSCTL_PROC() [2/7]

SYSCTL_PROC ( _debug  ,
OID_AUTO  ,
try_reclaim_vnode  ,
CTLTYPE_STRING|CTLFLAG_MPSAFE|  CTLFLAG_WR,
NULL  ,
,
sysctl_try_reclaim_vnode  ,
"A"  ,
"Try to reclaim a vnode by its pathname"   
)

◆ SYSCTL_PROC() [3/7]

SYSCTL_PROC ( _kern  ,
KERN_MAXVNODES  ,
maxvnodes  ,
CTLTYPE_ULONG|CTLFLAG_MPSAFE|  CTLFLAG_RW,
NULL  ,
,
sysctl_maxvnodes  ,
"LU"  ,
"Target for maximum number of vnodes"   
)

◆ SYSCTL_PROC() [4/7]

SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
conflist  ,
CTLTYPE_OPAQUE|CTLFLAG_RD|  CTLFLAG_MPSAFE,
NULL  ,
,
sysctl_vfs_conflist  ,
S,
xvfsconf"  ,
"List of all configured filesystems"   
)

◆ SYSCTL_PROC() [5/7]

SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
ctl  ,
CTLTYPE_OPAQUE|CTLFLAG_MPSAFE|  CTLFLAG_WR,
NULL  ,
,
sysctl_vfs_ctl  ,
""  ,
"Sysctl by fsid"   
)

◆ SYSCTL_PROC() [6/7]

SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
wantfreevnodes  ,
CTLTYPE_ULONG|CTLFLAG_MPSAFE|  CTLFLAG_RW,
NULL  ,
,
sysctl_wantfreevnodes  ,
"LU"  ,
"Target for minimum number of \"free\" vnodes"   
)

◆ SYSCTL_PROC() [7/7]

SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
worklist_len  ,
CTLTYPE_INT|CTLFLAG_MPSAFE|  CTLFLAG_RD,
NULL  ,
,
sysctl_vfs_worklist_len  ,
"I"  ,
"Syncer thread worklist length"   
)

◆ sysctl_try_reclaim_vnode()

static int sysctl_try_reclaim_vnode ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 378 of file vfs_subr.c.

References buf, free(), malloc(), namei(), NDFREE(), and vgone().

Here is the call graph for this function:

◆ SYSCTL_ULONG() [1/2]

SYSCTL_ULONG ( _kern  ,
OID_AUTO  ,
minvnodes  ,
CTLFLAG_RW  ,
wantfreevnodes,
,
"Old name for vfs.wantfreevnodes (legacy)"   
)

◆ SYSCTL_ULONG() [2/2]

SYSCTL_ULONG ( _vfs  ,
OID_AUTO  ,
numvnodes  ,
CTLFLAG_RD  ,
numvnodes,
,
"Number of vnodes in existence"   
)

◆ sysctl_vfs_conflist()

static int sysctl_vfs_conflist ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 4547 of file vfs_subr.c.

References vfsconf, and vfsconf2x().

Here is the call graph for this function:

◆ sysctl_vfs_ctl()

static int sysctl_vfs_ctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6178 of file vfs_subr.c.

References vfs_getvfs(), and vfs_rel().

Here is the call graph for this function:

◆ sysctl_vfs_worklist_len()

static int sysctl_vfs_worklist_len ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 2581 of file vfs_subr.c.

References sync_vnode_count, and syncer_worklist_len.

◆ sysctl_wantfreevnodes()

static int sysctl_wantfreevnodes ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 348 of file vfs_subr.c.

References sysctl_handle_long(), and vnlru_recalc().

Here is the call graph for this function:

◆ SYSINIT() [1/4]

SYSINIT ( syncer  ,
SI_SUB_KTHREAD_UPDATE  ,
SI_ORDER_FIRST  ,
kproc_start  ,
up_kp 
)

◆ SYSINIT() [2/4]

SYSINIT ( vfs  ,
SI_SUB_VFS  ,
SI_ORDER_FIRST  ,
vntblinit  ,
NULL   
)

◆ SYSINIT() [3/4]

SYSINIT ( vfs_knlist  ,
SI_SUB_VFS  ,
SI_ORDER_ANY  ,
vfs_event_init  ,
NULL   
)

◆ SYSINIT() [4/4]

SYSINIT ( vnlru  ,
SI_SUB_KTHREAD_UPDATE  ,
SI_ORDER_FIRST  ,
kproc_start  ,
vnlru_kp 
)

◆ TAILQ_HEAD()

static TAILQ_HEAD ( freelst  ,
vnode   
)
static

Definition at line 155 of file vfs_subr.c.

◆ unmount_or_warn()

static void unmount_or_warn ( struct mount *  mp)
static

Definition at line 4749 of file vfs_subr.c.

References dounmount(), and printf().

Referenced by vfs_unmountall().

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

◆ v_addpollinfo()

void v_addpollinfo ( struct vnode *  vp)

Definition at line 4947 of file vfs_subr.c.

References destroy_vpollinfo_free(), knlist_init(), malloc(), vfs_knl_assert_lock(), vfs_knllock(), and vfs_knlunlock().

Referenced by vfs_kqfilter(), and vn_pollrecord().

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

◆ v_init_counters()

static void v_init_counters ( struct vnode *  vp)
static

Definition at line 2926 of file vfs_subr.c.

Referenced by getnewvnode().

Here is the caller graph for this function:

◆ v_inval_buf_range()

void v_inval_buf_range ( struct vnode *  vp,
daddr_t  startlbn,
daddr_t  endlbn,
int  blksize 
)

Definition at line 2313 of file vfs_subr.c.

References start, v_inval_buf_range_locked(), and vn_pages_remove().

Here is the call graph for this function:

◆ v_inval_buf_range_locked()

static int v_inval_buf_range_locked ( struct vnode *  vp,
struct bufobj *  bo,
daddr_t  startlbn,
daddr_t  endlbn 
)
static

Definition at line 2336 of file vfs_subr.c.

References brelse(), bremfree(), and buf.

Referenced by v_inval_buf_range(), and vtruncbuf().

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

◆ vaccess()

int vaccess ( enum vtype  type,
mode_t  file_mode,
uid_t  file_uid,
gid_t  file_gid,
accmode_t  accmode,
struct ucred *  cred 
)

Definition at line 5284 of file vfs_subr.c.

References accmode, groupmember(), priv_check_cred(), and type.

Referenced by kern_kmq_open(), ksem_access(), ksem_chmod(), mqf_chmod(), mqfs_access(), shm_access(), and shm_chmod().

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

◆ vaccess_vexec_smr()

int vaccess_vexec_smr ( mode_t  file_mode,
uid_t  file_uid,
gid_t  file_gid,
struct ucred *  cred 
)

Definition at line 5227 of file vfs_subr.c.

References groupmember(), and priv_check_cred_vfs_lookup_nomac().

Here is the call graph for this function:

◆ vattr_null()

void vattr_null ( struct vattr *  vap)

Definition at line 1085 of file vfs_subr.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vdbatch_dequeue()

static void vdbatch_dequeue ( struct vnode *  vp)
static

Definition at line 3551 of file vfs_subr.c.

Referenced by vnode_fini().

Here is the caller graph for this function:

◆ vdbatch_enqueue()

static void vdbatch_enqueue ( struct vnode *  vp)
static

Definition at line 3513 of file vfs_subr.c.

References vdbatch_process(), and VDBATCH_SIZE.

Referenced by vdropl_impl().

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

◆ vdbatch_process()

static void __noinline vdbatch_process ( struct vdbatch *  vd)
static

Definition at line 3486 of file vfs_subr.c.

References VDBATCH_SIZE.

Referenced by vdbatch_enqueue().

Here is the caller graph for this function:

◆ vdefer_inactive()

static void vdefer_inactive ( struct vnode *  vp)
static

Definition at line 3161 of file vfs_subr.c.

References vdropl(), and vlazy().

Referenced by vdefer_inactive_unlocked(), and vput_final().

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

◆ vdefer_inactive_unlocked()

static void vdefer_inactive_unlocked ( struct vnode *  vp)
static

Definition at line 3188 of file vfs_subr.c.

References vdefer_inactive(), and vdropl().

Referenced by vfs_deferred_inactive(), and vfs_periodic_msync_inactive().

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

◆ vdrop()

void vdrop ( struct vnode *  vp)

◆ vdrop_recycle()

static void vdrop_recycle ( struct vnode *  vp)
static

Definition at line 3685 of file vfs_subr.c.

References vdropl_recycle().

Referenced by vlrureclaim(), and vtryrecycle().

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

◆ vdropl()

void vdropl ( struct vnode *  vp)

Definition at line 3660 of file vfs_subr.c.

References vdropl_impl().

Referenced by mnt_vnode_next_lazy_relock(), vdefer_inactive(), vdefer_inactive_unlocked(), vdrop(), vflush(), vfs_deferred_inactive(), vgonel(), and vput_final().

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

◆ vdropl_final()

static void __noinline vdropl_final ( struct vnode *  vp)
static

Definition at line 3592 of file vfs_subr.c.

References freevnode(), and vfs_freevnodes_inc().

Referenced by vdropl_impl().

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

◆ vdropl_impl()

static void __always_inline vdropl_impl ( struct vnode *  vp,
bool  enqueue 
)
static

Definition at line 3631 of file vfs_subr.c.

References vdbatch_enqueue(), vdropl_final(), vfs_freevnodes_inc(), and vunlazy().

Referenced by vdropl(), and vdropl_recycle().

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

◆ vdropl_recycle()

static void vdropl_recycle ( struct vnode *  vp)
static

Definition at line 3678 of file vfs_subr.c.

References vdropl_impl().

Referenced by vdrop_recycle(), vlrureclaim(), and vtryrecycle().

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

◆ vflush()

int vflush ( struct mount *  mp,
int  rootrefs,
int  flags,
struct thread *  td 
)

Definition at line 3779 of file vfs_subr.c.

References busy, flags, vdrop(), vdropl(), vgone(), vgonel(), vn_printf(), vput(), and vrele().

Referenced by mqfs_unmount().

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

◆ vfs_allocate_syncvnode()

void vfs_allocate_syncvnode ( struct mount *  mp)

Definition at line 5026 of file vfs_subr.c.

References getnewvnode(), insmntque1(), panic(), start, sync_vnode_count, sync_vnodeops, vgone(), vn_syncer_add_to_worklist(), and vput().

Referenced by dounmount(), vfs_domount_first(), and vfs_domount_update().

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

◆ vfs_busy()

int vfs_busy ( struct mount *  mp,
int  flags 
)

◆ vfs_busyfs()

struct mount * vfs_busyfs ( fsid_t *  fsid)

Definition at line 918 of file vfs_subr.c.

References FSID_CACHE_SIZE, mountlist, mountlist_mtx, vfs_busy(), and vfs_unbusy().

Referenced by kern_fhlinkat(), kern_fhopen(), kern_fhstat(), kern_fhstatfs(), and sys_fhreadlink().

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

◆ vfs_cache_root()

int vfs_cache_root ( struct mount *  mp,
int  flags,
struct vnode **  vpp 
)

Definition at line 6600 of file vfs_subr.c.

References flags, vfs_cache_root_fallback(), vrefact(), and vrele().

Here is the call graph for this function:

◆ vfs_cache_root_clear()

struct vnode * vfs_cache_root_clear ( struct mount *  mp)

Definition at line 6625 of file vfs_subr.c.

References vn_seqc_write_begin().

Referenced by dounmount(), vfs_domount_first(), vfs_domount_update(), and vfs_remount_ro().

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

◆ vfs_cache_root_fallback()

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

Definition at line 6540 of file vfs_subr.c.

References flags, panic(), vfs_op_barrier_wait(), vrefact(), and vrele().

Referenced by vfs_cache_root().

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

◆ vfs_cache_root_set()

void vfs_cache_root_set ( struct mount *  mp,
struct vnode *  vp 
)

Definition at line 6641 of file vfs_subr.c.

References vrefact().

Here is the call graph for this function:

◆ vfs_deallocate_syncvnode()

void vfs_deallocate_syncvnode ( struct mount *  mp)

Definition at line 5081 of file vfs_subr.c.

References vrele().

Referenced by dounmount(), vfs_domount_update(), and vfs_remount_ro().

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

◆ vfs_deferred_inactive()

static void vfs_deferred_inactive ( struct vnode *  vp,
int  lkflags 
)
static

Definition at line 4795 of file vfs_subr.c.

References vdefer_inactive_unlocked(), vdropl(), and vinactive().

Referenced by vfs_periodic_inactive(), and vfs_periodic_msync_inactive().

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

◆ vfs_emptydir()

int vfs_emptydir ( struct vnode *  vp)

Definition at line 6394 of file vfs_subr.c.

References free(), and malloc().

Referenced by vfs_domount_first().

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

◆ vfs_event_init()

static void vfs_event_init ( void *  arg)
static

Definition at line 6127 of file vfs_subr.c.

References fs_knlist, and knlist_init_mtx().

Here is the call graph for this function:

◆ vfs_event_signal()

void vfs_event_signal ( fsid_t *  fsid,
uint32_t  event,
intptr_t data  __unused 
)

Definition at line 6135 of file vfs_subr.c.

References fs_knlist.

Referenced by dounmount(), and vfs_domount_first().

Here is the caller graph for this function:

◆ vfs_freevnodes_dec()

static __inline void vfs_freevnodes_dec ( void  )
static

Definition at line 1424 of file vfs_subr.c.

Referenced by vhold(), vhold_recycle_free(), and vhold_smr().

Here is the caller graph for this function:

◆ vfs_freevnodes_inc()

static __inline void vfs_freevnodes_inc ( void  )
static

Definition at line 1413 of file vfs_subr.c.

Referenced by vdropl_final(), and vdropl_impl().

Here is the caller graph for this function:

◆ vfs_getnewfsid()

void vfs_getnewfsid ( struct mount *  mp)

Definition at line 1013 of file vfs_subr.c.

References vfs_getvfs(), and vfs_rel().

Referenced by mqfs_mount().

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

◆ vfs_getvfs()

struct mount * vfs_getvfs ( fsid_t *  fsid)

Definition at line 889 of file vfs_subr.c.

References mountlist, mountlist_mtx, and vfs_ref().

Referenced by kern_unmount(), sysctl_vfs_ctl(), and vfs_getnewfsid().

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

◆ vfs_knl_assert_lock()

static void vfs_knl_assert_lock ( void *  arg,
int  what 
)
static

Definition at line 6258 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

◆ vfs_knllock()

static void vfs_knllock ( void *  arg)
static

Definition at line 6242 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

◆ vfs_knlunlock()

static void vfs_knlunlock ( void *  arg)
static

Definition at line 6250 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

◆ vfs_kqfilter()

int vfs_kqfilter ( struct vop_kqfilter_args *  ap)

Definition at line 6271 of file vfs_subr.c.

References knlist_add(), knote(), v_addpollinfo(), vfsread_filtops, vfsvnode_filtops, vfswrite_filtops, and vhold().

Referenced by vop_stdkqfilter().

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

◆ vfs_notify_upper()

void vfs_notify_upper ( struct vnode *  vp,
enum vfs_notify_upper_type  event 
)

Definition at line 3945 of file vfs_subr.c.

References wakeup().

Referenced by kern_frmdirat(), kern_funlinkat(), and vgonel().

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

◆ vfs_periodic()

void vfs_periodic ( struct mount *  mp,
int  flags 
)

Definition at line 4914 of file vfs_subr.c.

References flags, vfs_periodic_inactive(), and vfs_periodic_msync_inactive().

Referenced by dounmount(), kern_sync(), and sync_fsync().

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

◆ vfs_periodic_inactive()

static void __noinline vfs_periodic_inactive ( struct mount *  mp,
int  flags 
)
static

Definition at line 4822 of file vfs_subr.c.

References flags, vfs_deferred_inactive(), and vfs_periodic_inactive_filter().

Referenced by vfs_periodic().

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

◆ vfs_periodic_inactive_filter()

static int vfs_periodic_inactive_filter ( struct vnode *  vp,
void *  arg 
)
static

Definition at line 4815 of file vfs_subr.c.

Referenced by vfs_periodic_inactive().

Here is the caller graph for this function:

◆ vfs_periodic_msync_inactive()

static void __noinline vfs_periodic_msync_inactive ( struct mount *  mp,
int  flags 
)
static

Definition at line 4868 of file vfs_subr.c.

References flags, vdefer_inactive_unlocked(), vdrop(), vfs_deferred_inactive(), vfs_periodic_msync_inactive_filter(), vfs_want_msync(), vget(), and vput().

Referenced by vfs_periodic().

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

◆ vfs_periodic_msync_inactive_filter()

static int vfs_periodic_msync_inactive_filter ( struct vnode *  vp,
void *arg  __unused 
)
static

Definition at line 4857 of file vfs_subr.c.

References vfs_want_msync().

Referenced by vfs_periodic_msync_inactive().

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

◆ vfs_read_dirent()

int vfs_read_dirent ( struct vop_readdir_args *  ap,
struct dirent *  dp,
off_t  off 
)

Definition at line 6459 of file vfs_subr.c.

References free(), realloc(), and uiomove().

Referenced by mqfs_readdir().

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

◆ vfs_suser()

int vfs_suser ( struct mount *  mp,
struct thread *  td 
)

Definition at line 965 of file vfs_subr.c.

References prison_allow(), prison_check(), and priv_check().

Referenced by dounmount(), and vfs_domount_update().

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

◆ vfs_sysctl()

static int vfs_sysctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 4576 of file vfs_subr.c.

References log(), maxvfsconf, name, sysctl_ovfs_conf(), vfsconf, and vfsconf2x().

Here is the call graph for this function:

◆ vfs_timestamp()

void vfs_timestamp ( struct timespec *  tsp)

Definition at line 1058 of file vfs_subr.c.

References getnanotime(), microtime(), nanotime(), time_second, timestamp_precision, TSP_HZ, TSP_NSEC, TSP_SEC, and TSP_USEC.

Referenced by getutimens(), getutimes(), kern_sem_wait(), ksem_alloc(), mqfs_create_node(), mqfs_setattr(), shm_alloc(), shm_dotruncate_locked(), shm_mmap(), sys_ksem_getvalue(), and sys_ksem_post().

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

◆ vfs_unbusy()

void vfs_unbusy ( struct mount *  mp)

◆ vfs_unixify_accmode()

int vfs_unixify_accmode ( accmode_t *  accmode)

Definition at line 6501 of file vfs_subr.c.

References accmode.

Referenced by vop_stdaccessx().

Here is the caller graph for this function:

◆ vfs_unmountall()

void vfs_unmountall ( void  )

Definition at line 4768 of file vfs_subr.c.

References mountlist, rootdevmp, unmount_or_warn(), and vfs_ref().

Referenced by bufshutdown(), and kern_reroot().

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

◆ VFS_VOP_VECTOR_REGISTER()

VFS_VOP_VECTOR_REGISTER ( sync_vnodeops  )

◆ vfs_want_msync()

static bool vfs_want_msync ( struct vnode *  vp)
inlinestatic

Definition at line 4842 of file vfs_subr.c.

Referenced by vfs_periodic_msync_inactive(), and vfs_periodic_msync_inactive_filter().

Here is the caller graph for this function:

◆ vfsconf2x()

static int vfsconf2x ( struct sysctl_req *  req,
struct vfsconf vfsp 
)
static

Definition at line 4501 of file vfs_subr.c.

Referenced by sysctl_vfs_conflist(), and vfs_sysctl().

Here is the caller graph for this function:

◆ vget()

int vget ( struct vnode *  vp,
int  flags 
)

Definition at line 3002 of file vfs_subr.c.

References flags, vget_finish(), and vget_prep().

Referenced by mqfs_allocv(), vfs_periodic_msync_inactive(), vfs_remount_ro(), and vfs_stdsync().

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

◆ vget_abort()

void vget_abort ( struct vnode *  vp,
enum vgetstate  vs 
)

Definition at line 2986 of file vfs_subr.c.

References vdrop(), and vrele().

Referenced by cache_fplookup_final(), cache_fplookup_final_withparent(), and vget_finish().

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

◆ vget_finish()

int vget_finish ( struct vnode *  vp,
int  flags,
enum vgetstate  vs 
)

◆ vget_finish_ref()

void vget_finish_ref ( struct vnode *  vp,
enum vgetstate  vs 
)

◆ vget_prep()

enum vgetstate vget_prep ( struct vnode *  vp)

Definition at line 2972 of file vfs_subr.c.

References vhold().

Referenced by cache_lookup_dotdot(), cache_lookup_fallback(), vfs_hash_get(), vfs_hash_insert(), vget(), vn_dir_dd_ino(), and vref().

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

◆ vget_prep_smr()

enum vgetstate vget_prep_smr ( struct vnode *  vp)

Definition at line 2954 of file vfs_subr.c.

References vhold_smr().

Referenced by cache_fplookup_degenerate(), cache_fplookup_emptypath(), cache_fplookup_final(), cache_fplookup_final_modifying(), cache_fplookup_final_withparent(), cache_fplookup_noentry(), cache_fplookup_partial_setup(), and cache_lookup().

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

◆ vgone()

void vgone ( struct vnode *  vp)

Definition at line 3934 of file vfs_subr.c.

References vgonel().

Referenced by insmntque1_int(), mqfs_allocv(), sync_inactive(), sysctl_ftry_reclaim_vnode(), sysctl_try_reclaim_vnode(), vflush(), vfs_allocate_syncvnode(), and vfs_hash_insert().

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

◆ vgonel()

static void vgonel ( struct vnode *  vp)
static

◆ vhold()

void vhold ( struct vnode *  vp)

Definition at line 3376 of file vfs_subr.c.

References vfs_freevnodes_dec().

Referenced by bgetvp(), cache_hold_vnode(), do_unlink(), dounmount(), kern_openat(), mnt_vnode_next_lazy_relock(), mqfs_allocv(), nameicap_tracker_add(), vfs_domount_first(), vfs_hash_ref(), vfs_kqfilter(), vget_prep(), and vop_rename_pre().

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

◆ vhold_recycle_free()

static bool vhold_recycle_free ( struct vnode *  vp)
static

Definition at line 3461 of file vfs_subr.c.

References count, and vfs_freevnodes_dec().

Referenced by vnlru_free_impl().

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

◆ vhold_smr()

bool vhold_smr ( struct vnode *  vp)

Definition at line 3422 of file vfs_subr.c.

References count, and vfs_freevnodes_dec().

Referenced by vget_prep_smr().

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

◆ vholdnz()

void vholdnz ( struct vnode *  vp)

Definition at line 3389 of file vfs_subr.c.

◆ vinactive()

int vinactive ( struct vnode *  vp)

Definition at line 3735 of file vfs_subr.c.

References vinactivef().

Referenced by vfs_deferred_inactive(), and vput_final().

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

◆ vinactivef()

static int vinactivef ( struct vnode *  vp)
static

Definition at line 3697 of file vfs_subr.c.

Referenced by vgonel(), and vinactive().

Here is the caller graph for this function:

◆ vinvalbuf()

int vinvalbuf ( struct vnode *  vp,
int  flags,
int  slpflag,
int  slptimeo 
)

Definition at line 2121 of file vfs_subr.c.

References bufobj_invalbuf(), and flags.

Referenced by vfs_domount_first(), vfs_mountroot_shuffle(), and vgonel().

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

◆ vlazy()

void vlazy ( struct vnode *  vp)

Definition at line 3088 of file vfs_subr.c.

Referenced by vdefer_inactive(), and vop_stdadd_writecount_impl().

Here is the caller graph for this function:

◆ vlrureclaim()

static int vlrureclaim ( bool  reclaim_nc_src,
int  trigger,
u_long  target 
)
static

Definition at line 1146 of file vfs_subr.c.

References kern_yield(), should_yield(), vdrop_recycle(), vdropl_recycle(), vgonel(), vn_finished_write(), and vn_start_write().

Referenced by vnlru_proc().

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

◆ vn_alloc()

static struct vnode * vn_alloc ( struct mount *  mp)
static

Definition at line 1743 of file vfs_subr.c.

References numvnodes, vlowat, vn_alloc_cyclecount, vn_alloc_hard(), and vnlru_under_unlocked().

Referenced by getnewvnode(), and getnewvnode_reserve().

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

◆ vn_alloc_hard()

static struct vnode *__noinline vn_alloc_hard ( struct mount *  mp)
static

Definition at line 1697 of file vfs_subr.c.

References desiredvnodes, hz, numvnodes, vlowat, vn_alloc_cyclecount, vnlru_free_locked(), vnlru_kick(), vnlru_read_freevnodes(), vnlru_under(), vnlruproc_sig, and vstir.

Referenced by vn_alloc().

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

◆ vn_alloc_marker()

static struct vnode * vn_alloc_marker ( struct mount *  mp)
static

Definition at line 503 of file vfs_subr.c.

References malloc().

Referenced by __mnt_vnode_first_all(), __mnt_vnode_first_lazy(), vnlru_alloc_marker(), and vntblinit().

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

◆ vn_dir_check_exec()

int vn_dir_check_exec ( struct vnode *  vp,
struct componentname *  cnp 
)

Definition at line 6922 of file vfs_subr.c.

Referenced by vfs_cache_lookup().

Here is the caller graph for this function:

◆ vn_free()

static void vn_free ( struct vnode *  vp)
static

Definition at line 1759 of file vfs_subr.c.

References numvnodes.

Referenced by freevnode(), and getnewvnode_drop_reserve().

Here is the caller graph for this function:

◆ vn_free_marker()

static void vn_free_marker ( struct vnode *  vp)
static

Definition at line 515 of file vfs_subr.c.

References free().

Referenced by __mnt_vnode_first_all(), __mnt_vnode_markerfree_all(), mnt_vnode_markerfree_lazy(), and vnlru_free_marker().

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

◆ vn_irflag_set()

void vn_irflag_set ( struct vnode *  vp,
short  toset 
)

Definition at line 7014 of file vfs_subr.c.

References vn_irflag_set_locked().

Here is the call graph for this function:

◆ vn_irflag_set_cond()

void vn_irflag_set_cond ( struct vnode *  vp,
short  toset 
)

Definition at line 7033 of file vfs_subr.c.

References vn_irflag_set_cond_locked().

Here is the call graph for this function:

◆ vn_irflag_set_cond_locked()

void vn_irflag_set_cond_locked ( struct vnode *  vp,
short  toset 
)

Definition at line 7023 of file vfs_subr.c.

References flags.

Referenced by vn_irflag_set_cond().

Here is the caller graph for this function:

◆ vn_irflag_set_locked()

void vn_irflag_set_locked ( struct vnode *  vp,
short  toset 
)

Definition at line 7001 of file vfs_subr.c.

References flags.

Referenced by vfs_domount_first(), vfs_mountroot_shuffle(), vgonel(), and vn_irflag_set().

Here is the caller graph for this function:

◆ vn_irflag_unset()

void vn_irflag_unset ( struct vnode *  vp,
short  tounset 
)

Definition at line 7055 of file vfs_subr.c.

References vn_irflag_unset_locked().

Here is the call graph for this function:

◆ vn_irflag_unset_locked()

void vn_irflag_unset_locked ( struct vnode *  vp,
short  tounset 
)

Definition at line 7042 of file vfs_subr.c.

References flags.

Referenced by dounmount(), vfs_mountroot_shuffle(), and vn_irflag_unset().

Here is the caller graph for this function:

◆ vn_isdisk()

bool vn_isdisk ( struct vnode *  vp)

Definition at line 5215 of file vfs_subr.c.

References vn_isdisk_error().

Referenced by bp_unmapped_get_kva(), brelse(), getblkx(), and sys_aio_cancel().

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

◆ vn_isdisk_error()

bool vn_isdisk_error ( struct vnode *  vp,
int *  errp 
)

Definition at line 5192 of file vfs_subr.c.

References dev_unlock().

Referenced by vn_isdisk().

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

◆ vn_need_pageq_flush()

int vn_need_pageq_flush ( struct vnode *  vp)

Definition at line 5179 of file vfs_subr.c.

◆ vn_pollrecord()

int vn_pollrecord ( struct vnode *  vp,
struct thread *  td,
int  events 
)

Definition at line 4976 of file vfs_subr.c.

References selrecord(), and v_addpollinfo().

Referenced by vop_stdpoll().

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

◆ vn_printf()

void vn_printf ( struct vnode *  vp,
const char *  fmt,
  ... 
)

Definition at line 4134 of file vfs_subr.c.

References buf, flags, lockmgr_printinfo(), printf(), snprintf(), and vprintf().

Referenced by bufshutdown(), vflush(), vfs_lookup(), vfs_mount_destroy(), vfs_relookup(), vn_fsync_buf(), and vop_nostrategy().

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

◆ vn_seqc_init()

static void vn_seqc_init ( struct vnode *  vp)
static

Definition at line 6985 of file vfs_subr.c.

Referenced by getnewvnode().

Here is the caller graph for this function:

◆ vn_seqc_write_begin()

void vn_seqc_write_begin ( struct vnode *  vp)

◆ vn_seqc_write_begin_locked()

void vn_seqc_write_begin_locked ( struct vnode *  vp)

Definition at line 6938 of file vfs_subr.c.

Referenced by vgonel(), and vn_seqc_write_begin().

Here is the caller graph for this function:

◆ vn_seqc_write_end()

void vn_seqc_write_end ( struct vnode *  vp)

◆ vn_seqc_write_end_free()

static void vn_seqc_write_end_free ( struct vnode *  vp)
static

Definition at line 6993 of file vfs_subr.c.

Referenced by freevnode().

Here is the caller graph for this function:

◆ vn_seqc_write_end_locked()

void vn_seqc_write_end_locked ( struct vnode *  vp)

Definition at line 6959 of file vfs_subr.c.

Referenced by dounmount(), and vn_seqc_write_end().

Here is the caller graph for this function:

◆ vn_syncer_add_to_worklist()

static void vn_syncer_add_to_worklist ( struct bufobj *  bo,
int  delay 
)
static

Definition at line 2558 of file vfs_subr.c.

References syncer_worklist_len.

Referenced by reassignbuf(), sync_fsync(), sync_vnode(), and vfs_allocate_syncvnode().

Here is the caller graph for this function:

◆ vnlru_alloc_marker()

struct vnode * vnlru_alloc_marker ( void  )

Definition at line 1364 of file vfs_subr.c.

References vn_alloc_marker().

Here is the call graph for this function:

◆ vnlru_free_impl()

static int vnlru_free_impl ( int  count,
struct vfsops *  mnt_op,
struct vnode *  mvp 
)
static

Definition at line 1271 of file vfs_subr.c.

References count, max_vnlru_free, vhold_recycle_free(), and vtryrecycle().

Referenced by vnlru_free_locked(), and vnlru_free_vfsops().

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

◆ vnlru_free_locked()

static int vnlru_free_locked ( int  count)
static

Definition at line 1344 of file vfs_subr.c.

References count, and vnlru_free_impl().

Referenced by vn_alloc_hard(), and vnlru_proc().

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

◆ vnlru_free_marker()

void vnlru_free_marker ( struct vnode *  mvp)

Definition at line 1376 of file vfs_subr.c.

References vn_free_marker().

Here is the call graph for this function:

◆ vnlru_free_vfsops()

void vnlru_free_vfsops ( int  count,
struct vfsops *  mnt_op,
struct vnode *  mvp 
)

Definition at line 1352 of file vfs_subr.c.

References count, and vnlru_free_impl().

Here is the call graph for this function:

◆ vnlru_kick()

static void vnlru_kick ( void  )
static

Definition at line 1491 of file vfs_subr.c.

References vnlruproc, vnlruproc_sig, and wakeup().

Referenced by vn_alloc_hard().

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

◆ vnlru_proc()

static void vnlru_proc ( void  )
static

◆ vnlru_read_freevnodes()

static u_long vnlru_read_freevnodes ( void  )
static

Definition at line 1435 of file vfs_subr.c.

References VNLRU_FREEVNODES_SLOP.

Referenced by vn_alloc_hard(), vnlru_proc(), and vnlru_under().

Here is the caller graph for this function:

◆ vnlru_recalc()

static void vnlru_recalc ( void  )
static

Definition at line 1385 of file vfs_subr.c.

References desiredvnodes, gapvnodes, vhiwat, and vlowat.

Referenced by sysctl_maxvnodes(), sysctl_wantfreevnodes(), and vntblinit().

Here is the caller graph for this function:

◆ vnlru_under()

static bool vnlru_under ( u_long  rnumvnodes,
u_long  limit 
)
static

Definition at line 1457 of file vfs_subr.c.

References desiredvnodes, and vnlru_read_freevnodes().

Referenced by vn_alloc_hard(), and vnlru_proc().

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

◆ vnlru_under_unlocked()

static bool vnlru_under_unlocked ( u_long  rnumvnodes,
u_long  limit 
)
static

Definition at line 1474 of file vfs_subr.c.

References desiredvnodes.

Referenced by vn_alloc().

Here is the caller graph for this function:

◆ vnode_fini()

static void vnode_fini ( void *  mem,
int  size 
)
static

Definition at line 620 of file vfs_subr.c.

References kasan_mark(), lockdestroy(), rangelock_destroy(), and vdbatch_dequeue().

Referenced by vntblinit().

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

◆ vnode_init()

static int vnode_init ( void *  mem,
int  size,
int  flags 
)
static

Definition at line 574 of file vfs_subr.c.

References bufobj_init(), cache_vnode_init(), lockinit(), and rangelock_init().

Referenced by vntblinit().

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

◆ vntblinit()

static void vntblinit ( void *dummy  __unused)
static

◆ vop_close_post()

void vop_close_post ( void *  ap,
int  rc 
)

Definition at line 6086 of file vfs_subr.c.

◆ vop_create_post()

void vop_create_post ( void *  ap,
int  rc 
)

Definition at line 5723 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_create_pre()

void vop_create_pre ( void *  ap)

Definition at line 5712 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_deleteextattr_post()

void vop_deleteextattr_post ( void *  ap,
int  rc 
)

Definition at line 5769 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_deleteextattr_pre()

void vop_deleteextattr_pre ( void *  ap)

Definition at line 5758 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_link_post()

void vop_link_post ( void *  ap,
int  rc 
)

Definition at line 5795 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_link_pre()

void vop_link_pre ( void *  ap)

Definition at line 5782 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_mkdir_post()

void vop_mkdir_post ( void *  ap,
int  rc 
)

Definition at line 5823 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_mkdir_pre()

void vop_mkdir_pre ( void *  ap)

Definition at line 5812 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_mknod_post()

void vop_mknod_post ( void *  ap,
int  rc 
)

Definition at line 5859 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_mknod_pre()

void vop_mknod_pre ( void *  ap)

Definition at line 5848 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_open_post()

void vop_open_post ( void *  ap,
int  rc 
)

Definition at line 6077 of file vfs_subr.c.

◆ vop_read_pgcache_post()

void vop_read_pgcache_post ( void *  ap,
int  rc 
)

Definition at line 6107 of file vfs_subr.c.

◆ vop_read_post()

void vop_read_post ( void *  ap,
int  rc 
)

Definition at line 6098 of file vfs_subr.c.

◆ vop_readdir_post()

void vop_readdir_post ( void *  ap,
int  rc 
)

Definition at line 6116 of file vfs_subr.c.

◆ vop_reclaim_post()

void vop_reclaim_post ( void *  ap,
int  rc 
)

Definition at line 5872 of file vfs_subr.c.

◆ vop_remove_post()

void vop_remove_post ( void *  ap,
int  rc 
)

Definition at line 5898 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_remove_pre()

void vop_remove_pre ( void *  ap)

Definition at line 5885 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_rename_fail()

void vop_rename_fail ( struct vop_rename_args *  ap)

Definition at line 5511 of file vfs_subr.c.

References vput(), and vrele().

Referenced by vop_norename().

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

◆ vop_rename_post()

void vop_rename_post ( void *  ap,
int  rc 
)

Definition at line 5915 of file vfs_subr.c.

References vdrop().

Here is the call graph for this function:

◆ vop_rename_pre()

void vop_rename_pre ( void *  ap)

Definition at line 5525 of file vfs_subr.c.

References vhold().

Here is the call graph for this function:

◆ vop_rmdir_post()

void vop_rmdir_post ( void *  ap,
int  rc 
)

Definition at line 5966 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_rmdir_pre()

void vop_rmdir_pre ( void *  ap)

Definition at line 5953 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_setacl_post()

void vop_setacl_post ( void *  ap,
int rc  __unused 
)

Definition at line 6018 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_setacl_pre()

void vop_setacl_pre ( void *  ap)

Definition at line 6007 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_setattr_post()

void vop_setattr_post ( void *  ap,
int  rc 
)

Definition at line 5994 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_setattr_pre()

void vop_setattr_pre ( void *  ap)

Definition at line 5983 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_setextattr_post()

void vop_setextattr_post ( void *  ap,
int  rc 
)

Definition at line 6040 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_setextattr_pre()

void vop_setextattr_pre ( void *  ap)

Definition at line 6029 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_symlink_post()

void vop_symlink_post ( void *  ap,
int  rc 
)

Definition at line 6064 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_symlink_pre()

void vop_symlink_pre ( void *  ap)

Definition at line 6053 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vop_whiteout_post()

void vop_whiteout_post ( void *  ap,
int  rc 
)

Definition at line 5747 of file vfs_subr.c.

References vn_seqc_write_end().

Here is the call graph for this function:

◆ vop_whiteout_pre()

void vop_whiteout_pre ( void *  ap)

Definition at line 5736 of file vfs_subr.c.

References vn_seqc_write_begin().

Here is the call graph for this function:

◆ vput()

◆ vput_final()

static void vput_final ( struct vnode *  vp,
enum vput_op  func 
)
static

Definition at line 3218 of file vfs_subr.c.

References vdefer_inactive(), vdropl(), vinactive(), VPUT, VRELE, and VUNREF.

Referenced by vput(), vrele(), and vunref().

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

◆ vrecycle()

int vrecycle ( struct vnode *  vp)

Definition at line 3900 of file vfs_subr.c.

References vrecyclel().

Referenced by do_recycle(), and mqfs_inactive().

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

◆ vrecyclel()

int vrecyclel ( struct vnode *  vp)

Definition at line 3914 of file vfs_subr.c.

References vgonel().

Referenced by vrecycle().

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

◆ vref()

◆ vrefact()

◆ vrele()

◆ vtruncbuf()

int vtruncbuf ( struct vnode *  vp,
off_t  length,
int  blksize 
)

Definition at line 2254 of file vfs_subr.c.

References bawrite(), bremfree(), buf, bufobj_wwait(), and v_inval_buf_range_locked().

Here is the call graph for this function:

◆ vtryrecycle()

static int vtryrecycle ( struct vnode *  vp)
static

Definition at line 1624 of file vfs_subr.c.

References vdrop_recycle(), vdropl_recycle(), vgonel(), vn_finished_write(), and vn_start_write().

Referenced by vnlru_free_impl().

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

◆ vunlazy()

static void vunlazy ( struct vnode *  vp)
static

Definition at line 3112 of file vfs_subr.c.

Referenced by vdropl_impl().

Here is the caller graph for this function:

◆ vunlazy_gone()

static void vunlazy_gone ( struct vnode *  vp)
static

Definition at line 3141 of file vfs_subr.c.

Referenced by vgonel().

Here is the caller graph for this function:

◆ vunref()

void vunref ( struct vnode *  vp)

Definition at line 3365 of file vfs_subr.c.

References vput_final(), and VUNREF.

Referenced by kern_openat(), vfs_unp_reclaim(), vn_vget_ino_gen(), vop_stdset_text(), and vop_stdunset_text().

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

Variable Documentation

◆ desiredvnodes

u_long desiredvnodes

◆ first_printf

int first_printf = 1
static

Definition at line 2651 of file vfs_subr.c.

Referenced by sched_sync(), and syncer_resume().

◆ fs_filtops

struct filterops fs_filtops
Initial value:
= {
.f_isfd = 0,
.f_attach = filt_fsattach,
.f_detach = filt_fsdetach,
.f_event = filt_fsevent
}
static int filt_fsevent(struct knote *kn, long hint)
Definition: vfs_subr.c:6169
static int filt_fsattach(struct knote *kn)
Definition: vfs_subr.c:6153
static void filt_fsdetach(struct knote *kn)
Definition: vfs_subr.c:6162

Definition at line 6145 of file vfs_subr.c.

◆ fs_knlist

struct knlist fs_knlist
static

Definition at line 6124 of file vfs_subr.c.

Referenced by filt_fsattach(), filt_fsdetach(), vfs_event_init(), and vfs_event_signal().

◆ gapvnodes

u_long gapvnodes
static

Definition at line 304 of file vfs_subr.c.

Referenced by vnlru_proc(), and vnlru_recalc().

◆ iftovt_tab

enum vtype iftovt_tab[16]
Initial value:
= {
VNON, VFIFO, VCHR, VNON, VDIR, VNON, VBLK, VNON,
VREG, VNON, VLNK, VNON, VSOCK, VNON, VNON, VNON
}

Definition at line 143 of file vfs_subr.c.

◆ max_vnlru_free

int max_vnlru_free = 10000
static

Definition at line 1262 of file vfs_subr.c.

Referenced by vnlru_free_impl().

◆ numvnodes

u_long __exclusive_cache_line numvnodes
static

Definition at line 130 of file vfs_subr.c.

Referenced by vn_alloc(), vn_alloc_hard(), vn_free(), and vnlru_proc().

◆ sync_vnode_count

int sync_vnode_count
static

◆ sync_vnodeops

struct vop_vector sync_vnodeops
static
Initial value:
= {
.vop_bypass = VOP_EOPNOTSUPP,
.vop_close = sync_close,
.vop_fsync = sync_fsync,
.vop_inactive = sync_inactive,
.vop_need_inactive = vop_stdneed_inactive,
.vop_reclaim = sync_reclaim,
.vop_lock1 = vop_stdlock,
.vop_unlock = vop_stdunlock,
.vop_islocked = vop_stdislocked,
}
int vop_stdislocked(struct vop_islocked_args *ap)
Definition: vfs_default.c:567
int vop_stdunlock(struct vop_unlock_args *ap)
Definition: vfs_default.c:555
int vop_stdlock(struct vop_lock1_args *ap)
Definition: vfs_default.c:537
int vop_stdneed_inactive(struct vop_need_inactive_args *ap)
Definition: vfs_default.c:1435
static int sync_inactive(struct vop_inactive_args *)
Definition: vfs_subr.c:5143
static int sync_fsync(struct vop_fsync_args *)
Definition: vfs_subr.c:5098
#define sync_close
Definition: vfs_subr.c:5004
static int sync_reclaim(struct vop_reclaim_args *)
Definition: vfs_subr.c:5156

Definition at line 5009 of file vfs_subr.c.

Referenced by vfs_allocate_syncvnode().

◆ 

enum { ... } syncer_state

◆ syncer_worklist_len

int syncer_worklist_len
static

◆ timestamp_precision

int timestamp_precision = TSP_USEC
static

Definition at line 1048 of file vfs_subr.c.

Referenced by vfs_timestamp().

◆ typename

const char* const typename[]
static
Initial value:
=
{"VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD",
"VMARKER"}

Definition at line 4126 of file vfs_subr.c.

◆ up_kp

struct kproc_desc up_kp
static
Initial value:
= {
"syncer",
}
static struct proc * updateproc
Definition: vfs_subr.c:2596
static void sched_sync(void)
Definition: vfs_subr.c:2657

Definition at line 2598 of file vfs_subr.c.

◆ updateproc

struct proc* updateproc
static

Definition at line 2596 of file vfs_subr.c.

Referenced by syncer_resume(), and syncer_suspend().

◆ vfsread_filtops

struct filterops vfsread_filtops
static
Initial value:
= {
.f_isfd = 1,
.f_detach = filt_vfsdetach,
.f_event = filt_vfsread
}
static int filt_vfsread(struct knote *kn, long hint)
Definition: vfs_subr.c:6321
static void filt_vfsdetach(struct knote *kn)
Definition: vfs_subr.c:6310

Definition at line 6225 of file vfs_subr.c.

Referenced by vfs_kqfilter().

◆ vfsvnode_filtops

struct filterops vfsvnode_filtops
static
Initial value:
= {
.f_isfd = 1,
.f_detach = filt_vfsdetach,
.f_event = filt_vfsvnode
}
static int filt_vfsvnode(struct knote *kn, long hint)
Definition: vfs_subr.c:6369

Definition at line 6235 of file vfs_subr.c.

Referenced by vfs_kqfilter().

◆ vfswrite_filtops

struct filterops vfswrite_filtops
static
Initial value:
= {
.f_isfd = 1,
.f_detach = filt_vfsdetach,
.f_event = filt_vfswrite
}
static int filt_vfswrite(struct knote *kn, long hint)
Definition: vfs_subr.c:6350

Definition at line 6230 of file vfs_subr.c.

Referenced by vfs_kqfilter().

◆ vhiwat

u_long vhiwat
static

Definition at line 305 of file vfs_subr.c.

Referenced by vnlru_proc(), and vnlru_recalc().

◆ vlowat

u_long vlowat
static

Definition at line 306 of file vfs_subr.c.

Referenced by vn_alloc(), vn_alloc_hard(), vnlru_proc(), and vnlru_recalc().

◆ vn_alloc_cyclecount

u_long vn_alloc_cyclecount
static

Definition at line 1694 of file vfs_subr.c.

Referenced by vn_alloc(), and vn_alloc_hard().

◆ vnlru_kp

struct kproc_desc vnlru_kp
static
Initial value:
= {
"vnlru",
}
static struct proc * vnlruproc
Definition: vfs_subr.c:1399
static void vnlru_proc(void)
Definition: vfs_subr.c:1502

Definition at line 1605 of file vfs_subr.c.

◆ vnlru_nowhere

int vnlru_nowhere
static

Definition at line 373 of file vfs_subr.c.

Referenced by vnlru_proc().

◆ vnlruproc

struct proc* vnlruproc
static

Definition at line 1399 of file vfs_subr.c.

Referenced by vnlru_kick(), and vnlru_proc().

◆ vnlruproc_sig

int vnlruproc_sig
static

Definition at line 1400 of file vfs_subr.c.

Referenced by vn_alloc_hard(), vnlru_kick(), and vnlru_proc().

◆ vnodes_created

counter_u64_t vnodes_created
static

Definition at line 135 of file vfs_subr.c.

Referenced by getnewvnode(), and vntblinit().

◆ vsmalltrigger

volatile int vsmalltrigger = 8
static

Definition at line 308 of file vfs_subr.c.

Referenced by vnlru_proc().

◆ vstir

u_long vstir
static

Definition at line 307 of file vfs_subr.c.

Referenced by vn_alloc_hard(), and vnlru_proc().

◆ vttoif_tab

int vttoif_tab[10]
Initial value:
= {
0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK,
S_IFSOCK, S_IFIFO, S_IFMT, S_IFMT
}

Definition at line 147 of file vfs_subr.c.