mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
Introduce vop_stdinactive() and make it the default if no vop_inactive
is declared. Sort and prune a few vop_op[].
This commit is contained in:
parent
81703d7fac
commit
39f70682ae
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64819
@ -71,7 +71,6 @@ static int fifo_read __P((struct vop_read_args *));
|
||||
static int fifo_write __P((struct vop_write_args *));
|
||||
static int fifo_ioctl __P((struct vop_ioctl_args *));
|
||||
static int fifo_poll __P((struct vop_poll_args *));
|
||||
static int fifo_inactive __P((struct vop_inactive_args *));
|
||||
static int fifo_bmap __P((struct vop_bmap_args *));
|
||||
static int fifo_pathconf __P((struct vop_pathconf_args *));
|
||||
static int fifo_advlock __P((struct vop_advlock_args *));
|
||||
@ -97,7 +96,7 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
{ &vop_close_desc, (vop_t *) fifo_close },
|
||||
{ &vop_create_desc, (vop_t *) fifo_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) vop_ebadf },
|
||||
{ &vop_inactive_desc, (vop_t *) fifo_inactive },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_ioctl_desc, (vop_t *) fifo_ioctl },
|
||||
{ &vop_lease_desc, (vop_t *) vop_null },
|
||||
{ &vop_link_desc, (vop_t *) fifo_badop },
|
||||
@ -107,7 +106,6 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
{ &vop_open_desc, (vop_t *) fifo_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) fifo_pathconf },
|
||||
{ &vop_poll_desc, (vop_t *) fifo_poll },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_print_desc, (vop_t *) fifo_print },
|
||||
{ &vop_read_desc, (vop_t *) fifo_read },
|
||||
{ &vop_readdir_desc, (vop_t *) fifo_badop },
|
||||
@ -458,18 +456,6 @@ fifo_poll(ap)
|
||||
return (revents);
|
||||
}
|
||||
|
||||
static int
|
||||
fifo_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a noop, simply returning what one has been given.
|
||||
*/
|
||||
|
@ -69,7 +69,6 @@ static int portal_badop __P((void));
|
||||
static void portal_closefd __P((struct proc *p, int fd));
|
||||
static int portal_connect __P((struct socket *so, struct socket *so2));
|
||||
static int portal_getattr __P((struct vop_getattr_args *ap));
|
||||
static int portal_inactive __P((struct vop_inactive_args *ap));
|
||||
static int portal_lookup __P((struct vop_lookup_args *ap));
|
||||
static int portal_open __P((struct vop_open_args *ap));
|
||||
static int portal_print __P((struct vop_print_args *ap));
|
||||
@ -526,18 +525,6 @@ portal_readdir(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
portal_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
portal_reclaim(ap)
|
||||
struct vop_reclaim_args /* {
|
||||
@ -590,7 +577,6 @@ static struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) vop_null },
|
||||
{ &vop_bmap_desc, (vop_t *) portal_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) portal_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) portal_inactive },
|
||||
{ &vop_lookup_desc, (vop_t *) portal_lookup },
|
||||
{ &vop_open_desc, (vop_t *) portal_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
|
@ -67,7 +67,6 @@ static int procfs_badop __P((void));
|
||||
static int procfs_bmap __P((struct vop_bmap_args *));
|
||||
static int procfs_close __P((struct vop_close_args *));
|
||||
static int procfs_getattr __P((struct vop_getattr_args *));
|
||||
static int procfs_inactive __P((struct vop_inactive_args *));
|
||||
static int procfs_ioctl __P((struct vop_ioctl_args *));
|
||||
static int procfs_lookup __P((struct vop_lookup_args *));
|
||||
static int procfs_open __P((struct vop_open_args *));
|
||||
@ -335,28 +334,6 @@ procfs_bmap(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* procfs_inactive is called when the pfsnode
|
||||
* is vrele'd and the reference count goes
|
||||
* to zero. (vp) will be on the vnode free
|
||||
* list, so to get it back vget() must be
|
||||
* used.
|
||||
*
|
||||
* (vp) is locked on entry, but must be unlocked on exit.
|
||||
*/
|
||||
static int
|
||||
procfs_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
VOP_UNLOCK(vp, 0, ap->a_p);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* _reclaim is called when getnewvnode()
|
||||
* wants to make use of an entry on the vnode
|
||||
@ -1014,7 +991,6 @@ static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
|
||||
{ &vop_close_desc, (vop_t *) procfs_close },
|
||||
{ &vop_create_desc, (vop_t *) procfs_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) procfs_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) procfs_inactive },
|
||||
{ &vop_link_desc, (vop_t *) procfs_badop },
|
||||
{ &vop_lookup_desc, (vop_t *) procfs_lookup },
|
||||
{ &vop_mkdir_desc, (vop_t *) procfs_badop },
|
||||
|
@ -59,7 +59,6 @@ static int spec_close __P((struct vop_close_args *));
|
||||
static int spec_freeblks __P((struct vop_freeblks_args *));
|
||||
static int spec_fsync __P((struct vop_fsync_args *));
|
||||
static int spec_getpages __P((struct vop_getpages_args *));
|
||||
static int spec_inactive __P((struct vop_inactive_args *));
|
||||
static int spec_ioctl __P((struct vop_ioctl_args *));
|
||||
static int spec_open __P((struct vop_open_args *));
|
||||
static int spec_poll __P((struct vop_poll_args *));
|
||||
@ -79,7 +78,7 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
{ &vop_freeblks_desc, (vop_t *) spec_freeblks },
|
||||
{ &vop_fsync_desc, (vop_t *) spec_fsync },
|
||||
{ &vop_getpages_desc, (vop_t *) spec_getpages },
|
||||
{ &vop_inactive_desc, (vop_t *) spec_inactive },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_ioctl_desc, (vop_t *) spec_ioctl },
|
||||
{ &vop_lease_desc, (vop_t *) vop_null },
|
||||
{ &vop_link_desc, (vop_t *) vop_panic },
|
||||
@ -88,7 +87,6 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
{ &vop_open_desc, (vop_t *) spec_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
{ &vop_poll_desc, (vop_t *) spec_poll },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_print_desc, (vop_t *) spec_print },
|
||||
{ &vop_read_desc, (vop_t *) spec_read },
|
||||
{ &vop_readdir_desc, (vop_t *) vop_panic },
|
||||
@ -391,18 +389,6 @@ spec_fsync(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
spec_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Just call the device strategy routine
|
||||
*/
|
||||
|
@ -68,6 +68,7 @@ static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
|
||||
{ &vop_bwrite_desc, (vop_t *) vop_stdbwrite },
|
||||
{ &vop_close_desc, (vop_t *) vop_null },
|
||||
{ &vop_fsync_desc, (vop_t *) vop_null },
|
||||
{ &vop_inactive_desc, (vop_t *) vop_stdinactive },
|
||||
{ &vop_ioctl_desc, (vop_t *) vop_enotty },
|
||||
{ &vop_islocked_desc, (vop_t *) vop_noislocked },
|
||||
{ &vop_lease_desc, (vop_t *) vop_null },
|
||||
@ -77,15 +78,9 @@ static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_einval },
|
||||
{ &vop_poll_desc, (vop_t *) vop_nopoll },
|
||||
{ &vop_readlink_desc, (vop_t *) vop_einval },
|
||||
{ &vop_reallocblks_desc, (vop_t *) vop_eopnotsupp },
|
||||
{ &vop_revoke_desc, (vop_t *) vop_revoke },
|
||||
{ &vop_strategy_desc, (vop_t *) vop_nostrategy },
|
||||
{ &vop_unlock_desc, (vop_t *) vop_nounlock },
|
||||
{ &vop_getacl_desc, (vop_t *) vop_eopnotsupp },
|
||||
{ &vop_setacl_desc, (vop_t *) vop_eopnotsupp },
|
||||
{ &vop_aclcheck_desc, (vop_t *) vop_eopnotsupp },
|
||||
{ &vop_getextattr_desc, (vop_t *) vop_eopnotsupp },
|
||||
{ &vop_setextattr_desc, (vop_t *) vop_eopnotsupp },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@ -271,6 +266,18 @@ vop_stdislocked(ap)
|
||||
return (lockstatus(l, ap->a_p));
|
||||
}
|
||||
|
||||
int
|
||||
vop_stdinactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true for select/poll.
|
||||
*/
|
||||
|
@ -1532,21 +1532,6 @@ devfs_fsync(struct vop_fsync_args *ap)
|
||||
splx(s);
|
||||
return (0);
|
||||
}
|
||||
/*
|
||||
*
|
||||
* struct vop_inactive_args {
|
||||
* struct vnode *a_vp;
|
||||
* struct proc *a_p;
|
||||
* }
|
||||
*/
|
||||
|
||||
static int
|
||||
devfs_inactive(struct vop_inactive_args *ap)
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Just call the device strategy routine
|
||||
@ -1964,7 +1949,6 @@ static struct vnodeopv_entry_desc devfs_vnodeop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) devfs_access },
|
||||
{ &vop_bmap_desc, (vop_t *) devfs_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) devfs_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) devfs_inactive },
|
||||
{ &vop_link_desc, (vop_t *) devfs_link },
|
||||
{ &vop_lookup_desc, (vop_t *) devfs_lookup },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
@ -1999,7 +1983,6 @@ static struct vnodeopv_entry_desc devfs_spec_vnodeop_entries[] = {
|
||||
{ &vop_fsync_desc, (vop_t *) devfs_fsync },
|
||||
{ &vop_getattr_desc, (vop_t *) devfs_getattr },
|
||||
{ &vop_getpages_desc, (vop_t *) devfs_getpages },
|
||||
{ &vop_inactive_desc, (vop_t *) devfs_inactive },
|
||||
{ &vop_ioctl_desc, (vop_t *) devfs_ioctl },
|
||||
{ &vop_lease_desc, (vop_t *) vop_null },
|
||||
{ &vop_link_desc, (vop_t *) devfs_badop },
|
||||
|
@ -71,7 +71,6 @@ static int fifo_read __P((struct vop_read_args *));
|
||||
static int fifo_write __P((struct vop_write_args *));
|
||||
static int fifo_ioctl __P((struct vop_ioctl_args *));
|
||||
static int fifo_poll __P((struct vop_poll_args *));
|
||||
static int fifo_inactive __P((struct vop_inactive_args *));
|
||||
static int fifo_bmap __P((struct vop_bmap_args *));
|
||||
static int fifo_pathconf __P((struct vop_pathconf_args *));
|
||||
static int fifo_advlock __P((struct vop_advlock_args *));
|
||||
@ -97,7 +96,7 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
{ &vop_close_desc, (vop_t *) fifo_close },
|
||||
{ &vop_create_desc, (vop_t *) fifo_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) vop_ebadf },
|
||||
{ &vop_inactive_desc, (vop_t *) fifo_inactive },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_ioctl_desc, (vop_t *) fifo_ioctl },
|
||||
{ &vop_lease_desc, (vop_t *) vop_null },
|
||||
{ &vop_link_desc, (vop_t *) fifo_badop },
|
||||
@ -107,7 +106,6 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
{ &vop_open_desc, (vop_t *) fifo_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) fifo_pathconf },
|
||||
{ &vop_poll_desc, (vop_t *) fifo_poll },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_print_desc, (vop_t *) fifo_print },
|
||||
{ &vop_read_desc, (vop_t *) fifo_read },
|
||||
{ &vop_readdir_desc, (vop_t *) fifo_badop },
|
||||
@ -458,18 +456,6 @@ fifo_poll(ap)
|
||||
return (revents);
|
||||
}
|
||||
|
||||
static int
|
||||
fifo_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a noop, simply returning what one has been given.
|
||||
*/
|
||||
|
@ -69,7 +69,6 @@ static int portal_badop __P((void));
|
||||
static void portal_closefd __P((struct proc *p, int fd));
|
||||
static int portal_connect __P((struct socket *so, struct socket *so2));
|
||||
static int portal_getattr __P((struct vop_getattr_args *ap));
|
||||
static int portal_inactive __P((struct vop_inactive_args *ap));
|
||||
static int portal_lookup __P((struct vop_lookup_args *ap));
|
||||
static int portal_open __P((struct vop_open_args *ap));
|
||||
static int portal_print __P((struct vop_print_args *ap));
|
||||
@ -526,18 +525,6 @@ portal_readdir(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
portal_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
portal_reclaim(ap)
|
||||
struct vop_reclaim_args /* {
|
||||
@ -590,7 +577,6 @@ static struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) vop_null },
|
||||
{ &vop_bmap_desc, (vop_t *) portal_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) portal_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) portal_inactive },
|
||||
{ &vop_lookup_desc, (vop_t *) portal_lookup },
|
||||
{ &vop_open_desc, (vop_t *) portal_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
|
@ -67,7 +67,6 @@ static int procfs_badop __P((void));
|
||||
static int procfs_bmap __P((struct vop_bmap_args *));
|
||||
static int procfs_close __P((struct vop_close_args *));
|
||||
static int procfs_getattr __P((struct vop_getattr_args *));
|
||||
static int procfs_inactive __P((struct vop_inactive_args *));
|
||||
static int procfs_ioctl __P((struct vop_ioctl_args *));
|
||||
static int procfs_lookup __P((struct vop_lookup_args *));
|
||||
static int procfs_open __P((struct vop_open_args *));
|
||||
@ -335,28 +334,6 @@ procfs_bmap(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* procfs_inactive is called when the pfsnode
|
||||
* is vrele'd and the reference count goes
|
||||
* to zero. (vp) will be on the vnode free
|
||||
* list, so to get it back vget() must be
|
||||
* used.
|
||||
*
|
||||
* (vp) is locked on entry, but must be unlocked on exit.
|
||||
*/
|
||||
static int
|
||||
procfs_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
VOP_UNLOCK(vp, 0, ap->a_p);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* _reclaim is called when getnewvnode()
|
||||
* wants to make use of an entry on the vnode
|
||||
@ -1014,7 +991,6 @@ static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
|
||||
{ &vop_close_desc, (vop_t *) procfs_close },
|
||||
{ &vop_create_desc, (vop_t *) procfs_badop },
|
||||
{ &vop_getattr_desc, (vop_t *) procfs_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) procfs_inactive },
|
||||
{ &vop_link_desc, (vop_t *) procfs_badop },
|
||||
{ &vop_lookup_desc, (vop_t *) procfs_lookup },
|
||||
{ &vop_mkdir_desc, (vop_t *) procfs_badop },
|
||||
|
@ -59,7 +59,6 @@ static int spec_close __P((struct vop_close_args *));
|
||||
static int spec_freeblks __P((struct vop_freeblks_args *));
|
||||
static int spec_fsync __P((struct vop_fsync_args *));
|
||||
static int spec_getpages __P((struct vop_getpages_args *));
|
||||
static int spec_inactive __P((struct vop_inactive_args *));
|
||||
static int spec_ioctl __P((struct vop_ioctl_args *));
|
||||
static int spec_open __P((struct vop_open_args *));
|
||||
static int spec_poll __P((struct vop_poll_args *));
|
||||
@ -79,7 +78,7 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
{ &vop_freeblks_desc, (vop_t *) spec_freeblks },
|
||||
{ &vop_fsync_desc, (vop_t *) spec_fsync },
|
||||
{ &vop_getpages_desc, (vop_t *) spec_getpages },
|
||||
{ &vop_inactive_desc, (vop_t *) spec_inactive },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_ioctl_desc, (vop_t *) spec_ioctl },
|
||||
{ &vop_lease_desc, (vop_t *) vop_null },
|
||||
{ &vop_link_desc, (vop_t *) vop_panic },
|
||||
@ -88,7 +87,6 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
{ &vop_open_desc, (vop_t *) spec_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
{ &vop_poll_desc, (vop_t *) spec_poll },
|
||||
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
|
||||
{ &vop_print_desc, (vop_t *) spec_print },
|
||||
{ &vop_read_desc, (vop_t *) spec_read },
|
||||
{ &vop_readdir_desc, (vop_t *) vop_panic },
|
||||
@ -391,18 +389,6 @@ spec_fsync(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
spec_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Just call the device strategy routine
|
||||
*/
|
||||
|
@ -608,6 +608,7 @@ void vfs_write_resume __P((struct mount *mp));
|
||||
void vfs_write_suspend __P((struct mount *mp));
|
||||
int vop_stdbwrite __P((struct vop_bwrite_args *ap));
|
||||
int vop_stdgetwritemount __P((struct vop_getwritemount_args *));
|
||||
int vop_stdinactive __P((struct vop_inactive_args *));
|
||||
int vop_stdislocked __P((struct vop_islocked_args *));
|
||||
int vop_stdlock __P((struct vop_lock_args *));
|
||||
int vop_stdunlock __P((struct vop_unlock_args *));
|
||||
|
Loading…
Reference in New Issue
Block a user