FreeBSD kernel kern code
vfs_subr.c File Reference
#include <sys/cdefs.h>
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_watchdog.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/condvar.h>
#include <sys/conf.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/lockf.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/priv.h>
#include <sys/reboot.h>
#include <sys/sched.h>
#include <sys/sleepqueue.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>
Include dependency graph for vfs_subr.c:

Go to the source code of this file.

Macros

#define WI_MPSAFEQ   0
 
#define WI_GIANTQ   1
 
#define SYNCER_MAXDELAY   32
 
#define SYNCER_SHUTDOWN_SPEEDUP   4
 
#define VCANRECYCLE(vp)   (((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt)
 
#define VSHOULDFREE(vp)   (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt)
 
#define VSHOULDBUSY(vp)   (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt)
 
#define MAXVNODES_MAX   (512 * (1024 * 1024 * 1024 / (int)PAGE_SIZE / 16))
 
#define FSID_CACHE_SIZE   256
 
#define VPUTX_VRELE   1
 
#define VPUTX_VPUT   2
 
#define VPUTX_VUNREF   3
 
#define KINFO_VNODESLOP   10
 
#define sync_close   ((int (*)(struct vop_close_args *))nullop)
 
#define ALWAYS_YIELD   1
 

Enumerations

enum  { TSP_SEC, TSP_HZ, TSP_USEC, TSP_NSEC }
 

Functions

 __FBSDID ("$BSDSUniX$")
 
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_incr_usecount (struct vnode *)
 
static void v_decr_usecount (struct vnode *)
 
static void v_decr_useonly (struct vnode *)
 
static void v_upgrade_usecount (struct vnode *)
 
static void vnlru_free (int)
 
static void vgonel (struct vnode *)
 
static void vfs_knllock (void *arg)
 
static void vfs_knlunlock (void *arg)
 
static void vfs_knl_assert_locked (void *arg)
 
static void vfs_knl_assert_unlocked (void *arg)
 
static void destroy_vpollinfo (struct vpollinfo *vi)
 
 SYSCTL_ULONG (_vfs, OID_AUTO, numvnodes, CTLFLAG_RD,&numvnodes, 0,"Number of vnodes in existence")
 
 SYSCTL_ULONG (_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD,&vnodes_created, 0,"Number of vnodes created by getnewvnode")
 
static TAILQ_HEAD (freelst, vnode)
 
 SYSCTL_INT (_kern, KERN_MAXVNODES, maxvnodes, CTLFLAG_RW,&desiredvnodes, 0,"Maximum number of vnodes")
 
 SYSCTL_ULONG (_kern, OID_AUTO, minvnodes, CTLFLAG_RW,&wantfreevnodes, 0,"Minimum number of vnodes (legacy)")
 
 SYSCTL_INT (_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW,&vnlru_nowhere, 0,"Number of times the vnlru process ran without success")
 
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 ms, ""3+: sec + ns (max. precision))")
 
void vfs_timestamp (struct timespec *tsp)
 
void vattr_null (struct vattr *vap)
 
static int vlrureclaim (struct mount *mp)
 
static void vnlru_proc (void)
 
 SYSINIT (vnlru, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start,&vnlru_kp)
 
static int getnewvnode_wait (int suspended)
 
void getnewvnode_reserve (u_int count)
 
void getnewvnode_drop_reserve (void)
 
int getnewvnode (const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp)
 
static void insmntque_stddtr (struct vnode *vp, void *dtr_arg)
 
int insmntque1 (struct vnode *vp, struct mount *mp, void(*dtr)(struct vnode *, void *), void *dtr_arg)
 
int insmntque (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 vtruncbuf (struct vnode *vp, struct ucred *cred, struct thread *td, off_t length, int blksize)
 
static struct bufbuf_splay (daddr_t lblkno, b_xflags_t xflags, struct buf *root)
 
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)
 
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_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 reassignbuf (struct buf *bp)
 
int vget (struct vnode *vp, int flags, struct thread *td)
 
void vref (struct vnode *vp)
 
int vrefcnt (struct vnode *vp)
 
static void vputx (struct vnode *vp, int func)
 
void vrele (struct vnode *vp)
 
void vput (struct vnode *vp)
 
void vunref (struct vnode *vp)
 
void vhold (struct vnode *vp)
 
void vholdl (struct vnode *vp)
 
void vdrop (struct vnode *vp)
 
void vdropl (struct vnode *vp)
 
void vinactive (struct vnode *vp, struct thread *td)
 
int vflush (struct mount *mp, int rootrefs, int flags, struct thread *td)
 
int vrecycle (struct vnode *vp, struct thread *td)
 
void vgone (struct vnode *vp)
 
static void notify_lowervp_vfs_dummy (struct mount *mp __unused, struct vnode *lowervp __unused)
 
void vfs_notify_upper (struct vnode *vp, int event)
 
int vcount (struct vnode *vp)
 
int count_dev (struct cdev *dev)
 
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, 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, vfs_sysctl,"Generic filesystem")
 
void vfs_unmountall (void)
 
void vfs_msync (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 *)
 
void vfs_allocate_syncvnode (struct mount *mp)
 
void vfs_deallocate_syncvnode (struct mount *mp)
 
int vn_isdisk (struct vnode *vp, int *errp)
 
int vaccess (enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, accmode_t accmode, struct ucred *cred, int *privused)
 
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_strategy_pre (void *ap)
 
void vop_lock_pre (void *ap)
 
void vop_lock_post (void *ap, int rc)
 
void vop_unlock_pre (void *ap)
 
void vop_unlock_post (void *ap, int rc)
 
void vop_create_post (void *ap, int rc)
 
void vop_deleteextattr_post (void *ap, int rc)
 
void vop_link_post (void *ap, int rc)
 
void vop_mkdir_post (void *ap, int rc)
 
void vop_mknod_post (void *ap, int rc)
 
void vop_remove_post (void *ap, int rc)
 
void vop_rename_post (void *ap, int rc)
 
void vop_rmdir_post (void *ap, int rc)
 
void vop_setattr_post (void *ap, int rc)
 
void vop_setextattr_post (void *ap, int rc)
 
void vop_symlink_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_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_read_dirent (struct vop_readdir_args *ap, struct dirent *dp, off_t off)
 
void vfs_mark_atime (struct vnode *vp, struct ucred *cred)
 
int vfs_unixify_accmode (accmode_t *accmode)
 
 MALLOC_DEFINE (M_VNODE_MARKER,"vnodemarker","vnode marker")
 
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_active (struct vnode **mvp, struct mount *mp)
 
static struct vnode * mnt_vnode_next_active (struct vnode **mvp, struct mount *mp)
 
struct vnode * __mnt_vnode_next_active (struct vnode **mvp, struct mount *mp)
 
struct vnode * __mnt_vnode_first_active (struct vnode **mvp, struct mount *mp)
 
void __mnt_vnode_markerfree_active (struct vnode **mvp, struct mount *mp)
 

Variables

static unsigned long numvnodes
 
static u_long vnodes_created
 
enum vtype iftovt_tab [16]
 
int vttoif_tab [10]
 
 syncer_state
 
int desiredvnodes
 
static int vnlru_nowhere
 
static int vnsz2log
 
static int timestamp_precision = TSP_USEC
 
static struct proc * vnlruproc
 
static int vnlruproc_sig
 
static struct kproc_desc vnlru_kp
 
static struct proc * updateproc
 
static struct kproc_desc up_kp
 
static char * 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

#define ALWAYS_YIELD   1

Definition at line 4866 of file vfs_subr.c.

Referenced by mnt_vnode_next_active().

#define FSID_CACHE_SIZE   256

Referenced by vfs_busyfs().

#define KINFO_VNODESLOP   10

Definition at line 3453 of file vfs_subr.c.

#define MAXVNODES_MAX   (512 * (1024 * 1024 * 1024 / (int)PAGE_SIZE / 16))

Definition at line 304 of file vfs_subr.c.

Referenced by vntblinit().

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

Definition at line 3710 of file vfs_subr.c.

#define SYNCER_MAXDELAY   32
#define SYNCER_SHUTDOWN_SPEEDUP   4

Referenced by sched_sync().

#define VCANRECYCLE (   vp)    (((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt)

Definition at line 289 of file vfs_subr.c.

Referenced by vnlru_free().

#define VPUTX_VPUT   2

Definition at line 2333 of file vfs_subr.c.

Referenced by vput(), and vputx().

#define VPUTX_VRELE   1

Definition at line 2332 of file vfs_subr.c.

Referenced by vputx(), and vrele().

#define VPUTX_VUNREF   3

Definition at line 2334 of file vfs_subr.c.

Referenced by vputx(), and vunref().

#define VSHOULDBUSY (   vp)    (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt)

Definition at line 291 of file vfs_subr.c.

Referenced by vholdl().

#define VSHOULDFREE (   vp)    (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt)

Definition at line 290 of file vfs_subr.c.

Referenced by vdropl().

#define WI_GIANTQ   1

Definition at line 98 of file vfs_subr.c.

Referenced by sched_sync(), vn_syncer_add_to_worklist(), and vntblinit().

#define WI_MPSAFEQ   0

Definition at line 97 of file vfs_subr.c.

Referenced by sched_sync(), vn_syncer_add_to_worklist(), and vntblinit().

Enumeration Type Documentation

anonymous enum
Enumerator
TSP_SEC 
TSP_HZ 
TSP_USEC 
TSP_NSEC 

Definition at line 623 of file vfs_subr.c.

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
struct vnode* __mnt_vnode_first_active ( struct vnode **  mvp,
struct mount *  mp 
)

Definition at line 4929 of file vfs_subr.c.

References malloc(), mnt_vnode_markerfree_active(), and mnt_vnode_next_active().

Here is the call graph for this function:

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

Definition at line 4797 of file vfs_subr.c.

References free(), and malloc().

Here is the call graph for this function:

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

Definition at line 4952 of file vfs_subr.c.

References mnt_vnode_markerfree_active().

Here is the call graph for this function:

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

Definition at line 4828 of file vfs_subr.c.

References free().

Referenced by __mnt_vnode_next_all().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 4919 of file vfs_subr.c.

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

Here is the call graph for this function:

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

Definition at line 4769 of file vfs_subr.c.

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

Here is the call graph for this function:

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

Definition at line 1733 of file vfs_subr.c.

References buf_vlist_add(), and vhold().

Referenced by getblk().

Here is the call graph for this function:

Here is the caller graph for this function:

void brelvp ( struct buf bp)

Definition at line 1760 of file vfs_subr.c.

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

Referenced by brelse(), getnewbuf_reuse_bp(), and vfs_vmio_release().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct buf* buf_splay ( daddr_t  lblkno,
b_xflags_t  xflags,
struct buf root 
)
static

Definition at line 1564 of file vfs_subr.c.

References buf, and dummy.

Referenced by buf_vlist_add(), buf_vlist_remove(), and gbincore().

Here is the caller graph for this function:

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

Definition at line 1656 of file vfs_subr.c.

References buf, and buf_splay().

Referenced by bgetvp(), and reassignbuf().

Here is the call graph for this function:

Here is the caller graph for this function:

static void buf_vlist_remove ( struct buf bp)
static

Definition at line 1619 of file vfs_subr.c.

References buf, and buf_splay().

Referenced by brelvp(), and reassignbuf().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1264 of file vfs_subr.c.

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

Referenced by vinvalbuf().

Here is the call graph for this function:

Here is the caller graph for this function:

int count_dev ( struct cdev *  dev)

Definition at line 2974 of file vfs_subr.c.

References count, and dev_unlock().

Here is the call graph for this function:

static void delmntque ( struct vnode *  vp)
static

Definition at line 1148 of file vfs_subr.c.

Referenced by vgonel().

Here is the caller graph for this function:

static void destroy_vpollinfo ( struct vpollinfo *  vi)
static

Definition at line 3641 of file vfs_subr.c.

References destroy_vpollinfo_free(), and seldrain().

Referenced by vdropl().

Here is the call graph for this function:

Here is the caller graph for this function:

static void destroy_vpollinfo_free ( struct vpollinfo *  vi)
static

Definition at line 3632 of file vfs_subr.c.

References knlist_destroy(), and mtx_destroy().

Referenced by destroy_vpollinfo(), and v_addpollinfo().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 4031 of file vfs_subr.c.

References priv_check_cred().

Here is the call graph for this function:

static int filt_fsattach ( struct knote kn)
static

Definition at line 4427 of file vfs_subr.c.

References fs_knlist, and knlist_add().

Here is the call graph for this function:

static void filt_fsdetach ( struct knote kn)
static

Definition at line 4436 of file vfs_subr.c.

References fs_knlist, and knlist_remove().

Here is the call graph for this function:

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

Definition at line 4443 of file vfs_subr.c.

static void filt_vfsdetach ( struct knote kn)
static

Definition at line 4587 of file vfs_subr.c.

References knlist_remove(), and vdrop().

Here is the call graph for this function:

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

Definition at line 4598 of file vfs_subr.c.

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

Definition at line 4646 of file vfs_subr.c.

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

Definition at line 4627 of file vfs_subr.c.

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

Definition at line 1363 of file vfs_subr.c.

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

Referenced by bufobj_invalbuf().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1705 of file vfs_subr.c.

References buf, and buf_splay().

Referenced by cluster_read_gb(), cluster_wbuild_gb(), getblk(), incore(), and vfs_bio_clcheck().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1051 of file vfs_subr.c.

References buf_ops_bio, getnewvnode_wait(), lockinit(), mtx_init(), numvnodes, printf(), rangelock_init(), v_incr_usecount(), vnlru_free(), and vnodes_created.

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:

void getnewvnode_drop_reserve ( void  )

Definition at line 1038 of file vfs_subr.c.

References numvnodes.

void getnewvnode_reserve ( u_int  count)

Definition at line 1014 of file vfs_subr.c.

References count, getnewvnode_wait(), and numvnodes.

Here is the call graph for this function:

static int getnewvnode_wait ( int  suspended)
static

Definition at line 989 of file vfs_subr.c.

References hz, numvnodes, vnlru_free(), and wakeup().

Referenced by getnewvnode(), and getnewvnode_reserve().

Here is the call graph for this function:

Here is the caller graph for this function:

u_quad_t init_va_filerev ( void  )

Definition at line 4486 of file vfs_subr.c.

References bintime(), and getbinuptime().

Here is the call graph for this function:

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

Definition at line 1253 of file vfs_subr.c.

References insmntque1(), and insmntque_stddtr().

Referenced by mqfs_allocv(), and vfs_allocate_syncvnode().

Here is the call graph for this function:

Here is the caller graph for this function:

int insmntque1 ( struct vnode *  vp,
struct mount *  mp,
void(*)(struct vnode *, void *)  dtr,
void *  dtr_arg 
)

Definition at line 1197 of file vfs_subr.c.

Referenced by insmntque().

Here is the caller graph for this function:

static void insmntque_stddtr ( struct vnode *  vp,
void *  dtr_arg 
)
static

Definition at line 1180 of file vfs_subr.c.

References vgone(), and vput().

Referenced by insmntque().

Here is the call graph for this function:

Here is the caller graph for this function:

MALLOC_DEFINE ( M_VNODE_MARKER  ,
"vnodemarker"  ,
"vnode marker"   
)
static void mnt_vnode_markerfree_active ( struct vnode **  mvp,
struct mount *  mp 
)
static

Definition at line 4851 of file vfs_subr.c.

References free().

Referenced by __mnt_vnode_first_active(), __mnt_vnode_markerfree_active(), and mnt_vnode_next_active().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct vnode* mnt_vnode_next_active ( struct vnode **  mvp,
struct mount *  mp 
)
static

Definition at line 4870 of file vfs_subr.c.

References ALWAYS_YIELD, mnt_vnode_markerfree_active(), pause(), and should_yield().

Referenced by __mnt_vnode_first_active(), and __mnt_vnode_next_active().

Here is the call graph for this function:

Here is the caller graph for this function:

static void notify_lowervp_vfs_dummy ( struct mount *mp  __unused,
struct vnode *lowervp  __unused 
)
static

Definition at line 2807 of file vfs_subr.c.

Referenced by vfs_notify_upper().

Here is the caller graph for this function:

void reassignbuf ( struct buf bp)

Definition at line 2090 of file vfs_subr.c.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

static void sched_sync ( void  )
static

Definition at line 1895 of file vfs_subr.c.

References Giant, hz, kproc_suspend_check(), printf(), sched_prio(), sync_vnode(), syncer_shutdown(), SYNCER_SHUTDOWN_SPEEDUP, syncer_state, time_uptime, WI_GIANTQ, and WI_MPSAFEQ.

Here is the call graph for this function:

int speedup_syncer ( void  )

Definition at line 2051 of file vfs_subr.c.

static int sync_fsync ( struct vop_fsync_args *  ap)
static

Definition at line 3802 of file vfs_subr.c.

References vfs_busy(), vfs_msync(), vfs_unbusy(), vn_finished_write(), vn_start_write(), and vn_syncer_add_to_worklist().

Here is the call graph for this function:

static int sync_inactive ( struct vop_inactive_args *  ap)
static

Definition at line 3846 of file vfs_subr.c.

References vgone().

Here is the call graph for this function:

static int sync_reclaim ( struct vop_reclaim_args *  ap)
static

Definition at line 3859 of file vfs_subr.c.

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

Definition at line 1846 of file vfs_subr.c.

References vdrop(), vholdl(), 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:

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

Definition at line 2071 of file vfs_subr.c.

References kproc_shutdown(), and syncer_state.

Referenced by sched_sync().

Here is the call graph for this function:

Here is the caller graph for this function:

SYSCTL_INT ( _kern  ,
KERN_MAXVNODES  ,
maxvnodes  ,
CTLFLAG_RW  ,
desiredvnodes,
,
"Maximum number of vnodes"   
)
SYSCTL_INT ( _debug  ,
OID_AUTO  ,
vnlru_nowhere  ,
CTLFLAG_RW  ,
vnlru_nowhere,
,
"Number of times the vnlru process ran without success"   
)
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 ms, ""3+: sec + ns (max. precision))"   
)
static SYSCTL_NODE ( _vfs  ,
VFS_GENERIC  ,
generic  ,
CTLFLAG_RD|  CTLFLAG_SKIP,
vfs_sysctl  ,
"Generic filesystem"   
)
static
static int sysctl_ovfs_conf ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 3430 of file vfs_subr.c.

References vfsconf.

Referenced by vfs_sysctl().

Here is the caller graph for this function:

SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
worklist_len  ,
CTLTYPE_INT|  CTLFLAG_RD,
NULL  ,
,
sysctl_vfs_worklist_len  ,
"I"  ,
"Syncer thread worklist length"   
)
SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
conflist  ,
CTLTYPE_OPAQUE|  CTLFLAG_RD,
NULL  ,
,
sysctl_vfs_conflist  ,
S,
xvfsconf"  ,
"List of all configured filesystems"   
)
SYSCTL_PROC ( _vfs  ,
OID_AUTO  ,
ctl  ,
CTLTYPE_OPAQUE|  CTLFLAG_WR,
NULL  ,
,
sysctl_vfs_ctl  ,
""  ,
"Sysctl by fsid"   
)
SYSCTL_ULONG ( _vfs  ,
OID_AUTO  ,
numvnodes  ,
CTLFLAG_RD  ,
numvnodes,
,
"Number of vnodes in existence"   
)
SYSCTL_ULONG ( _vfs  ,
OID_AUTO  ,
vnodes_created  ,
CTLFLAG_RD  ,
vnodes_created,
,
"Number of vnodes created by getnewvnode  
)
SYSCTL_ULONG ( _kern  ,
OID_AUTO  ,
minvnodes  ,
CTLFLAG_RW  ,
wantfreevnodes,
,
"Minimum number of vnodes (legacy)"   
)
static int sysctl_vfs_conflist ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 3359 of file vfs_subr.c.

References vfsconf, and vfsconf2x().

Here is the call graph for this function:

static int sysctl_vfs_ctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 4451 of file vfs_subr.c.

References vfs_getvfs(), and vfs_rel().

Here is the call graph for this function:

static int sysctl_vfs_worklist_len ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 1822 of file vfs_subr.c.

SYSINIT ( vfs  ,
SI_SUB_VFS  ,
SI_ORDER_FIRST  ,
vntblinit  ,
NULL   
)
SYSINIT ( vnlru  ,
SI_SUB_KTHREAD_UPDATE  ,
SI_ORDER_FIRST  ,
kproc_start  ,
vnlru_kp 
)
SYSINIT ( syncer  ,
SI_SUB_KTHREAD_UPDATE  ,
SI_ORDER_FIRST  ,
kproc_start  ,
up_kp 
)
SYSINIT ( vfs_knlist  ,
SI_SUB_VFS  ,
SI_ORDER_ANY  ,
vfs_event_init  ,
NULL   
)
static TAILQ_HEAD ( freelst  ,
vnode   
)
static

Definition at line 146 of file vfs_subr.c.

void v_addpollinfo ( struct vnode *  vp)

Definition at line 3653 of file vfs_subr.c.

References destroy_vpollinfo_free(), knlist_init(), mtx_init(), vfs_knl_assert_locked(), vfs_knl_assert_unlocked(), 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:

static void v_decr_usecount ( struct vnode *  vp)
static

Definition at line 2212 of file vfs_subr.c.

References dev_unlock(), and vdropl().

Referenced by vputx().

Here is the call graph for this function:

Here is the caller graph for this function:

static void v_decr_useonly ( struct vnode *  vp)
static

Definition at line 2235 of file vfs_subr.c.

References dev_unlock().

Referenced by vputx().

Here is the call graph for this function:

Here is the caller graph for this function:

static void v_incr_usecount ( struct vnode *  vp)
static

Definition at line 2176 of file vfs_subr.c.

References dev_unlock(), and vholdl().

Referenced by getnewvnode(), and vref().

Here is the call graph for this function:

Here is the caller graph for this function:

static void v_upgrade_usecount ( struct vnode *  vp)
static

Definition at line 2194 of file vfs_subr.c.

References dev_unlock().

Referenced by vget().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 3913 of file vfs_subr.c.

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

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:

void vattr_null ( struct vattr *  vap)

Definition at line 662 of file vfs_subr.c.

Referenced by vfs_register().

Here is the caller graph for this function:

int vcount ( struct vnode *  vp)

Definition at line 2960 of file vfs_subr.c.

References count, and dev_unlock().

Referenced by sys_revoke().

Here is the call graph for this function:

Here is the caller graph for this function:

void vdrop ( struct vnode *  vp)

Definition at line 2493 of file vfs_subr.c.

References vdropl().

Referenced by brelvp(), cache_zap(), do_recycle(), dounmount(), filt_vfsdetach(), mqfs_allocv(), sync_vnode(), vflush(), vget(), vlrureclaim(), vnlru_free(), and vop_rename_post().

Here is the call graph for this function:

Here is the caller graph for this function:

void vdropl ( struct vnode *  vp)

Definition at line 2506 of file vfs_subr.c.

References destroy_vpollinfo(), lockdestroy(), mtx_destroy(), numvnodes, panic(), rangelock_destroy(), and VSHOULDFREE.

Referenced by v_decr_usecount(), vdrop(), vflush(), vlrureclaim(), and vputx().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2656 of file vfs_subr.c.

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

Referenced by mqfs_unmount().

Here is the call graph for this function:

Here is the caller graph for this function:

void vfs_allocate_syncvnode ( struct mount *  mp)

Definition at line 3730 of file vfs_subr.c.

References getnewvnode(), insmntque(), panic(), start, 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:

int vfs_busy ( struct mount *  mp,
int  flags 
)
struct mount* vfs_busyfs ( fsid_t *  fsid)

Definition at line 493 of file vfs_subr.c.

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

Referenced by kern_fhstatfs(), sys_fhopen(), and sys_fhstat().

Here is the call graph for this function:

Here is the caller graph for this function:

void vfs_deallocate_syncvnode ( struct mount *  mp)

Definition at line 3785 of file vfs_subr.c.

References vrele().

Referenced by dounmount(), and vfs_domount_update().

Here is the call graph for this function:

Here is the caller graph for this function:

static void vfs_event_init ( void *  arg)
static

Definition at line 4401 of file vfs_subr.c.

References fs_knlist, and knlist_init_mtx().

Here is the call graph for this function:

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

Definition at line 4409 of file vfs_subr.c.

References fs_knlist.

Referenced by dounmount(), and vfs_domount_first().

Here is the caller graph for this function:

void vfs_getnewfsid ( struct mount *  mp)

Definition at line 590 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:

struct mount* vfs_getvfs ( fsid_t *  fsid)

Definition at line 463 of file vfs_subr.c.

References mountlist, mountlist_mtx, and vfs_ref().

Referenced by sysctl_vfs_ctl(), and vfs_getnewfsid().

Here is the call graph for this function:

Here is the caller graph for this function:

static void vfs_knl_assert_locked ( void *  arg)
static

Definition at line 4531 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

static void vfs_knl_assert_unlocked ( void *  arg)
static

Definition at line 4541 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

static void vfs_knllock ( void *  arg)
static

Definition at line 4515 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

static void vfs_knlunlock ( void *  arg)
static

Definition at line 4523 of file vfs_subr.c.

Referenced by v_addpollinfo().

Here is the caller graph for this function:

int vfs_kqfilter ( struct vop_kqfilter_args *  ap)

Definition at line 4551 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:

void vfs_mark_atime ( struct vnode *  vp,
struct ucred *  cred 
)

Definition at line 4701 of file vfs_subr.c.

Referenced by do_execve().

Here is the caller graph for this function:

void vfs_msync ( struct mount *  mp,
int  flags 
)

Definition at line 3598 of file vfs_subr.c.

References vget(), and vput().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void vfs_notify_upper ( struct vnode *  vp,
int  event 
)

Definition at line 2816 of file vfs_subr.c.

References free(), malloc(), notify_lowervp_vfs_dummy(), and wakeup().

Referenced by kern_rmdirat(), kern_unlinkat(), and vgonel().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 4665 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:

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

Definition at line 544 of file vfs_subr.c.

References jailed(), 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:

static int vfs_sysctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 3386 of file vfs_subr.c.

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

Here is the call graph for this function:

void vfs_timestamp ( struct timespec *  tsp)

Definition at line 635 of file vfs_subr.c.

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

Referenced by getutimes(), kern_sem_wait(), ksem_alloc(), mqfs_create_node(), mqfs_setattr(), pipe_read(), pipe_write(), pipe_zone_ctor(), shm_alloc(), shm_dotruncate(), 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:

void vfs_unbusy ( struct mount *  mp)

Definition at line 442 of file vfs_subr.c.

References wakeup().

Referenced by kern_fhstatfs(), kern_fstatfs(), kern_getfsstat(), kern_statfs(), lookup(), sync_fsync(), sys_extattrctl(), sys_fchdir(), sys_fhopen(), sys_fhstat(), sys_quotactl(), sys_sync(), vfs_busyfs(), vfs_domount_first(), vfs_domount_update(), vfs_mountroot_shuffle(), vn_vget_ino(), and vnlru_proc().

Here is the call graph for this function:

Here is the caller graph for this function:

int vfs_unixify_accmode ( accmode_t *  accmode)

Definition at line 4725 of file vfs_subr.c.

Referenced by vop_stdaccessx().

Here is the caller graph for this function:

void vfs_unmountall ( void  )

Definition at line 3554 of file vfs_subr.c.

References dounmount(), mountlist, and printf().

Referenced by kern_reboot().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 3312 of file vfs_subr.c.

Referenced by sysctl_vfs_conflist(), and vfs_sysctl().

Here is the caller graph for this function:

int vget ( struct vnode *  vp,
int  flags,
struct thread *  td 
)

Definition at line 2258 of file vfs_subr.c.

References panic(), v_upgrade_usecount(), vdrop(), vholdl(), and vinactive().

Referenced by cache_lookup_times(), mqfs_allocv(), vfs_hash_get(), vfs_hash_insert(), vfs_msync(), vfs_stdsync(), and vn_dir_dd_ino().

Here is the call graph for this function:

Here is the caller graph for this function:

void vgone ( struct vnode *  vp)

Definition at line 2799 of file vfs_subr.c.

References vgonel().

Referenced by insmntque_stddtr(), mqfs_allocv(), sync_inactive(), vflush(), and vfs_allocate_syncvnode().

Here is the call graph for this function:

Here is the caller graph for this function:

void vgonel ( struct vnode *  vp)
static

Definition at line 2873 of file vfs_subr.c.

References cache_purge(), delmntque(), panic(), vfs_notify_upper(), vfs_unp_reclaim(), vinactive(), vinvalbuf(), vn_finished_secondary_write(), and vn_start_secondary_write().

Referenced by vflush(), vgone(), vlrureclaim(), vrecycle(), and vtryrecycle().

Here is the call graph for this function:

Here is the caller graph for this function:

void vhold ( struct vnode *  vp)

Definition at line 2448 of file vfs_subr.c.

References vholdl().

Referenced by bgetvp(), cache_enter_time(), do_unlink(), mqfs_allocv(), vfs_kqfilter(), and vop_rename_pre().

Here is the call graph for this function:

Here is the caller graph for this function:

void vholdl ( struct vnode *  vp)

Definition at line 2460 of file vfs_subr.c.

References VSHOULDBUSY.

Referenced by dounmount(), sync_vnode(), v_incr_usecount(), vflush(), vget(), vhold(), vlrureclaim(), and vnlru_free().

Here is the caller graph for this function:

void vinactive ( struct vnode *  vp,
struct thread *  td 
)

Definition at line 2597 of file vfs_subr.c.

Referenced by vget(), vgonel(), and vputx().

Here is the caller graph for this function:

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

Definition at line 1348 of file vfs_subr.c.

References bufobj_invalbuf().

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

Here is the call graph for this function:

Here is the caller graph for this function:

static int vlrureclaim ( struct mount *  mp)
static

Definition at line 705 of file vfs_subr.c.

References count, desiredvnodes, kern_yield(), should_yield(), vdrop(), vdropl(), vgonel(), vholdl(), 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:

int vn_isdisk ( struct vnode *  vp,
int *  errp 
)

Definition at line 3885 of file vfs_subr.c.

References dev_unlock().

Referenced by aio_qphysio(), bp_unmapped_get_kva(), brelse(), getblk(), and sys_aio_cancel().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 3682 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:

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

Definition at line 2992 of file vfs_subr.c.

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

Referenced by kern_reboot().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1796 of file vfs_subr.c.

References WI_GIANTQ, and WI_MPSAFEQ.

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

Here is the caller graph for this function:

static void vnlru_free ( int  count)
static

Definition at line 807 of file vfs_subr.c.

References VCANRECYCLE, vdrop(), vholdl(), and vtryrecycle().

Referenced by getnewvnode(), getnewvnode_wait(), and vnlru_proc().

Here is the call graph for this function:

Here is the caller graph for this function:

static void vnlru_proc ( void  )
static

Definition at line 863 of file vfs_subr.c.

References hz, kern_yield(), kproc_shutdown(), kproc_suspend_check(), mountlist, mountlist_mtx, numvnodes, printf(), vfs_busy(), vfs_unbusy(), vlrureclaim(), vnlru_free(), vnlruproc, and wakeup().

Here is the call graph for this function:

static void vntblinit ( void *dummy  __unused)
static

Definition at line 307 of file vfs_subr.c.

References bootverbose, cv_init(), hashinit(), maxproc, MAXVNODES_MAX, mtx_init(), printf(), vm_kmem_size, WI_GIANTQ, and WI_MPSAFEQ.

Here is the call graph for this function:

void vop_create_post ( void *  ap,
int  rc 
)

Definition at line 4282 of file vfs_subr.c.

void vop_deleteextattr_post ( void *  ap,
int  rc 
)

Definition at line 4291 of file vfs_subr.c.

void vop_link_post ( void *  ap,
int  rc 
)

Definition at line 4300 of file vfs_subr.c.

void vop_lock_post ( void *  ap,
int  rc 
)

Definition at line 4247 of file vfs_subr.c.

void vop_lock_pre ( void *  ap)

Definition at line 4234 of file vfs_subr.c.

void vop_mkdir_post ( void *  ap,
int  rc 
)

Definition at line 4311 of file vfs_subr.c.

void vop_mknod_post ( void *  ap,
int  rc 
)

Definition at line 4320 of file vfs_subr.c.

void vop_remove_post ( void *  ap,
int  rc 
)

Definition at line 4329 of file vfs_subr.c.

void vop_rename_fail ( struct vop_rename_args *  ap)

Definition at line 4161 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:

void vop_rename_post ( void *  ap,
int  rc 
)

Definition at line 4340 of file vfs_subr.c.

References vdrop().

Here is the call graph for this function:

void vop_rename_pre ( void *  ap)

Definition at line 4175 of file vfs_subr.c.

References vhold().

Here is the call graph for this function:

void vop_rmdir_post ( void *  ap,
int  rc 
)

Definition at line 4361 of file vfs_subr.c.

void vop_setattr_post ( void *  ap,
int  rc 
)

Definition at line 4372 of file vfs_subr.c.

void vop_setextattr_post ( void *  ap,
int  rc 
)

Definition at line 4381 of file vfs_subr.c.

void vop_strategy_pre ( void *  ap)

Definition at line 4208 of file vfs_subr.c.

References kdb_enter(), panicstr, and printf().

Here is the call graph for this function:

void vop_symlink_post ( void *  ap,
int  rc 
)

Definition at line 4390 of file vfs_subr.c.

void vop_unlock_post ( void *  ap,
int  rc 
)

Definition at line 4271 of file vfs_subr.c.

void vop_unlock_pre ( void *  ap)

Definition at line 4259 of file vfs_subr.c.

static void vputx ( struct vnode *  vp,
int  func 
)
static

Definition at line 2337 of file vfs_subr.c.

References panic(), v_decr_usecount(), v_decr_useonly(), vdropl(), vinactive(), VPUTX_VPUT, VPUTX_VRELE, and VPUTX_VUNREF.

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

Here is the call graph for this function:

Here is the caller graph for this function:

int vrecycle ( struct vnode *  vp,
struct thread *  td 
)

Definition at line 2778 of file vfs_subr.c.

References vgonel().

Referenced by do_recycle(), and mqfs_inactive().

Here is the call graph for this function:

Here is the caller graph for this function:

void vref ( struct vnode *  vp)
int vrefcnt ( struct vnode *  vp)

Definition at line 2321 of file vfs_subr.c.

Referenced by mountcheckdirs().

Here is the caller graph for this function:

int vtruncbuf ( struct vnode *  vp,
struct ucred *  cred,
struct thread *  td,
off_t  length,
int  blksize 
)

Definition at line 1441 of file vfs_subr.c.

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

Here is the call graph for this function:

static int vtryrecycle ( struct vnode *  vp)
static

Definition at line 934 of file vfs_subr.c.

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

Referenced by vnlru_free().

Here is the call graph for this function:

Here is the caller graph for this function:

void vunref ( struct vnode *  vp)

Definition at line 2438 of file vfs_subr.c.

References vputx(), and VPUTX_VUNREF.

Referenced by vfs_unp_reclaim().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int desiredvnodes

Definition at line 276 of file vfs_subr.c.

Referenced by cache_enter_time(), LIST_HEAD(), nchinit(), and vlrureclaim().

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

Definition at line 4419 of file vfs_subr.c.

struct knlist fs_knlist
static

Definition at line 4398 of file vfs_subr.c.

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

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

Definition at line 134 of file vfs_subr.c.

unsigned long numvnodes
static
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_reclaim = sync_reclaim,
.vop_lock1 = vop_stdlock,
.vop_unlock = vop_stdunlock,
.vop_islocked = vop_stdislocked,
}
#define sync_close
Definition: vfs_subr.c:3710
static int sync_reclaim(struct vop_reclaim_args *)
Definition: vfs_subr.c:3859
int vop_stdislocked(struct vop_islocked_args *ap)
Definition: vfs_default.c:537
static int sync_fsync(struct vop_fsync_args *)
Definition: vfs_subr.c:3802
int vop_stdlock(struct vop_lock1_args *ap)
Definition: vfs_default.c:507
int vop_stdunlock(struct vop_unlock_args *ap)
Definition: vfs_default.c:524
static int sync_inactive(struct vop_inactive_args *)
Definition: vfs_subr.c:3846

Definition at line 3715 of file vfs_subr.c.

syncer_state

Definition at line 267 of file vfs_subr.c.

Referenced by sched_sync(), and syncer_shutdown().

int timestamp_precision = TSP_USEC
static

Definition at line 625 of file vfs_subr.c.

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

Definition at line 2987 of file vfs_subr.c.

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

Definition at line 1838 of file vfs_subr.c.

struct proc* updateproc
static

Definition at line 1836 of file vfs_subr.c.

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

Definition at line 4498 of file vfs_subr.c.

Referenced by vfs_kqfilter().

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

Definition at line 4508 of file vfs_subr.c.

Referenced by vfs_kqfilter().

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

Definition at line 4503 of file vfs_subr.c.

Referenced by vfs_kqfilter().

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

Definition at line 915 of file vfs_subr.c.

int vnlru_nowhere
static

Definition at line 281 of file vfs_subr.c.

struct proc* vnlruproc
static

Definition at line 859 of file vfs_subr.c.

Referenced by vnlru_proc().

int vnlruproc_sig
static

Definition at line 860 of file vfs_subr.c.

u_long vnodes_created
static

Definition at line 126 of file vfs_subr.c.

Referenced by getnewvnode().

int vnsz2log
static

Definition at line 294 of file vfs_subr.c.

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 138 of file vfs_subr.c.