git: 362ff9867e9f - main - Revert rest of a5970a529c2d95271: use vrefact() when working on fp->f_vnode
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 15 Apr 2022 13:57:04 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=362ff9867e9f0856a0f24f91e5fc6b9b3ecff8e9
commit 362ff9867e9f0856a0f24f91e5fc6b9b3ecff8e9
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-04-13 23:39:57 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-04-15 13:56:20 +0000
Revert rest of a5970a529c2d95271: use vrefact() when working on fp->f_vnode
Now, since O_PATH-opened file descriptors use use references instead
of the hold references, vrefact() chahges from that revision can be
reverted.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34906
---
sys/kern/kern_descrip.c | 6 +++---
sys/kern/vfs_syscalls.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 740d777bcede..163864ddf752 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -3087,7 +3087,7 @@ fgetvp_lookup(int fd, struct nameidata *ndp, struct vnode **vpp)
error = ENOTDIR;
goto out_free;
}
- vref(vp);
+ vrefact(vp);
/*
* XXX does not check for VDIR, handled by namei_setup
*/
@@ -3537,7 +3537,7 @@ _fgetvp(struct thread *td, int fd, int flags, cap_rights_t *needrightsp,
error = EINVAL;
} else {
*vpp = fp->f_vnode;
- vref(*vpp);
+ vrefact(*vpp);
}
fdrop(fp, td);
@@ -3573,7 +3573,7 @@ fgetvp_rights(struct thread *td, int fd, cap_rights_t *needrightsp,
*havecaps = caps;
*vpp = fp->f_vnode;
- vref(*vpp);
+ vrefact(*vpp);
fdrop(fp, td);
return (0);
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index a41a12d08cf9..ccc14bdc0382 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -907,7 +907,7 @@ sys_fchdir(struct thread *td, struct fchdir_args *uap)
if (error != 0)
return (error);
vp = fp->f_vnode;
- vref(vp);
+ vrefact(vp);
fdrop(fp, td);
vn_lock(vp, LK_SHARED | LK_RETRY);
AUDIT_ARG_VNODE1(vp);