svn commit: r364272 - head/sys/fs/tmpfs
Mateusz Guzik
mjg at FreeBSD.org
Sun Aug 16 17:19:24 UTC 2020
Author: mjg
Date: Sun Aug 16 17:19:23 2020
New Revision: 364272
URL: https://svnweb.freebsd.org/changeset/base/364272
Log:
tmpfs: use vget_prep/vget_finish instead of vget + vnode
Modified:
head/sys/fs/tmpfs/tmpfs_subr.c
Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c Sun Aug 16 17:18:54 2020 (r364271)
+++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Aug 16 17:19:23 2020 (r364272)
@@ -588,6 +588,7 @@ tmpfs_alloc_vp(struct mount *mp, struct tmpfs_node *no
struct vnode **vpp)
{
struct vnode *vp;
+ enum vgetstate vs;
struct tmpfs_mount *tm;
vm_object_t object;
int error;
@@ -600,18 +601,15 @@ loop:
TMPFS_NODE_ASSERT_LOCKED(node);
if ((vp = node->tn_vnode) != NULL) {
MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0);
- VI_LOCK(vp);
if ((node->tn_type == VDIR && node->tn_dir.tn_parent == NULL) ||
(VN_IS_DOOMED(vp) &&
(lkflag & LK_NOWAIT) != 0)) {
- VI_UNLOCK(vp);
TMPFS_NODE_UNLOCK(node);
error = ENOENT;
vp = NULL;
goto out;
}
if (VN_IS_DOOMED(vp)) {
- VI_UNLOCK(vp);
node->tn_vpstate |= TMPFS_VNODE_WRECLAIM;
while ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) {
msleep(&node->tn_vnode, TMPFS_NODE_MTX(node),
@@ -619,8 +617,9 @@ loop:
}
goto loop;
}
+ vs = vget_prep(vp);
TMPFS_NODE_UNLOCK(node);
- error = vget(vp, lkflag | LK_INTERLOCK);
+ error = vget_finish(vp, lkflag, vs);
if (error == ENOENT) {
TMPFS_NODE_LOCK(node);
goto loop;
More information about the svn-src-all
mailing list