FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_hwpmc_hooks.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/disk.h>
#include <sys/fail.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/kdb.h>
#include <sys/ktr.h>
#include <sys/stat.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/filio.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/prng.h>
#include <sys/sx.h>
#include <sys/sleepqueue.h>
#include <sys/sysctl.h>
#include <sys/ttycom.h>
#include <sys/conf.h>
#include <sys/syslog.h>
#include <sys/unistd.h>
#include <sys/user.h>
#include <sys/ktrace.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
Go to the source code of this file.
Data Structures | |
struct | vn_io_fault_args |
Functions | |
__FBSDID ("$FreeBSD$") | |
SYSCTL_INT (_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RWTUN, &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance") | |
SYSCTL_INT (_debug, OID_AUTO, vn_io_fault_prefault, CTLFLAG_RWTUN, &vn_io_fault_prefault, 0, "Enable vn_io_fault prefaulting") | |
SYSCTL_INT (_debug, OID_AUTO, vn_io_pgcache_read_enable, CTLFLAG_RWTUN, &vn_io_pgcache_read_enable, 0, "Enable copying from page cache for reads, avoiding fs") | |
SYSCTL_ULONG (_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers") | |
SYSCTL_INT (_security_bsd, OID_AUTO, allow_read_dir, CTLFLAG_RW, &vfs_allow_read_dir, 0, "Enable read(2) of directory by root for filesystems that support it") | |
static bool | do_vn_io_fault (struct vnode *vp, struct uio *uio) |
static int | vn_io_fault1 (struct vnode *vp, struct uio *uio, struct vn_io_fault_args *args, struct thread *td) |
int | vn_open (struct nameidata *ndp, int *flagp, int cmode, struct file *fp) |
static uint64_t | open2nameif (int fmode, u_int vn_open_flags) |
int | vn_open_cred (struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct ucred *cred, struct file *fp) |
static int | vn_open_vnode_advlock (struct vnode *vp, int fmode, struct file *fp) |
int | vn_open_vnode (struct vnode *vp, int fmode, struct ucred *cred, struct thread *td, struct file *fp) |
int | vn_writechk (struct vnode *vp) |
static int | vn_close1 (struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td, bool keep_ref) |
int | vn_close (struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td) |
static int | sequential_heuristic (struct uio *uio, struct file *fp) |
int | vn_rdwr (enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, ssize_t *aresid, struct thread *td) |
int | vn_rdwr_inchunks (enum uio_rw rw, struct vnode *vp, void *base, size_t len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, size_t *aresid, struct thread *td) |
off_t | foffset_lock (struct file *fp, int flags) |
void | foffset_unlock (struct file *fp, off_t val, int flags) |
void | foffset_lock_uio (struct file *fp, struct uio *uio, int flags) |
void | foffset_unlock_uio (struct file *fp, struct uio *uio, int flags) |
static int | get_advice (struct file *fp, struct uio *uio) |
static int | get_write_ioflag (struct file *fp) |
int | vn_read_from_obj (struct vnode *vp, struct uio *uio) |
static int | vn_read (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | vn_write (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | vn_io_fault_doio (struct vn_io_fault_args *args, struct uio *uio, struct thread *td) |
static int | vn_io_fault_touch (char *base, const struct uio *uio) |
static int | vn_io_fault_prefault_user (const struct uio *uio) |
static int | vn_io_fault (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
int | vn_io_fault_uiomove (char *data, int xfersize, struct uio *uio) |
int | vn_io_fault_pgmove (vm_page_t ma[], vm_offset_t offset, int xfersize, struct uio *uio) |
static int | vn_truncate (struct file *fp, off_t length, struct ucred *active_cred, struct thread *td) |
int | vn_truncate_locked (struct vnode *vp, off_t length, bool sync, struct ucred *cred) |
int | vn_statfile (struct file *fp, struct stat *sb, struct ucred *active_cred) |
static int | vn_ioctl (struct file *fp, u_long com, void *data, struct ucred *active_cred, struct thread *td) |
static int | vn_poll (struct file *fp, int events, struct ucred *active_cred, struct thread *td) |
static int __noinline | _vn_lock_fallback (struct vnode *vp, int flags, const char *file, int line, int error) |
int | _vn_lock (struct vnode *vp, int flags, const char *file, int line) |
static int | vn_closefile (struct file *fp, struct thread *td) |
static int | vn_start_write_refed (struct mount *mp, int flags, bool mplocked) |
int | vn_start_write (struct vnode *vp, struct mount **mpp, int flags) |
int | vn_start_secondary_write (struct vnode *vp, struct mount **mpp, int flags) |
void | vn_finished_write (struct mount *mp) |
void | vn_finished_secondary_write (struct mount *mp) |
int | vfs_write_suspend (struct mount *mp, int flags) |
void | vfs_write_resume (struct mount *mp, int flags) |
int | vfs_write_suspend_umnt (struct mount *mp) |
static int | vn_kqfilter (struct file *fp, struct knote *kn) |
int | vn_kqfilter_opath (struct file *fp, struct knote *kn) |
int | vn_extattr_get (struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, int *buflen, char *buf, struct thread *td) |
int | vn_extattr_set (struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, int buflen, char *buf, struct thread *td) |
int | vn_extattr_rm (struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, struct thread *td) |
static int | vn_get_ino_alloc_vget (struct mount *mp, void *arg, int lkflags, struct vnode **rvp) |
int | vn_vget_ino (struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp) |
int | vn_vget_ino_gen (struct vnode *vp, vn_get_ino_t alloc, void *alloc_arg, int lkflags, struct vnode **rvp) |
int | vn_rlimit_fsize (const struct vnode *vp, const struct uio *uio, struct thread *td) |
int | vn_chmod (struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td) |
int | vn_chown (struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, struct thread *td) |
void | vn_pages_remove (struct vnode *vp, vm_pindex_t start, vm_pindex_t end) |
void | vn_pages_remove_valid (struct vnode *vp, vm_pindex_t start, vm_pindex_t end) |
int | vn_bmap_seekhole_locked (struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) |
int | vn_bmap_seekhole (struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) |
int | vn_seek (struct file *fp, off_t offset, int whence, struct thread *td) |
int | vn_utimes_perm (struct vnode *vp, struct vattr *vap, struct ucred *cred, struct thread *td) |
int | vn_fill_kinfo (struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) |
static void | vn_fill_junk (struct kinfo_file *kif) |
int | vn_fill_kinfo_vnode (struct vnode *vp, struct kinfo_file *kif) |
int | vn_mmap (struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, struct thread *td) |
void | vn_fsid (struct vnode *vp, struct vattr *va) |
int | vn_fsync_buf (struct vnode *vp, int waitfor) |
int | vn_copy_file_range (struct vnode *invp, off_t *inoffp, struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags, struct ucred *incred, struct ucred *outcred, struct thread *fsize_td) |
static bool | mem_iszero (void *dat, int len) |
static off_t | vn_skip_hole (struct vnode *outvp, off_t xfer2, off_t *outoffp, off_t *xferp, off_t *dataoffp, off_t *holeoffp, struct ucred *cred) |
static int | vn_write_outvp (struct vnode *outvp, char *dat, off_t outoff, off_t xfer, u_long blksize, bool growfile, bool checkhole, struct ucred *cred) |
int | vn_generic_copy_file_range (struct vnode *invp, off_t *inoffp, struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags, struct ucred *incred, struct ucred *outcred, struct thread *fsize_td) |
static int | vn_fallocate (struct file *fp, off_t offset, off_t len, struct thread *td) |
static int | vn_deallocate_impl (struct vnode *vp, off_t *offset, off_t *length, int flags, int ioflag, struct ucred *cred, struct ucred *active_cred, struct ucred *file_cred) |
int | vn_deallocate (struct vnode *vp, off_t *offset, off_t *length, int flags, int ioflag, struct ucred *active_cred, struct ucred *file_cred) |
static int | vn_fspacectl (struct file *fp, int cmd, off_t *offset, off_t *length, int flags, struct ucred *active_cred, struct thread *td) |
SYSCTL_ULONG (_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, &vn_lock_pair_pause_cnt, 0, "Count of vn_lock_pair deadlocks") | |
SYSCTL_UINT (_debug, OID_AUTO, vn_lock_pair_pause_max, CTLFLAG_RW, &vn_lock_pair_pause_max, 0, "Max ticks for vn_lock_pair deadlock avoidance sleep") | |
static void | vn_lock_pair_pause (const char *wmesg) |
void | vn_lock_pair (struct vnode *vp1, bool vp1_locked, struct vnode *vp2, bool vp2_locked) |
int | vn_lktype_write (struct mount *mp, struct vnode *vp) |
Variables | |
static fo_rdwr_t | vn_read |
static fo_rdwr_t | vn_write |
static fo_rdwr_t | vn_io_fault |
static fo_truncate_t | vn_truncate |
static fo_ioctl_t | vn_ioctl |
static fo_poll_t | vn_poll |
static fo_kqfilter_t | vn_kqfilter |
static fo_close_t | vn_closefile |
static fo_mmap_t | vn_mmap |
static fo_fallocate_t | vn_fallocate |
static fo_fspacectl_t | vn_fspacectl |
struct fileops | vnops |
const u_int | io_hold_cnt = 16 |
static int | vn_io_fault_enable = 1 |
static int | vn_io_fault_prefault = 0 |
static int | vn_io_pgcache_read_enable = 1 |
static u_long | vn_io_faults_cnt |
static int | vfs_allow_read_dir = 0 |
static u_long | vn_lock_pair_pause_cnt |
u_int | vn_lock_pair_pause_max |
__FBSDID | ( | "$FreeBSD$" | ) |
int _vn_lock | ( | struct vnode * | vp, |
int | flags, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 1804 of file vfs_vnops.c.
References _vn_lock_fallback(), and flags.
|
static |
Definition at line 1767 of file vfs_vnops.c.
References flags.
Referenced by _vn_lock().
|
static |
Definition at line 156 of file vfs_vnops.c.
References vn_io_fault_enable.
Referenced by vn_io_fault(), and vn_rdwr().
off_t foffset_lock | ( | struct file * | fp, |
int | flags | ||
) |
Definition at line 757 of file vfs_vnops.c.
References flags, vn_io_fault_args::fp, res, sleepq_add(), sleepq_lock(), sleepq_release(), and sleepq_wait().
Referenced by foffset_lock_uio(), kern_getdirentries(), shm_seek(), and vn_seek().
void foffset_lock_uio | ( | struct file * | fp, |
struct uio * | uio, | ||
int | flags | ||
) |
Definition at line 884 of file vfs_vnops.c.
References flags, and foffset_lock().
Referenced by shm_read(), shm_write(), and vn_io_fault().
void foffset_unlock | ( | struct file * | fp, |
off_t | val, | ||
int | flags | ||
) |
Definition at line 803 of file vfs_vnops.c.
References flags, vn_io_fault_args::fp, sleepq_broadcast(), sleepq_lock(), and sleepq_release().
Referenced by foffset_unlock_uio(), kern_getdirentries(), shm_seek(), and vn_seek().
void foffset_unlock_uio | ( | struct file * | fp, |
struct uio * | uio, | ||
int | flags | ||
) |
Definition at line 892 of file vfs_vnops.c.
References flags, and foffset_unlock().
Referenced by shm_read(), shm_write(), and vn_io_fault().
|
static |
Definition at line 900 of file vfs_vnops.c.
References mtx, mtx_pool_find(), and mtxpool_sleep.
Referenced by vn_read(), and vn_write().
|
static |
Definition at line 920 of file vfs_vnops.c.
Referenced by vn_fspacectl(), and vn_write().
|
static |
Definition at line 2998 of file vfs_vnops.c.
Referenced by vn_generic_copy_file_range().
|
static |
Definition at line 199 of file vfs_vnops.c.
References res.
Referenced by vn_open_cred().
|
static |
Definition at line 564 of file vfs_vnops.c.
Referenced by vn_read(), and vn_write().
SYSCTL_INT | ( | _debug | , |
OID_AUTO | , | ||
vn_io_fault_enable | , | ||
CTLFLAG_RWTUN | , | ||
& | vn_io_fault_enable, | ||
0 | , | ||
"Enable vn_io_fault lock avoidance" | |||
) |
SYSCTL_INT | ( | _debug | , |
OID_AUTO | , | ||
vn_io_fault_prefault | , | ||
CTLFLAG_RWTUN | , | ||
& | vn_io_fault_prefault, | ||
0 | , | ||
"Enable vn_io_fault prefaulting" | |||
) |
SYSCTL_INT | ( | _debug | , |
OID_AUTO | , | ||
vn_io_pgcache_read_enable | , | ||
CTLFLAG_RWTUN | , | ||
& | vn_io_pgcache_read_enable, | ||
0 | , | ||
"Enable copying from page cache for | reads, | ||
avoiding fs" | |||
) |
SYSCTL_INT | ( | _security_bsd | , |
OID_AUTO | , | ||
allow_read_dir | , | ||
CTLFLAG_RW | , | ||
& | vfs_allow_read_dir, | ||
0 | , | ||
"Enable read(2) of directory by root for filesystems that support it" | |||
) |
SYSCTL_UINT | ( | _debug | , |
OID_AUTO | , | ||
vn_lock_pair_pause_max | , | ||
CTLFLAG_RW | , | ||
& | vn_lock_pair_pause_max, | ||
0 | , | ||
"Max ticks for vn_lock_pair deadlock avoidance sleep" | |||
) |
SYSCTL_ULONG | ( | _debug | , |
OID_AUTO | , | ||
vn_io_faults | , | ||
CTLFLAG_RD | , | ||
& | vn_io_faults_cnt, | ||
0 | , | ||
"Count of vn_io_fault lock avoidance triggers" | |||
) |
SYSCTL_ULONG | ( | _debug | , |
OID_AUTO | , | ||
vn_lock_pair_pause | , | ||
CTLFLAG_RD | , | ||
& | vn_lock_pair_pause_cnt, | ||
0 | , | ||
"Count of vn_lock_pair deadlocks" | |||
) |
void vfs_write_resume | ( | struct mount * | mp, |
int | flags | ||
) |
Definition at line 2114 of file vfs_vnops.c.
References flags, vfs_op_exit(), vn_start_write_refed(), and wakeup().
Referenced by resume_all_fs(), and vfs_write_suspend().
int vfs_write_suspend | ( | struct mount * | mp, |
int | flags | ||
) |
Definition at line 2065 of file vfs_vnops.c.
References flags, vfs_op_enter(), vfs_op_exit_locked(), and vfs_write_resume().
Referenced by suspend_all_fs(), and vfs_write_suspend_umnt().
int vfs_write_suspend_umnt | ( | struct mount * | mp | ) |
Definition at line 2147 of file vfs_vnops.c.
References vfs_write_suspend(), vn_finished_write(), vn_start_write(), and wakeup().
int vn_bmap_seekhole | ( | struct vnode * | vp, |
u_long | cmd, | ||
off_t * | off, | ||
struct ucred * | cred | ||
) |
Definition at line 2520 of file vfs_vnops.c.
References vn_bmap_seekhole_locked().
int vn_bmap_seekhole_locked | ( | struct vnode * | vp, |
u_long | cmd, | ||
off_t * | off, | ||
struct ucred * | cred | ||
) |
Definition at line 2467 of file vfs_vnops.c.
Referenced by vn_bmap_seekhole(), and vop_stddeallocate().
int vn_chmod | ( | struct file * | fp, |
mode_t | mode, | ||
struct ucred * | active_cred, | ||
struct thread * | td | ||
) |
Definition at line 2403 of file vfs_vnops.c.
References mode, and setfmode().
Referenced by pipe_chmod().
int vn_chown | ( | struct file * | fp, |
uid_t | uid, | ||
gid_t | gid, | ||
struct ucred * | active_cred, | ||
struct thread * | td | ||
) |
Definition at line 2418 of file vfs_vnops.c.
References setfown().
Referenced by pipe_chown().
int vn_close | ( | struct vnode * | vp, |
int | flags, | ||
struct ucred * | file_cred, | ||
struct thread * | td | ||
) |
Definition at line 553 of file vfs_vnops.c.
References flags, and vn_close1().
Referenced by acct_disable(), alq_shutdown(), coredump(), corefile_open_last(), link_elf_ctf_get(), link_elf_load_file(), linker_hints_lookup(), linker_lookup_file(), sys_acct(), sys_ktrace(), vfs_mountroot_readconf(), vnode_close_locked(), and vop_stdvptocnp().
|
static |
Definition at line 523 of file vfs_vnops.c.
References flags, vn_finished_write(), vn_start_write(), and vput().
Referenced by vn_close(), and vn_closefile().
|
static |
Definition at line 1821 of file vfs_vnops.c.
References badfileops, vn_close1(), and vrele().
int vn_copy_file_range | ( | struct vnode * | invp, |
off_t * | inoffp, | ||
struct vnode * | outvp, | ||
off_t * | outoffp, | ||
size_t * | lenp, | ||
unsigned int | flags, | ||
struct ucred * | incred, | ||
struct ucred * | outcred, | ||
struct thread * | fsize_td | ||
) |
Definition at line 2943 of file vfs_vnops.c.
References flags, and vn_generic_copy_file_range().
Referenced by kern_copy_file_range().
int vn_deallocate | ( | struct vnode * | vp, |
off_t * | offset, | ||
off_t * | length, | ||
int | flags, | ||
int | ioflag, | ||
struct ucred * | active_cred, | ||
struct ucred * | file_cred | ||
) |
Definition at line 3584 of file vfs_vnops.c.
References flags, and vn_deallocate_impl().
|
static |
Definition at line 3510 of file vfs_vnops.c.
References bwillwrite(), flags, maybe_yield(), vn_finished_write(), vn_lktype_write(), and vn_start_write().
Referenced by vn_deallocate(), and vn_fspacectl().
int vn_extattr_get | ( | struct vnode * | vp, |
int | ioflg, | ||
int | attrnamespace, | ||
const char * | attrname, | ||
int * | buflen, | ||
char * | buf, | ||
struct thread * | td | ||
) |
Definition at line 2199 of file vfs_vnops.c.
References attrnamespace, and buf.
int vn_extattr_rm | ( | struct vnode * | vp, |
int | ioflg, | ||
int | attrnamespace, | ||
const char * | attrname, | ||
struct thread * | td | ||
) |
Definition at line 2279 of file vfs_vnops.c.
References attrnamespace, vn_finished_write(), and vn_start_write().
int vn_extattr_set | ( | struct vnode * | vp, |
int | ioflg, | ||
int | attrnamespace, | ||
const char * | attrname, | ||
int | buflen, | ||
char * | buf, | ||
struct thread * | td | ||
) |
Definition at line 2240 of file vfs_vnops.c.
References attrnamespace, buf, vn_finished_write(), and vn_start_write().
|
static |
Definition at line 3452 of file vfs_vnops.c.
References bwillwrite(), maybe_yield(), panic(), vn_finished_write(), and vn_start_write().
|
inlinestatic |
Definition at line 2650 of file vfs_vnops.c.
Referenced by vn_fill_kinfo_vnode().
int vn_fill_kinfo | ( | struct file * | fp, |
struct kinfo_file * | kif, | ||
struct filedesc * | fdp | ||
) |
Definition at line 2631 of file vfs_vnops.c.
References vn_fill_kinfo_vnode(), vref(), and vrele().
Referenced by pipe_fill_kinfo().
int vn_fill_kinfo_vnode | ( | struct vnode * | vp, |
struct kinfo_file * | kif | ||
) |
Definition at line 2668 of file vfs_vnops.c.
References free(), vn_fill_junk(), vn_fullpath(), and vntype_to_kinfo().
Referenced by export_vnode_to_kinfo(), and vn_fill_kinfo().
void vn_finished_secondary_write | ( | struct mount * | mp | ) |
Definition at line 2046 of file vfs_vnops.c.
References panic(), and wakeup().
Referenced by vgonel().
void vn_finished_write | ( | struct mount * | mp | ) |
Definition at line 2009 of file vfs_vnops.c.
References wakeup().
Referenced by aio_fsync_vnode(), alq_doio(), core_output(), dounmount(), dounmount_cleanup(), extattr_delete_vp(), extattr_set_vp(), flushbufqueues(), kern_frmdirat(), kern_fsync(), kern_funlinkat(), kern_linkat_vp(), kern_mkdirat(), kern_mkfifoat(), kern_mknodat(), kern_renameat(), kern_symlinkat(), kern_sync(), kern_truncate(), setfflags(), setfmode(), setfown(), setutimes(), sync_vnode(), sys_extattrctl(), sys_undelete(), uipc_bindat(), vacl_delete(), vacl_set_acl(), vfs_domount_first(), vfs_write_suspend_umnt(), vlrureclaim(), vn_close1(), vn_deallocate_impl(), vn_extattr_rm(), vn_extattr_set(), vn_fallocate(), vn_generic_copy_file_range(), vn_open_cred(), vn_rdwr(), vn_truncate(), vn_write(), vn_write_outvp(), and vtryrecycle().
void vn_fsid | ( | struct vnode * | vp, |
struct vattr * | va | ||
) |
Definition at line 2829 of file vfs_vnops.c.
|
static |
Definition at line 3601 of file vfs_vnops.c.
References flags, get_write_ioflag(), panic(), and vn_deallocate_impl().
int vn_fsync_buf | ( | struct vnode * | vp, |
int | waitfor | ||
) |
Definition at line 2840 of file vfs_vnops.c.
References bawrite(), bremfree(), buf, bufobj_wwait(), hz, panic(), vfs_bio_awrite(), and vn_printf().
Referenced by vop_stdfdatasync_buf(), and vop_stdfsync().
int vn_generic_copy_file_range | ( | struct vnode * | invp, |
off_t * | inoffp, | ||
struct vnode * | outvp, | ||
off_t * | outoffp, | ||
size_t * | lenp, | ||
unsigned int | flags, | ||
struct ucred * | incred, | ||
struct ucred * | outcred, | ||
struct thread * | fsize_td | ||
) |
Definition at line 3167 of file vfs_vnops.c.
References flags, free(), getnanouptime(), malloc(), mem_iszero(), sig_intr(), vn_finished_write(), vn_rdwr(), vn_rlimit_fsize(), vn_start_write(), vn_truncate_locked(), and vn_write_outvp().
Referenced by vn_copy_file_range(), and vop_stdcopy_file_range().
|
static |
Definition at line 2308 of file vfs_vnops.c.
Referenced by vn_vget_ino().
|
static |
Definition at line 1439 of file vfs_vnops.c.
References vn_io_fault_args::args, do_vn_io_fault(), vn_io_fault_args::doio, flags, foffset_lock_uio(), foffset_unlock_uio(), vn_io_fault_args::fp, priv_check(), vfs_allow_read_dir, vn_io_fault1(), vn_io_fault_args::VN_IO_FAULT_FOP, vn_read, vn_write, and vn_io_fault_args::vp.
|
static |
Definition at line 1327 of file vfs_vnops.c.
References addr, cloneuio(), free(), io_hold_cnt, uiomove(), vn_io_fault_doio(), vn_io_fault_prefault, vn_io_fault_prefault_user(), and vn_io_faults_cnt.
Referenced by vn_io_fault(), and vn_rdwr().
|
static |
Definition at line 1237 of file vfs_vnops.c.
References vn_io_fault_args::args, vn_io_fault_args::cred, vn_io_fault_args::flags, vn_io_fault_args::fop_args, vn_io_fault_args::kind, panic(), and vn_io_fault_args::vop_args.
Referenced by vn_io_fault1().
int vn_io_fault_pgmove | ( | vm_page_t | ma[], |
vm_offset_t | offset, | ||
int | xfersize, | ||
struct uio * | uio | ||
) |
Definition at line 1564 of file vfs_vnops.c.
Referenced by vn_read_from_obj().
|
static |
Definition at line 1278 of file vfs_vnops.c.
References vn_io_fault_touch().
Referenced by vn_io_fault1().
|
static |
Definition at line 1267 of file vfs_vnops.c.
Referenced by vn_io_fault_prefault_user().
int vn_io_fault_uiomove | ( | char * | data, |
int | xfersize, | ||
struct uio * | uio | ||
) |
Definition at line 1508 of file vfs_vnops.c.
References data, and uiomove().
|
static |
Definition at line 1689 of file vfs_vnops.c.
References data.
|
static |
Definition at line 2179 of file vfs_vnops.c.
int vn_kqfilter_opath | ( | struct file * | fp, |
struct knote * | kn | ||
) |
Definition at line 2186 of file vfs_vnops.c.
References vn_kqfilter.
int vn_lktype_write | ( | struct mount * | mp, |
struct vnode * | vp | ||
) |
Definition at line 3724 of file vfs_vnops.c.
Referenced by kern_fsync(), vn_deallocate_impl(), vn_rdwr(), vn_write(), and vn_write_outvp().
void vn_lock_pair | ( | struct vnode * | vp1, |
bool | vp1_locked, | ||
struct vnode * | vp2, | ||
bool | vp2_locked | ||
) |
Definition at line 3659 of file vfs_vnops.c.
References vn_lock_pair_pause().
Referenced by vfs_domount_first().
|
static |
Definition at line 3641 of file vfs_vnops.c.
References prng32_bounded(), vn_lock_pair_pause_cnt, and vn_lock_pair_pause_max.
Referenced by vn_lock_pair().
int vn_mmap | ( | struct file * | fp, |
vm_map_t | map, | ||
vm_offset_t * | addr, | ||
vm_size_t | size, | ||
vm_prot_t | prot, | ||
vm_prot_t | cap_maxprot, | ||
int | flags, | ||
vm_ooffset_t | foff, | ||
struct thread * | td | ||
) |
Definition at line 2715 of file vfs_vnops.c.
int vn_open | ( | struct nameidata * | ndp, |
int * | flagp, | ||
int | cmode, | ||
struct file * | fp | ||
) |
Definition at line 191 of file vfs_vnops.c.
References vn_open_cred().
Referenced by kern_openat(), link_elf_ctf_get(), link_elf_load_file(), linker_hints_lookup(), linker_lookup_file(), sys_acct(), sys_ktrace(), and vfs_mountroot_readconf().
int vn_open_cred | ( | struct nameidata * | ndp, |
int * | flagp, | ||
int | cmode, | ||
u_int | vn_open_flags, | ||
struct ucred * | cred, | ||
struct file * | fp | ||
) |
Definition at line 228 of file vfs_vnops.c.
References bwillwrite(), namei(), NDFREE(), open2nameif(), vn_finished_write(), vn_open_vnode(), vn_start_write(), vput(), vrele(), and wakeup().
Referenced by alq_open_flags(), corefile_open(), corefile_open_last(), vn_open(), and vop_stdvptocnp().
int vn_open_vnode | ( | struct vnode * | vp, |
int | fmode, | ||
struct ucred * | cred, | ||
struct thread * | td, | ||
struct file * | fp | ||
) |
Definition at line 391 of file vfs_vnops.c.
References accmode, badfileops, vn_open_vnode_advlock(), vnops, and vref().
Referenced by kern_fhopen(), and vn_open_cred().
|
static |
Definition at line 354 of file vfs_vnops.c.
References type.
Referenced by vn_open_vnode().
void vn_pages_remove | ( | struct vnode * | vp, |
vm_pindex_t | start, | ||
vm_pindex_t | end | ||
) |
Definition at line 2437 of file vfs_vnops.c.
References start.
Referenced by v_inval_buf_range().
void vn_pages_remove_valid | ( | struct vnode * | vp, |
vm_pindex_t | start, | ||
vm_pindex_t | end | ||
) |
Definition at line 2455 of file vfs_vnops.c.
References start.
|
static |
Definition at line 1741 of file vfs_vnops.c.
int vn_rdwr | ( | enum uio_rw | rw, |
struct vnode * | vp, | ||
void * | base, | ||
int | len, | ||
off_t | offset, | ||
enum uio_seg | segflg, | ||
int | ioflg, | ||
struct ucred * | active_cred, | ||
struct ucred * | file_cred, | ||
ssize_t * | aresid, | ||
struct thread * | td | ||
) |
Definition at line 614 of file vfs_vnops.c.
References vn_io_fault_args::args, vn_io_fault_args::cred, do_vn_io_fault(), vn_finished_write(), vn_io_fault1(), vn_io_fault_args::VN_IO_FAULT_VOP, vn_lktype_write(), vn_start_write(), and vn_io_fault_args::vp.
Referenced by acct_process(), get_interp(), link_elf_ctf_get(), link_elf_load_file(), linker_hints_lookup(), parse_notes(), vfs_mountroot_readconf(), vn_generic_copy_file_range(), vn_rdwr_inchunks(), and vn_write_outvp().
int vn_rdwr_inchunks | ( | enum uio_rw | rw, |
struct vnode * | vp, | ||
void * | base, | ||
size_t | len, | ||
off_t | offset, | ||
enum uio_seg | segflg, | ||
int | ioflg, | ||
struct ucred * | active_cred, | ||
struct ucred * | file_cred, | ||
size_t * | aresid, | ||
struct thread * | td | ||
) |
Definition at line 718 of file vfs_vnops.c.
References bwillwrite(), kern_yield(), vn_rdwr(), and vn_io_fault_args::vp.
Referenced by core_write().
|
static |
Definition at line 1059 of file vfs_vnops.c.
References flags, get_advice(), sequential_heuristic(), and vn_io_pgcache_read_enable.
int vn_read_from_obj | ( | struct vnode * | vp, |
struct uio * | uio | ||
) |
Definition at line 949 of file vfs_vnops.c.
References io_hold_cnt, and vn_io_fault_pgmove().
int vn_rlimit_fsize | ( | const struct vnode * | vp, |
const struct uio * | uio, | ||
struct thread * | td | ||
) |
Definition at line 2367 of file vfs_vnops.c.
References kern_psignal(), and lim_cur().
Referenced by vn_generic_copy_file_range().
int vn_seek | ( | struct file * | fp, |
off_t | offset, | ||
int | whence, | ||
struct thread * | td | ||
) |
Definition at line 2535 of file vfs_vnops.c.
References foffset_lock(), and foffset_unlock().
|
static |
Definition at line 3025 of file vfs_vnops.c.
Referenced by vn_write_outvp().
int vn_start_secondary_write | ( | struct vnode * | vp, |
struct mount ** | mpp, | ||
int | flags | ||
) |
Definition at line 1946 of file vfs_vnops.c.
References flags, and vfs_rel().
Referenced by vgonel().
int vn_start_write | ( | struct vnode * | vp, |
struct mount ** | mpp, | ||
int | flags | ||
) |
Definition at line 1901 of file vfs_vnops.c.
References flags, vfs_ref(), and vn_start_write_refed().
Referenced by aio_fsync_vnode(), alq_doio(), core_output(), dounmount(), extattr_delete_vp(), extattr_set_vp(), flushbufqueues(), kern_frmdirat(), kern_fsync(), kern_funlinkat(), kern_linkat_vp(), kern_mkdirat(), kern_mkfifoat(), kern_mknodat(), kern_renameat(), kern_symlinkat(), kern_sync(), kern_truncate(), setfflags(), setfmode(), setfown(), setutimes(), sync_vnode(), sys_extattrctl(), sys_undelete(), uipc_bindat(), vacl_delete(), vacl_set_acl(), vfs_domount_first(), vfs_write_suspend_umnt(), vlrureclaim(), vn_close1(), vn_deallocate_impl(), vn_extattr_rm(), vn_extattr_set(), vn_fallocate(), vn_generic_copy_file_range(), vn_open_cred(), vn_rdwr(), vn_truncate(), vn_write(), vn_write_outvp(), and vtryrecycle().
|
static |
Definition at line 1852 of file vfs_vnops.c.
References flags.
Referenced by vfs_write_resume(), and vn_start_write().
int vn_statfile | ( | struct file * | fp, |
struct stat * | sb, | ||
struct ucred * | active_cred | ||
) |
Definition at line 1673 of file vfs_vnops.c.
|
static |
Definition at line 1605 of file vfs_vnops.c.
References vn_finished_write(), vn_start_write(), and vn_truncate_locked().
int vn_truncate_locked | ( | struct vnode * | vp, |
off_t | length, | ||
bool | sync, | ||
struct ucred * | cred | ||
) |
Definition at line 1651 of file vfs_vnops.c.
Referenced by core_output(), vn_generic_copy_file_range(), vn_truncate(), and vn_write_outvp().
int vn_utimes_perm | ( | struct vnode * | vp, |
struct vattr * | vap, | ||
struct ucred * | cred, | ||
struct thread * | td | ||
) |
Definition at line 2608 of file vfs_vnops.c.
int vn_vget_ino | ( | struct vnode * | vp, |
ino_t | ino, | ||
int | lkflags, | ||
struct vnode ** | rvp | ||
) |
Definition at line 2316 of file vfs_vnops.c.
References vn_get_ino_alloc_vget(), and vn_vget_ino_gen().
int vn_vget_ino_gen | ( | struct vnode * | vp, |
vn_get_ino_t | alloc, | ||
void * | alloc_arg, | ||
int | lkflags, | ||
struct vnode ** | rvp | ||
) |
Definition at line 2324 of file vfs_vnops.c.
References vfs_busy(), vfs_ref(), vfs_rel(), vfs_unbusy(), vput(), and vunref().
Referenced by vn_vget_ino().
|
static |
Definition at line 1130 of file vfs_vnops.c.
References bwillwrite(), flags, get_advice(), get_write_ioflag(), sequential_heuristic(), vn_finished_write(), vn_lktype_write(), and vn_start_write().
|
static |
Definition at line 3100 of file vfs_vnops.c.
References bwillwrite(), vn_finished_write(), vn_lktype_write(), vn_rdwr(), vn_skip_hole(), vn_start_write(), and vn_truncate_locked().
Referenced by vn_generic_copy_file_range().
int vn_writechk | ( | struct vnode * | vp | ) |
Definition at line 504 of file vfs_vnops.c.
Referenced by kern_truncate(), and vn_access().
const u_int io_hold_cnt = 16 |
Definition at line 131 of file vfs_vnops.c.
Referenced by vn_io_fault1(), and vn_read_from_obj().
|
static |
Definition at line 146 of file vfs_vnops.c.
Referenced by vn_io_fault().
|
static |
Definition at line 106 of file vfs_vnops.c.
|
static |
Definition at line 108 of file vfs_vnops.c.
|
static |
Definition at line 109 of file vfs_vnops.c.
|
static |
Definition at line 101 of file vfs_vnops.c.
|
static |
Definition at line 132 of file vfs_vnops.c.
Referenced by do_vn_io_fault().
|
static |
Definition at line 135 of file vfs_vnops.c.
Referenced by vn_io_fault1().
|
static |
Definition at line 142 of file vfs_vnops.c.
Referenced by vn_io_fault1().
|
static |
Definition at line 138 of file vfs_vnops.c.
Referenced by vn_read().
|
static |
Definition at line 103 of file vfs_vnops.c.
|
static |
Definition at line 105 of file vfs_vnops.c.
Referenced by vn_kqfilter_opath().
|
static |
Definition at line 3630 of file vfs_vnops.c.
Referenced by vn_lock_pair_pause().
u_int vn_lock_pair_pause_max |
Definition at line 3635 of file vfs_vnops.c.
Referenced by init_param1(), and vn_lock_pair_pause().
|
static |
Definition at line 107 of file vfs_vnops.c.
|
static |
Definition at line 104 of file vfs_vnops.c.
|
static |
Definition at line 99 of file vfs_vnops.c.
Referenced by vn_io_fault().
|
static |
Definition at line 102 of file vfs_vnops.c.
|
static |
Definition at line 100 of file vfs_vnops.c.
Referenced by vn_io_fault().
struct fileops vnops |
Definition at line 111 of file vfs_vnops.c.
Referenced by kern_fhopen(), kern_openat(), pipe_close(), pipe_kqfilter(), pipe_stat(), pipe_truncate(), ptsdev_close(), and vn_open_vnode().