2005-01-06 23:35:40 +00:00
|
|
|
#-
|
1994-05-24 10:09:53 +00:00
|
|
|
# Copyright (c) 1992, 1993
|
|
|
|
# The Regents of the University of California. All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
2016-09-15 13:16:20 +00:00
|
|
|
# 3. Neither the name of the University nor the names of its contributors
|
1994-05-24 10:09:53 +00:00
|
|
|
# may be used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
|
|
|
#
|
1997-02-10 02:22:35 +00:00
|
|
|
# @(#)vnode_if.src 8.12 (Berkeley) 5/14/95
|
1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1997-02-10 02:22:35 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2006-05-30 20:49:54 +00:00
|
|
|
# Above each of the vop descriptors in lines starting with %%
|
|
|
|
# is a specification of the locking protocol used by each vop call.
|
|
|
|
# The first column is the name of the variable, the remaining three
|
|
|
|
# columns are in, out and error respectively. The "in" column defines
|
2016-04-29 22:15:33 +00:00
|
|
|
# the lock state on input, the "out" column defines the state on successful
|
2006-05-30 20:49:54 +00:00
|
|
|
# return, and the "error" column defines the locking state on error exit.
|
1997-02-10 02:22:35 +00:00
|
|
|
#
|
|
|
|
# The locking value can take the following values:
|
1999-12-11 16:13:02 +00:00
|
|
|
# L: locked; not converted to type of lock.
|
|
|
|
# E: locked with exclusive lock for this process.
|
1999-03-27 03:08:07 +00:00
|
|
|
# U: unlocked.
|
1997-02-10 02:22:35 +00:00
|
|
|
# -: not applicable. vnode does not yet (or no longer) exists.
|
|
|
|
# =: the same on input and output, may be either L or U.
|
|
|
|
#
|
2003-06-20 12:24:06 +00:00
|
|
|
# The paramater named "vpp" is assumed to be always used with double
|
2012-01-06 20:06:45 +00:00
|
|
|
# indirection (**vpp) and that name is hard-coded in vnode_if.awk !
|
2003-06-20 12:24:06 +00:00
|
|
|
#
|
2006-05-30 20:49:54 +00:00
|
|
|
# Lines starting with %! specify a pre or post-condition function
|
|
|
|
# to call before/after the vop call.
|
|
|
|
#
|
2003-06-20 12:24:06 +00:00
|
|
|
# If other such parameters are introduced, they have to be added to
|
|
|
|
# the AWK script at the head of the definition of "add_debug_code()".
|
|
|
|
#
|
1997-02-10 02:22:35 +00:00
|
|
|
|
1999-09-26 18:10:59 +00:00
|
|
|
vop_islocked {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2012-11-19 11:32:56 +00:00
|
|
|
%% lookup dvp L L L
|
2006-05-30 20:49:54 +00:00
|
|
|
%% lookup vpp - L -
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
# XXX - the lookup locking protocol defies simple description and depends
|
|
|
|
# on the flags and operation fields in the (cnp) structure. Note
|
|
|
|
# especially that *vpp may equal dvp and both may be locked.
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_lookup {
|
|
|
|
IN struct vnode *dvp;
|
|
|
|
INOUT struct vnode **vpp;
|
|
|
|
IN struct componentname *cnp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2012-11-19 11:32:56 +00:00
|
|
|
%% cachedlookup dvp L L L
|
2006-05-30 20:49:54 +00:00
|
|
|
%% cachedlookup vpp - L -
|
|
|
|
|
1997-08-25 20:28:49 +00:00
|
|
|
# This must be an exact copy of lookup. See kern/vfs_cache.c for details.
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1997-08-25 20:28:49 +00:00
|
|
|
vop_cachedlookup {
|
|
|
|
IN struct vnode *dvp;
|
|
|
|
INOUT struct vnode **vpp;
|
|
|
|
IN struct componentname *cnp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
%% create dvp E E E
|
|
|
|
%% create vpp - L -
|
2020-07-25 10:31:52 +00:00
|
|
|
%! create pre vop_create_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! create post vop_create_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_create {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
1994-05-24 10:09:53 +00:00
|
|
|
OUT struct vnode **vpp;
|
|
|
|
IN struct componentname *cnp;
|
|
|
|
IN struct vattr *vap;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% whiteout dvp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! whiteout pre vop_whiteout_pre
|
|
|
|
%! whiteout post vop_whiteout_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
vop_whiteout {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
1997-02-10 02:22:35 +00:00
|
|
|
IN struct componentname *cnp;
|
|
|
|
IN int flags;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% mknod dvp E E E
|
|
|
|
%% mknod vpp - L -
|
2020-07-25 10:31:52 +00:00
|
|
|
%! mknod pre vop_mknod_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! mknod post vop_mknod_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_mknod {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
1999-11-12 03:34:28 +00:00
|
|
|
OUT struct vnode **vpp;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct componentname *cnp;
|
|
|
|
IN struct vattr *vap;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% open vp L L L
|
2016-05-03 15:17:43 +00:00
|
|
|
%! open post vop_open_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_open {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int mode;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
2007-05-31 11:51:53 +00:00
|
|
|
IN struct file *fp;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2009-03-11 14:13:47 +00:00
|
|
|
%% close vp L L L
|
2016-05-03 15:17:43 +00:00
|
|
|
%! close post vop_close_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_close {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int fflag;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2020-07-25 10:32:45 +00:00
|
|
|
%% fplookup_vexec vp - - -
|
2020-07-30 15:50:51 +00:00
|
|
|
%! fplookup_vexec debugpre vop_fplookup_vexec_debugpre
|
|
|
|
%! fplookup_vexec debugpost vop_fplookup_vexec_debugpost
|
2020-07-25 10:32:45 +00:00
|
|
|
|
|
|
|
vop_fplookup_vexec {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
%% access vp L L L
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_access {
|
|
|
|
IN struct vnode *vp;
|
2009-05-30 13:59:05 +00:00
|
|
|
IN accmode_t accmode;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
%% accessx vp L L L
|
|
|
|
|
|
|
|
vop_accessx {
|
|
|
|
IN struct vnode *vp;
|
2008-10-28 13:44:11 +00:00
|
|
|
IN accmode_t accmode;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2020-08-07 23:06:40 +00:00
|
|
|
%% stat vp L L L
|
|
|
|
|
|
|
|
vop_stat {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
OUT struct stat *sb;
|
|
|
|
IN struct ucred *active_cred;
|
|
|
|
IN struct ucred *file_cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
%% getattr vp L L L
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_getattr {
|
|
|
|
IN struct vnode *vp;
|
1999-12-19 06:08:07 +00:00
|
|
|
OUT struct vattr *vap;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% setattr vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! setattr pre vop_setattr_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! setattr post vop_setattr_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_setattr {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct vattr *vap;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2020-02-01 06:46:55 +00:00
|
|
|
%% mmapped vp L L L
|
2009-01-21 14:42:00 +00:00
|
|
|
|
2020-02-01 06:46:55 +00:00
|
|
|
vop_mmapped {
|
2009-01-21 14:42:00 +00:00
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
%% read vp L L L
|
2016-05-03 15:17:43 +00:00
|
|
|
%! read post vop_read_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_read {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
INOUT struct uio *uio;
|
|
|
|
IN int ioflag;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2020-09-15 22:06:36 +00:00
|
|
|
%% read_pgcache vp - - -
|
|
|
|
%! read_pgcache post vop_read_pgcache_post
|
|
|
|
|
|
|
|
vop_read_pgcache {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
INOUT struct uio *uio;
|
|
|
|
IN int ioflag;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-06-08 21:23:54 +00:00
|
|
|
%% write vp L L L
|
2006-05-30 20:49:54 +00:00
|
|
|
%! write pre VOP_WRITE_PRE
|
|
|
|
%! write post VOP_WRITE_POST
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_write {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
INOUT struct uio *uio;
|
|
|
|
IN int ioflag;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% ioctl vp U U U
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_ioctl {
|
|
|
|
IN struct vnode *vp;
|
1997-02-10 02:22:35 +00:00
|
|
|
IN u_long command;
|
2005-12-14 00:49:52 +00:00
|
|
|
IN void *data;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN int fflag;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2008-10-27 21:41:55 +00:00
|
|
|
%% poll vp U U U
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1997-09-14 02:35:25 +00:00
|
|
|
vop_poll {
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct vnode *vp;
|
1997-09-14 02:35:25 +00:00
|
|
|
IN int events;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% kqfilter vp U U U
|
|
|
|
|
2001-02-15 16:34:11 +00:00
|
|
|
vop_kqfilter {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct knote *kn;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% revoke vp L L L
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
vop_revoke {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int flags;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2009-06-11 17:06:45 +00:00
|
|
|
%% fsync vp L L L
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_fsync {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int waitfor;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% remove dvp E E E
|
|
|
|
%% remove vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! remove pre vop_remove_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! remove post vop_remove_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_remove {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
|
|
|
IN struct vnode *vp;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct componentname *cnp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% link tdvp E E E
|
|
|
|
%% link vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! link pre vop_link_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! link post vop_link_post
|
|
|
|
|
1995-08-01 18:51:02 +00:00
|
|
|
vop_link {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *tdvp;
|
1995-08-01 18:51:02 +00:00
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct componentname *cnp;
|
|
|
|
};
|
1994-05-24 10:09:53 +00:00
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%! rename pre vop_rename_pre
|
|
|
|
%! rename post vop_rename_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_rename {
|
|
|
|
IN WILLRELE struct vnode *fdvp;
|
|
|
|
IN WILLRELE struct vnode *fvp;
|
|
|
|
IN struct componentname *fcnp;
|
|
|
|
IN WILLRELE struct vnode *tdvp;
|
|
|
|
IN WILLRELE struct vnode *tvp;
|
|
|
|
IN struct componentname *tcnp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% mkdir dvp E E E
|
|
|
|
%% mkdir vpp - E -
|
2020-07-25 10:31:52 +00:00
|
|
|
%! mkdir pre vop_mkdir_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! mkdir post vop_mkdir_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_mkdir {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
1994-05-24 10:09:53 +00:00
|
|
|
OUT struct vnode **vpp;
|
|
|
|
IN struct componentname *cnp;
|
|
|
|
IN struct vattr *vap;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% rmdir dvp E E E
|
|
|
|
%% rmdir vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! rmdir pre vop_rmdir_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! rmdir post vop_rmdir_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_rmdir {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
|
|
|
IN struct vnode *vp;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct componentname *cnp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% symlink dvp E E E
|
|
|
|
%% symlink vpp - E -
|
2020-07-25 10:31:52 +00:00
|
|
|
%! symlink pre vop_symlink_pre
|
2006-05-30 20:49:54 +00:00
|
|
|
%! symlink post vop_symlink_post
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_symlink {
|
1998-05-07 04:58:58 +00:00
|
|
|
IN struct vnode *dvp;
|
1999-11-13 20:58:17 +00:00
|
|
|
OUT struct vnode **vpp;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct componentname *cnp;
|
|
|
|
IN struct vattr *vap;
|
2018-11-02 14:42:36 +00:00
|
|
|
IN const char *target;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% readdir vp L L L
|
2016-05-03 15:17:43 +00:00
|
|
|
%! readdir post vop_readdir_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_readdir {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
INOUT struct uio *uio;
|
|
|
|
IN struct ucred *cred;
|
1994-09-28 16:45:22 +00:00
|
|
|
INOUT int *eofflag;
|
1997-02-10 02:22:35 +00:00
|
|
|
OUT int *ncookies;
|
|
|
|
INOUT u_long **cookies;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% readlink vp L L L
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_readlink {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
INOUT struct uio *uio;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% inactive vp E E E
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_inactive {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2020-07-30 15:50:51 +00:00
|
|
|
%! need_inactive debugpre vop_need_inactive_debugpre
|
|
|
|
%! need_inactive debugpost vop_need_inactive_debugpost
|
2019-08-28 20:34:24 +00:00
|
|
|
|
|
|
|
vop_need_inactive {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% reclaim vp E E E
|
2015-09-15 20:22:30 +00:00
|
|
|
%! reclaim post vop_reclaim_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_reclaim {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2020-07-30 15:50:51 +00:00
|
|
|
%! lock1 debugpre vop_lock_debugpre
|
|
|
|
%! lock1 debugpost vop_lock_debugpost
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2007-05-18 13:02:13 +00:00
|
|
|
vop_lock1 {
|
1994-05-24 10:09:53 +00:00
|
|
|
IN struct vnode *vp;
|
1997-02-10 02:22:35 +00:00
|
|
|
IN int flags;
|
2020-02-23 03:32:11 +00:00
|
|
|
IN const char *file;
|
2006-11-13 05:51:22 +00:00
|
|
|
IN int line;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2020-07-30 15:50:51 +00:00
|
|
|
%! unlock debugpre vop_unlock_debugpre
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_unlock {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% bmap vp L L L
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_bmap {
|
|
|
|
IN struct vnode *vp;
|
2002-05-14 11:09:43 +00:00
|
|
|
IN daddr_t bn;
|
2004-11-15 09:18:27 +00:00
|
|
|
OUT struct bufobj **bop;
|
2002-05-14 11:09:43 +00:00
|
|
|
IN daddr_t *bnp;
|
1994-05-24 10:09:53 +00:00
|
|
|
OUT int *runp;
|
1995-09-04 00:21:16 +00:00
|
|
|
OUT int *runb;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% strategy vp L L L
|
2020-07-30 15:50:51 +00:00
|
|
|
%! strategy debugpre vop_strategy_debugpre
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1998-07-04 20:45:42 +00:00
|
|
|
vop_strategy {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct buf *bp;
|
|
|
|
};
|
1994-05-24 10:09:53 +00:00
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% getwritemount vp = = =
|
|
|
|
|
2000-07-11 22:07:57 +00:00
|
|
|
vop_getwritemount {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
OUT struct mount **mpp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2008-02-26 12:16:35 +00:00
|
|
|
%% print vp - - -
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_print {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% pathconf vp L L L
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_pathconf {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int name;
|
2018-01-17 22:36:58 +00:00
|
|
|
OUT long *retval;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% advlock vp U U U
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_advlock {
|
|
|
|
IN struct vnode *vp;
|
2005-12-14 00:49:52 +00:00
|
|
|
IN void *id;
|
1994-05-24 10:09:53 +00:00
|
|
|
IN int op;
|
|
|
|
IN struct flock *fl;
|
|
|
|
IN int flags;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2008-03-26 15:23:12 +00:00
|
|
|
%% advlockasync vp U U U
|
|
|
|
|
|
|
|
vop_advlockasync {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN void *id;
|
|
|
|
IN int op;
|
|
|
|
IN struct flock *fl;
|
|
|
|
IN int flags;
|
|
|
|
IN struct task *task;
|
|
|
|
INOUT void **cookiep;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-05-12 21:24:46 +00:00
|
|
|
%% advlockpurge vp E E E
|
|
|
|
|
|
|
|
vop_advlockpurge {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
%% reallocblks vp E E E
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
vop_reallocblks {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct cluster_save *buflist;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% getpages vp L L L
|
|
|
|
|
1995-09-04 00:21:16 +00:00
|
|
|
vop_getpages {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN vm_page_t *m;
|
|
|
|
IN int count;
|
A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().
o With new KPI consumers can request contiguous ranges of pages, and
unlike before, all pages will be kept busied on return, like it was
done before with the 'reqpage' only. Now the reqpage goes away. With
new interface it is easier to implement code protected from race
conditions.
Such arrayed requests for now should be preceeded by a call to
vm_pager_haspage() to make sure that request is possible. This
could be improved later, making vm_pager_haspage() obsolete.
Strenghtening the promises on the business of the array of pages
allows us to remove such hacks as swp_pager_free_nrpage() and
vm_pager_free_nonreq().
o New KPI accepts two integer pointers that may optionally point at
values for read ahead and read behind, that a pager may do, if it
can. These pages are completely owned by pager, and not controlled
by the caller.
This shifts the UFS-specific readahead logic from vm_fault.c, which
should be file system agnostic, into vnode_pager.c. It also removes
one VOP_BMAP() request per hard fault.
Discussed with: kib, alc, jeff, scottl
Sponsored by: Nginx, Inc.
Sponsored by: Netflix
2015-12-16 21:30:45 +00:00
|
|
|
IN int *rbehind;
|
|
|
|
IN int *rahead;
|
1995-09-04 00:21:16 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2014-11-23 12:01:52 +00:00
|
|
|
%% getpages_async vp L L L
|
|
|
|
|
|
|
|
vop_getpages_async {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN vm_page_t *m;
|
|
|
|
IN int count;
|
A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().
o With new KPI consumers can request contiguous ranges of pages, and
unlike before, all pages will be kept busied on return, like it was
done before with the 'reqpage' only. Now the reqpage goes away. With
new interface it is easier to implement code protected from race
conditions.
Such arrayed requests for now should be preceeded by a call to
vm_pager_haspage() to make sure that request is possible. This
could be improved later, making vm_pager_haspage() obsolete.
Strenghtening the promises on the business of the array of pages
allows us to remove such hacks as swp_pager_free_nrpage() and
vm_pager_free_nonreq().
o New KPI accepts two integer pointers that may optionally point at
values for read ahead and read behind, that a pager may do, if it
can. These pages are completely owned by pager, and not controlled
by the caller.
This shifts the UFS-specific readahead logic from vm_fault.c, which
should be file system agnostic, into vnode_pager.c. It also removes
one VOP_BMAP() request per hard fault.
Discussed with: kib, alc, jeff, scottl
Sponsored by: Nginx, Inc.
Sponsored by: Netflix
2015-12-16 21:30:45 +00:00
|
|
|
IN int *rbehind;
|
|
|
|
IN int *rahead;
|
2014-11-23 12:01:52 +00:00
|
|
|
IN vop_getpages_iodone_t *iodone;
|
|
|
|
IN void *arg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-11-09 20:36:29 +00:00
|
|
|
%% putpages vp L L L
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1995-09-04 00:21:16 +00:00
|
|
|
vop_putpages {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN vm_page_t *m;
|
|
|
|
IN int count;
|
|
|
|
IN int sync;
|
|
|
|
IN int *rtvals;
|
|
|
|
};
|
1995-10-23 02:55:55 +00:00
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% getacl vp L L L
|
|
|
|
|
1999-12-19 06:08:07 +00:00
|
|
|
vop_getacl {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN acl_type_t type;
|
|
|
|
OUT struct acl *aclp;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1999-12-19 06:08:07 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% setacl vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! setacl pre vop_setacl_pre
|
|
|
|
%! setacl post vop_setacl_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1999-12-19 06:08:07 +00:00
|
|
|
vop_setacl {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN acl_type_t type;
|
|
|
|
IN struct acl *aclp;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1999-12-19 06:08:07 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% aclcheck vp = = =
|
|
|
|
|
1999-12-19 06:08:07 +00:00
|
|
|
vop_aclcheck {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN acl_type_t type;
|
|
|
|
IN struct acl *aclp;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1999-12-19 06:08:07 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% closeextattr vp L L L
|
|
|
|
|
2002-09-05 20:56:14 +00:00
|
|
|
vop_closeextattr {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int commit;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% getextattr vp L L L
|
|
|
|
|
1999-12-19 06:08:07 +00:00
|
|
|
vop_getextattr {
|
|
|
|
IN struct vnode *vp;
|
2001-03-19 05:44:15 +00:00
|
|
|
IN int attrnamespace;
|
2000-08-26 22:00:58 +00:00
|
|
|
IN const char *name;
|
1999-12-19 06:08:07 +00:00
|
|
|
INOUT struct uio *uio;
|
Part I: Update extended attribute API and ABI:
o Modify the system call syntax for extattr_{get,set}_{fd,file}() so
as not to use the scatter gather API (which appeared not to be used
by any consumers, and be less portable), rather, accepts 'data'
and 'nbytes' in the style of other simple read/write interfaces.
This changes the API and ABI.
o Modify system call semantics so that extattr_get_{fd,file}() return
a size_t. When performing a read, the number of bytes read will
be returned, unless the data pointer is NULL, in which case the
number of bytes of data are returned. This changes the API only.
o Modify the VOP_GETEXTATTR() vnode operation to accept a *size_t
argument so as to return the size, if desirable. If set to NULL,
the size will not be returned.
o Update various filesystems (pseodofs, ufs) to DTRT.
These changes should make extended attributes more useful and more
portable. More commits to rebuild the system call files, as well
as update userland utilities to follow.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-02-10 04:43:22 +00:00
|
|
|
OUT size_t *size;
|
1999-12-19 06:08:07 +00:00
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1999-12-19 06:08:07 +00:00
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% listextattr vp L L L
|
|
|
|
|
2003-06-05 05:53:35 +00:00
|
|
|
vop_listextattr {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int attrnamespace;
|
|
|
|
INOUT struct uio *uio;
|
|
|
|
OUT size_t *size;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% openextattr vp L L L
|
|
|
|
|
2002-09-05 20:56:14 +00:00
|
|
|
vop_openextattr {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% deleteextattr vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! deleteextattr pre vop_deleteextattr_pre
|
2011-12-23 20:11:37 +00:00
|
|
|
%! deleteextattr post vop_deleteextattr_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
2003-07-28 18:53:29 +00:00
|
|
|
vop_deleteextattr {
|
2003-06-22 22:45:24 +00:00
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int attrnamespace;
|
|
|
|
IN const char *name;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% setextattr vp E E E
|
2020-07-25 10:31:52 +00:00
|
|
|
%! setextattr pre vop_setextattr_pre
|
2011-12-23 20:11:37 +00:00
|
|
|
%! setextattr post vop_setextattr_post
|
2006-05-30 20:49:54 +00:00
|
|
|
|
1999-12-19 06:08:07 +00:00
|
|
|
vop_setextattr {
|
|
|
|
IN struct vnode *vp;
|
2001-03-19 05:44:15 +00:00
|
|
|
IN int attrnamespace;
|
2000-08-26 22:00:58 +00:00
|
|
|
IN const char *name;
|
1999-12-19 06:08:07 +00:00
|
|
|
INOUT struct uio *uio;
|
|
|
|
IN struct ucred *cred;
|
2001-09-12 08:38:13 +00:00
|
|
|
IN struct thread *td;
|
1999-12-19 06:08:07 +00:00
|
|
|
};
|
2000-09-12 09:49:08 +00:00
|
|
|
|
2006-05-30 20:49:54 +00:00
|
|
|
|
|
|
|
%% setlabel vp E E E
|
|
|
|
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the operating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Introduce two node vnode operations required to support MAC. First,
VOP_REFRESHLABEL(), which will be invoked by callers requiring that
vp->v_label be sufficiently "fresh" for access control purposes.
Second, VOP_SETLABEL(), which be invoked by callers requiring that
the passed label contents be updated. The file system is responsible
for updating v_label if appropriate in coordination with the MAC
framework, as well as committing to disk. File systems that are
not MAC-aware need not implement these VOPs, as the MAC framework
will default to maintaining a single label for all vnodes based
on the label on the file system mount point.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 22:15:09 +00:00
|
|
|
vop_setlabel {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct label *label;
|
|
|
|
IN struct ucred *cred;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
2007-02-15 22:08:35 +00:00
|
|
|
|
|
|
|
|
2008-10-27 21:41:55 +00:00
|
|
|
%% vptofh vp = = =
|
2007-02-15 22:08:35 +00:00
|
|
|
|
|
|
|
vop_vptofh {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct fid *fhp;
|
|
|
|
};
|
2008-12-12 00:57:38 +00:00
|
|
|
|
2011-04-18 16:32:22 +00:00
|
|
|
|
2008-12-12 00:57:38 +00:00
|
|
|
%% vptocnp vp L L L
|
|
|
|
%% vptocnp vpp - U -
|
|
|
|
|
|
|
|
vop_vptocnp {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
OUT struct vnode **vpp;
|
|
|
|
INOUT char *buf;
|
2020-02-01 20:34:43 +00:00
|
|
|
INOUT size_t *buflen;
|
2008-12-12 00:57:38 +00:00
|
|
|
};
|
2011-04-18 16:32:22 +00:00
|
|
|
|
|
|
|
|
2011-04-19 16:36:24 +00:00
|
|
|
%% allocate vp E E E
|
2011-04-18 16:32:22 +00:00
|
|
|
|
|
|
|
vop_allocate {
|
|
|
|
IN struct vnode *vp;
|
2011-05-13 14:29:28 +00:00
|
|
|
INOUT off_t *offset;
|
|
|
|
INOUT off_t *len;
|
2011-04-18 16:32:22 +00:00
|
|
|
};
|
2011-11-04 04:02:50 +00:00
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2011-11-04 04:02:50 +00:00
|
|
|
%% advise vp U U U
|
|
|
|
|
|
|
|
vop_advise {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN off_t start;
|
|
|
|
IN off_t end;
|
|
|
|
IN int advice;
|
|
|
|
};
|
2012-01-06 20:06:45 +00:00
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2012-02-29 21:38:31 +00:00
|
|
|
%% unp_bind vp E E E
|
|
|
|
|
|
|
|
vop_unp_bind {
|
|
|
|
IN struct vnode *vp;
|
2017-06-02 17:31:25 +00:00
|
|
|
IN struct unpcb *unpcb;
|
2012-02-29 21:38:31 +00:00
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2012-02-29 21:38:31 +00:00
|
|
|
%% unp_connect vp L L L
|
|
|
|
|
|
|
|
vop_unp_connect {
|
|
|
|
IN struct vnode *vp;
|
2017-06-02 17:31:25 +00:00
|
|
|
OUT struct unpcb **unpcb;
|
2012-02-29 21:38:31 +00:00
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2012-02-29 21:38:31 +00:00
|
|
|
%% unp_detach vp = = =
|
|
|
|
|
|
|
|
vop_unp_detach {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2012-09-28 11:25:02 +00:00
|
|
|
%% is_text vp L L L
|
|
|
|
|
|
|
|
vop_is_text {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
Switch to use shared vnode locks for text files during image activation.
kern_execve() locks text vnode exclusive to be able to set and clear
VV_TEXT flag. VV_TEXT is mutually exclusive with the v_writecount > 0
condition.
The change removes VV_TEXT, replacing it with the condition
v_writecount <= -1, and puts v_writecount under the vnode interlock.
Each text reference decrements v_writecount. To clear the text
reference when the segment is unmapped, it is recorded in the
vm_map_entry backed by the text file as MAP_ENTRY_VN_TEXT flag, and
v_writecount is incremented on the map entry removal
The operations like VOP_ADD_WRITECOUNT() and VOP_SET_TEXT() check that
v_writecount does not contradict the desired change. vn_writecheck()
is now racy and its use was eliminated everywhere except access.
Atomic check for writeability and increment of v_writecount is
performed by the VOP. vn_truncate() now increments v_writecount
around VOP_SETATTR() call, lack of which is arguably a bug on its own.
nullfs bypasses v_writecount to the lower vnode always, so nullfs
vnode has its own v_writecount correct, and lower vnode gets all
references, since object->handle is always lower vnode.
On the text vnode' vm object dealloc, the v_writecount value is reset
to zero, and deadfs vop_unset_text short-circuit the operation.
Reclamation of lowervp always reclaims all nullfs vnodes referencing
lowervp first, so no stray references are left.
Reviewed by: markj, trasz
Tested by: mjg, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D19923
2019-05-05 11:20:43 +00:00
|
|
|
%% set_text vp = = =
|
2012-09-28 11:25:02 +00:00
|
|
|
|
|
|
|
vop_set_text {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2019-08-18 20:24:52 +00:00
|
|
|
%% vop_unset_text vp L L L
|
2012-09-28 11:25:02 +00:00
|
|
|
|
|
|
|
vop_unset_text {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
Switch to use shared vnode locks for text files during image activation.
kern_execve() locks text vnode exclusive to be able to set and clear
VV_TEXT flag. VV_TEXT is mutually exclusive with the v_writecount > 0
condition.
The change removes VV_TEXT, replacing it with the condition
v_writecount <= -1, and puts v_writecount under the vnode interlock.
Each text reference decrements v_writecount. To clear the text
reference when the segment is unmapped, it is recorded in the
vm_map_entry backed by the text file as MAP_ENTRY_VN_TEXT flag, and
v_writecount is incremented on the map entry removal
The operations like VOP_ADD_WRITECOUNT() and VOP_SET_TEXT() check that
v_writecount does not contradict the desired change. vn_writecheck()
is now racy and its use was eliminated everywhere except access.
Atomic check for writeability and increment of v_writecount is
performed by the VOP. vn_truncate() now increments v_writecount
around VOP_SETATTR() call, lack of which is arguably a bug on its own.
nullfs bypasses v_writecount to the lower vnode always, so nullfs
vnode has its own v_writecount correct, and lower vnode gets all
references, since object->handle is always lower vnode.
On the text vnode' vm object dealloc, the v_writecount value is reset
to zero, and deadfs vop_unset_text short-circuit the operation.
Reclamation of lowervp always reclaims all nullfs vnodes referencing
lowervp first, so no stray references are left.
Reviewed by: markj, trasz
Tested by: mjg, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D19923
2019-05-05 11:20:43 +00:00
|
|
|
%% add_writecount vp L L L
|
2012-11-02 13:56:36 +00:00
|
|
|
|
|
|
|
vop_add_writecount {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN int inc;
|
|
|
|
};
|
|
|
|
|
2016-08-27 18:12:42 +00:00
|
|
|
|
2016-08-15 19:08:51 +00:00
|
|
|
%% fdatasync vp L L L
|
|
|
|
|
|
|
|
vop_fdatasync {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
IN struct thread *td;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-07-25 05:46:16 +00:00
|
|
|
%% copy_file_range invp U U U
|
|
|
|
%% copy_file_range outvp U U U
|
|
|
|
|
|
|
|
vop_copy_file_range {
|
|
|
|
IN struct vnode *invp;
|
|
|
|
INOUT off_t *inoffp;
|
|
|
|
IN struct vnode *outvp;
|
|
|
|
INOUT off_t *outoffp;
|
|
|
|
INOUT size_t *lenp;
|
|
|
|
IN unsigned int flags;
|
|
|
|
IN struct ucred *incred;
|
|
|
|
IN struct ucred *outcred;
|
|
|
|
IN struct thread *fsizetd;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-01-06 20:06:45 +00:00
|
|
|
# The VOPs below are spares at the end of the table to allow new VOPs to be
|
|
|
|
# added in stable branches without breaking the KBI. New VOPs in HEAD should
|
|
|
|
# be added above these spares. When merging a new VOP to a stable branch,
|
|
|
|
# the new VOP should replace one of the spares.
|
|
|
|
|
|
|
|
vop_spare1 {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
|
|
|
vop_spare2 {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
|
|
|
vop_spare3 {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
|
|
|
vop_spare4 {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|
|
|
|
|
|
|
|
vop_spare5 {
|
|
|
|
IN struct vnode *vp;
|
|
|
|
};
|