FreeBSD kernel kern code
vfs_default.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/event.h>
#include <sys/filio.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/lockf.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/rwlock.h>
#include <sys/fcntl.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/dirent.h>
#include <sys/poll.h>
#include <sys/stat.h>
#include <security/audit/audit.h>
#include <sys/priv.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_pager.h>
#include <vm/vnode_pager.h>
Include dependency graph for vfs_default.c:

Go to the source code of this file.

Macros

#define DIRENT_MINSIZE   (sizeof(struct dirent) - (MAXNAMLEN+1) + 4)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int vop_nolookup (struct vop_lookup_args *)
 
static int vop_norename (struct vop_rename_args *)
 
static int vop_nostrategy (struct vop_strategy_args *)
 
static int get_next_dirent (struct vnode *vp, struct dirent **dpp, char *dirbuf, int dirbuflen, off_t *off, char **cpos, int *len, int *eofflag, struct thread *td)
 
static int dirent_exists (struct vnode *vp, const char *dirname, struct thread *td)
 
static int vop_stdis_text (struct vop_is_text_args *ap)
 
static int vop_stdunset_text (struct vop_unset_text_args *ap)
 
static int vop_stdadd_writecount (struct vop_add_writecount_args *ap)
 
static int vop_stdcopy_file_range (struct vop_copy_file_range_args *ap)
 
static int vop_stdfdatasync (struct vop_fdatasync_args *ap)
 
static int vop_stdgetpages_async (struct vop_getpages_async_args *ap)
 
static int vop_stdread_pgcache (struct vop_read_pgcache_args *ap)
 
static int vop_stdstat (struct vop_stat_args *ap)
 
static int vop_stdvput_pair (struct vop_vput_pair_args *ap)
 
 VFS_VOP_VECTOR_REGISTER (default_vnodeops)
 
int vop_eopnotsupp (struct vop_generic_args *ap)
 
int vop_ebadf (struct vop_generic_args *ap)
 
int vop_enotty (struct vop_generic_args *ap)
 
int vop_einval (struct vop_generic_args *ap)
 
int vop_enoent (struct vop_generic_args *ap)
 
int vop_eagain (struct vop_generic_args *ap)
 
int vop_null (struct vop_generic_args *ap)
 
int vop_panic (struct vop_generic_args *ap)
 
int vop_stdaccess (struct vop_access_args *ap)
 
int vop_stdaccessx (struct vop_accessx_args *ap)
 
int vop_stdadvlock (struct vop_advlock_args *ap)
 
int vop_stdadvlockasync (struct vop_advlockasync_args *ap)
 
int vop_stdadvlockpurge (struct vop_advlockpurge_args *ap)
 
int vop_stdpathconf (struct vop_pathconf_args *ap)
 
int vop_stdlock (struct vop_lock1_args *ap)
 
int vop_stdunlock (struct vop_unlock_args *ap)
 
int vop_stdislocked (struct vop_islocked_args *ap)
 
int vop_lock (struct vop_lock1_args *ap)
 
int vop_unlock (struct vop_unlock_args *ap)
 
int vop_islocked (struct vop_islocked_args *ap)
 
int vop_nopoll (struct vop_poll_args *ap)
 
int vop_stdpoll (struct vop_poll_args *ap)
 
int vop_stdgetwritemount (struct vop_getwritemount_args *ap)
 
int vop_stdbmap (struct vop_bmap_args *ap)
 
int vop_stdfsync (struct vop_fsync_args *ap)
 
int vop_stdfdatasync_buf (struct vop_fdatasync_args *ap)
 
int vop_stdgetpages (struct vop_getpages_args *ap)
 
int vop_stdkqfilter (struct vop_kqfilter_args *ap)
 
int vop_stdputpages (struct vop_putpages_args *ap)
 
int vop_stdvptofh (struct vop_vptofh_args *ap)
 
int vop_stdvptocnp (struct vop_vptocnp_args *ap)
 
int vop_stdallocate (struct vop_allocate_args *ap)
 
static int vp_zerofill (struct vnode *vp, struct vattr *vap, off_t *offsetp, off_t *lenp, int ioflag, struct ucred *cred)
 
int vop_stddeallocate (struct vop_deallocate_args *ap)
 
int vop_stdadvise (struct vop_advise_args *ap)
 
int vop_stdunp_bind (struct vop_unp_bind_args *ap)
 
int vop_stdunp_connect (struct vop_unp_connect_args *ap)
 
int vop_stdunp_detach (struct vop_unp_detach_args *ap)
 
int vop_stdset_text (struct vop_set_text_args *ap)
 
static int __always_inline vop_stdadd_writecount_impl (struct vop_add_writecount_args *ap, bool handle_msync)
 
int vop_stdadd_writecount_nomsync (struct vop_add_writecount_args *ap)
 
int vop_stdneed_inactive (struct vop_need_inactive_args *ap)
 
int vop_stdioctl (struct vop_ioctl_args *ap)
 
int vfs_stdroot (struct mount *mp, int flags, struct vnode **vpp)
 
int vfs_stdstatfs (struct mount *mp, struct statfs *sbp)
 
int vfs_stdquotactl (struct mount *mp, int cmds, uid_t uid, void *arg, bool *mp_busy)
 
int vfs_stdsync (struct mount *mp, int waitfor)
 
int vfs_stdnosync (struct mount *mp, int waitfor)
 
int vfs_stdvget (struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
 
int vfs_stdfhtovp (struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
 
int vfs_stdinit (struct vfsconf *vfsp)
 
int vfs_stduninit (struct vfsconf *vfsp)
 
int vfs_stdextattrctl (struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname)
 
int vfs_stdsysctl (struct mount *mp, fsctlop_t op, struct sysctl_req *req)
 
static vop_bypass_t * bp_by_off (struct vop_vector *vop, struct vop_generic_args *a)
 
int vop_sigdefer (struct vop_vector *vop, struct vop_generic_args *a)
 
static int vop_stdread_pgcache (struct vop_read_pgcache_args *ap __unused)
 

Variables

struct vop_vector default_vnodeops
 

Macro Definition Documentation

◆ DIRENT_MINSIZE

#define DIRENT_MINSIZE   (sizeof(struct dirent) - (MAXNAMLEN+1) + 4)

Definition at line 85 of file vfs_default.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ bp_by_off()

static vop_bypass_t * bp_by_off ( struct vop_vector *  vop,
struct vop_generic_args *  a 
)
static

Definition at line 1630 of file vfs_default.c.

Referenced by vop_sigdefer().

Here is the caller graph for this function:

◆ dirent_exists()

static int dirent_exists ( struct vnode *  vp,
const char *  dirname,
struct thread *  td 
)
static

Definition at line 352 of file vfs_default.c.

References free(), get_next_dirent(), and malloc().

Referenced by vop_stdvptocnp().

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

◆ get_next_dirent()

static int get_next_dirent ( struct vnode *  vp,
struct dirent **  dpp,
char *  dirbuf,
int  dirbuflen,
off_t *  off,
char **  cpos,
int *  len,
int *  eofflag,
struct thread *  td 
)
static

Definition at line 290 of file vfs_default.c.

References DIRENT_MINSIZE.

Referenced by dirent_exists(), and vop_stdvptocnp().

Here is the caller graph for this function:

◆ vfs_stdextattrctl()

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

Definition at line 1606 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdfhtovp()

int vfs_stdfhtovp ( struct mount *  mp,
struct fid *  fhp,
int  flags,
struct vnode **  vpp 
)

Definition at line 1579 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdinit()

int vfs_stdinit ( struct vfsconf vfsp)

Definition at line 1590 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdnosync()

int vfs_stdnosync ( struct mount *  mp,
int  waitfor 
)

Definition at line 1548 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdquotactl()

int vfs_stdquotactl ( struct mount *  mp,
int  cmds,
uid_t  uid,
void *  arg,
bool *  mp_busy 
)

Definition at line 1500 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdroot()

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

Definition at line 1481 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdstatfs()

int vfs_stdstatfs ( struct mount *  mp,
struct statfs *  sbp 
)

Definition at line 1491 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdsync()

int vfs_stdsync ( struct mount *  mp,
int  waitfor 
)

Definition at line 1511 of file vfs_default.c.

References vget(), and vput().

Here is the call graph for this function:

◆ vfs_stdsysctl()

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

Definition at line 1620 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stduninit()

int vfs_stduninit ( struct vfsconf vfsp)

Definition at line 1598 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ vfs_stdvget()

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

Definition at line 1568 of file vfs_default.c.

Referenced by vfs_register().

Here is the caller graph for this function:

◆ VFS_VOP_VECTOR_REGISTER()

VFS_VOP_VECTOR_REGISTER ( default_vnodeops  )

◆ vop_eagain()

int vop_eagain ( struct vop_generic_args *  ap)

Definition at line 204 of file vfs_default.c.

◆ vop_ebadf()

int vop_ebadf ( struct vop_generic_args *  ap)

Definition at line 176 of file vfs_default.c.

◆ vop_einval()

int vop_einval ( struct vop_generic_args *  ap)

Definition at line 190 of file vfs_default.c.

◆ vop_enoent()

int vop_enoent ( struct vop_generic_args *  ap)

Definition at line 197 of file vfs_default.c.

◆ vop_enotty()

int vop_enotty ( struct vop_generic_args *  ap)

Definition at line 183 of file vfs_default.c.

◆ vop_eopnotsupp()

int vop_eopnotsupp ( struct vop_generic_args *  ap)

Definition at line 166 of file vfs_default.c.

◆ vop_islocked()

int vop_islocked ( struct vop_islocked_args *  ap)

Definition at line 627 of file vfs_default.c.

References lockstatus().

Here is the call graph for this function:

◆ vop_lock()

int vop_lock ( struct vop_lock1_args *  ap)

Definition at line 584 of file vfs_default.c.

References flags, lockmgr_lock_flags(), lockmgr_slock(), lockmgr_xlock(), and mtx.

Here is the call graph for this function:

◆ vop_nolookup()

static int vop_nolookup ( struct vop_lookup_args *  ap)
static

Definition at line 240 of file vfs_default.c.

◆ vop_nopoll()

int vop_nopoll ( struct vop_poll_args *  ap)

Definition at line 643 of file vfs_default.c.

◆ vop_norename()

static int vop_norename ( struct vop_rename_args *  ap)
static

Definition at line 259 of file vfs_default.c.

References vop_rename_fail().

Here is the call graph for this function:

◆ vop_nostrategy()

static int vop_nostrategy ( struct vop_strategy_args *  ap)
static

Definition at line 279 of file vfs_default.c.

References bufdone(), printf(), and vn_printf().

Here is the call graph for this function:

◆ vop_null()

int vop_null ( struct vop_generic_args *  ap)

Definition at line 211 of file vfs_default.c.

◆ vop_panic()

int vop_panic ( struct vop_generic_args *  ap)

Definition at line 221 of file vfs_default.c.

References panic().

Here is the call graph for this function:

◆ vop_sigdefer()

int vop_sigdefer ( struct vop_vector *  vop,
struct vop_generic_args *  a 
)

Definition at line 1637 of file vfs_default.c.

References bp_by_off().

Here is the call graph for this function:

◆ vop_stdaccess()

int vop_stdaccess ( struct vop_access_args *  ap)

Definition at line 395 of file vfs_default.c.

◆ vop_stdaccessx()

int vop_stdaccessx ( struct vop_accessx_args *  ap)

Definition at line 405 of file vfs_default.c.

References accmode, and vfs_unixify_accmode().

Here is the call graph for this function:

◆ vop_stdadd_writecount()

int vop_stdadd_writecount ( struct vop_add_writecount_args *  ap)
static

Definition at line 1421 of file vfs_default.c.

References vop_stdadd_writecount_impl().

Here is the call graph for this function:

◆ vop_stdadd_writecount_impl()

static int __always_inline vop_stdadd_writecount_impl ( struct vop_add_writecount_args *  ap,
bool  handle_msync 
)
static

Definition at line 1379 of file vfs_default.c.

References vlazy().

Referenced by vop_stdadd_writecount(), and vop_stdadd_writecount_nomsync().

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

◆ vop_stdadd_writecount_nomsync()

int vop_stdadd_writecount_nomsync ( struct vop_add_writecount_args *  ap)

Definition at line 1428 of file vfs_default.c.

References vop_stdadd_writecount_impl().

Here is the call graph for this function:

◆ vop_stdadvise()

int vop_stdadvise ( struct vop_advise_args *  ap)

Definition at line 1197 of file vfs_default.c.

References bnoreuselist(), and start.

Here is the call graph for this function:

◆ vop_stdadvlock()

int vop_stdadvlock ( struct vop_advlock_args *  ap)

Definition at line 424 of file vfs_default.c.

References lf_advlock().

Here is the call graph for this function:

◆ vop_stdadvlockasync()

int vop_stdadvlockasync ( struct vop_advlockasync_args *  ap)

Definition at line 465 of file vfs_default.c.

References lf_advlockasync().

Here is the call graph for this function:

◆ vop_stdadvlockpurge()

int vop_stdadvlockpurge ( struct vop_advlockpurge_args *  ap)

Definition at line 486 of file vfs_default.c.

References lf_purgelocks().

Here is the call graph for this function:

◆ vop_stdallocate()

int vop_stdallocate ( struct vop_allocate_args *  ap)

Definition at line 942 of file vfs_default.c.

References buf, free(), malloc(), maxphys, and should_yield().

Here is the call graph for this function:

◆ vop_stdbmap()

int vop_stdbmap ( struct vop_bmap_args *  ap)

Definition at line 710 of file vfs_default.c.

◆ vop_stdcopy_file_range()

static int vop_stdcopy_file_range ( struct vop_copy_file_range_args *  ap)
static

Definition at line 1557 of file vfs_default.c.

References vn_generic_copy_file_range().

Here is the call graph for this function:

◆ vop_stddeallocate()

int vop_stddeallocate ( struct vop_deallocate_args *  ap)

Definition at line 1129 of file vfs_default.c.

References should_yield(), vn_bmap_seekhole_locked(), and vp_zerofill().

Here is the call graph for this function:

◆ vop_stdfdatasync()

static int vop_stdfdatasync ( struct vop_fdatasync_args *  ap)
static

Definition at line 745 of file vfs_default.c.

◆ vop_stdfdatasync_buf()

int vop_stdfdatasync_buf ( struct vop_fdatasync_args *  ap)

Definition at line 752 of file vfs_default.c.

References vn_fsync_buf().

Here is the call graph for this function:

◆ vop_stdfsync()

int vop_stdfsync ( struct vop_fsync_args *  ap)

Definition at line 733 of file vfs_default.c.

References vn_fsync_buf().

Here is the call graph for this function:

◆ vop_stdgetpages()

int vop_stdgetpages ( struct vop_getpages_args *  ap)

Definition at line 760 of file vfs_default.c.

◆ vop_stdgetpages_async()

static int vop_stdgetpages_async ( struct vop_getpages_async_args *  ap)
static

Definition at line 775 of file vfs_default.c.

◆ vop_stdgetwritemount()

int vop_stdgetwritemount ( struct vop_getwritemount_args *  ap)

Definition at line 678 of file vfs_default.c.

References vfs_ref_from_vp().

Here is the call graph for this function:

◆ vop_stdioctl()

int vop_stdioctl ( struct vop_ioctl_args *  ap)

Definition at line 1442 of file vfs_default.c.

◆ vop_stdis_text()

static int vop_stdis_text ( struct vop_is_text_args *  ap)
static

Definition at line 1293 of file vfs_default.c.

◆ vop_stdislocked()

int vop_stdislocked ( struct vop_islocked_args *  ap)

Definition at line 567 of file vfs_default.c.

References lockstatus().

Here is the call graph for this function:

◆ vop_stdkqfilter()

int vop_stdkqfilter ( struct vop_kqfilter_args *  ap)

Definition at line 787 of file vfs_default.c.

References vfs_kqfilter().

Here is the call graph for this function:

◆ vop_stdlock()

int vop_stdlock ( struct vop_lock1_args *  ap)

Definition at line 537 of file vfs_default.c.

References lockmgr_lock_flags(), and mtx.

Here is the call graph for this function:

◆ vop_stdneed_inactive()

int vop_stdneed_inactive ( struct vop_need_inactive_args *  ap)

Definition at line 1435 of file vfs_default.c.

◆ vop_stdpathconf()

int vop_stdpathconf ( struct vop_pathconf_args *  ap)

Definition at line 504 of file vfs_default.c.

◆ vop_stdpoll()

int vop_stdpoll ( struct vop_poll_args *  ap)

Definition at line 661 of file vfs_default.c.

References vn_pollrecord().

Here is the call graph for this function:

◆ vop_stdputpages()

int vop_stdputpages ( struct vop_putpages_args *  ap)

Definition at line 794 of file vfs_default.c.

◆ vop_stdread_pgcache() [1/2]

static int vop_stdread_pgcache ( struct vop_read_pgcache_args *ap  __unused)
static

Definition at line 1761 of file vfs_default.c.

◆ vop_stdread_pgcache() [2/2]

static int vop_stdread_pgcache ( struct vop_read_pgcache_args *  ap)
static

◆ vop_stdset_text()

int vop_stdset_text ( struct vop_set_text_args *  ap)

Definition at line 1300 of file vfs_default.c.

References vref(), and vunref().

Here is the call graph for this function:

◆ vop_stdstat()

static int vop_stdstat ( struct vop_stat_args *  ap)
static

Definition at line 1652 of file vfs_default.c.

References mode.

◆ vop_stdunlock()

int vop_stdunlock ( struct vop_unlock_args *  ap)

Definition at line 555 of file vfs_default.c.

References lockmgr_unlock().

Here is the call graph for this function:

◆ vop_stdunp_bind()

int vop_stdunp_bind ( struct vop_unp_bind_args *  ap)

Definition at line 1269 of file vfs_default.c.

◆ vop_stdunp_connect()

int vop_stdunp_connect ( struct vop_unp_connect_args *  ap)

Definition at line 1277 of file vfs_default.c.

◆ vop_stdunp_detach()

int vop_stdunp_detach ( struct vop_unp_detach_args *  ap)

Definition at line 1285 of file vfs_default.c.

◆ vop_stdunset_text()

static int vop_stdunset_text ( struct vop_unset_text_args *  ap)
static

Definition at line 1344 of file vfs_default.c.

References vunref().

Here is the call graph for this function:

◆ vop_stdvptocnp()

int vop_stdvptocnp ( struct vop_vptocnp_args *  ap)

Definition at line 815 of file vfs_default.c.

References buf, dirent_exists(), flags, free(), get_next_dirent(), malloc(), NDFREE(), vn_close(), vn_open_cred(), vput(), vref(), and vrele().

Here is the call graph for this function:

◆ vop_stdvptofh()

int vop_stdvptofh ( struct vop_vptofh_args *  ap)

Definition at line 809 of file vfs_default.c.

◆ vop_stdvput_pair()

static int vop_stdvput_pair ( struct vop_vput_pair_args *  ap)
static

Definition at line 1767 of file vfs_default.c.

References vput().

Here is the call graph for this function:

◆ vop_unlock()

int vop_unlock ( struct vop_unlock_args *  ap)

Definition at line 614 of file vfs_default.c.

References lockmgr_unlock().

Here is the call graph for this function:

◆ vp_zerofill()

static int vp_zerofill ( struct vnode *  vp,
struct vattr *  vap,
off_t *  offsetp,
off_t *  lenp,
int  ioflag,
struct ucred *  cred 
)
static

Definition at line 1075 of file vfs_default.c.

Referenced by vop_stddeallocate().

Here is the caller graph for this function:

Variable Documentation

◆ default_vnodeops

struct vop_vector default_vnodeops

Definition at line 109 of file vfs_default.c.