Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111648370
D23916.id69144.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D23916.id69144.diff
View Options
Index: sys/kern/vfs_cache.c
===================================================================
--- sys/kern/vfs_cache.c
+++ sys/kern/vfs_cache.c
@@ -2950,10 +2950,6 @@
cache_fpl_unhandled(fpl);
return (false);
}
- if ((cnp->cn_flags & LOCKLEAF) == 0) {
- cache_fpl_unhandled(fpl);
- return (false);
- }
if (cnp->cn_nameiop != LOOKUP) {
cache_fpl_unhandled(fpl);
return (false);
@@ -3028,15 +3024,20 @@
return (cache_fpl_unhandled(fpl));
}
- MPASS((cnp->cn_flags & LOCKLEAF) != 0);
+ if ((cnp->cn_flags & LOCKLEAF) != 0)
+ error = vget_finish(tvp, cnp->cn_lkflags, tvs);
+ else
+ error = vget_finish_ref(tvp, tvs);
- error = vget_finish(tvp, cnp->cn_lkflags, tvs);
if (error != 0) {
return (cache_fpl_unhandled(fpl));
}
if (!seqc_consistent(&tvp->v_seqc, tvp_seqc)) {
- vput(tvp);
+ if ((cnp->cn_flags & LOCKLEAF) != 0)
+ vput(tvp);
+ else
+ vrele(tvp);
return (cache_fpl_unhandled(fpl));
}
Index: sys/kern/vfs_subr.c
===================================================================
--- sys/kern/vfs_subr.c
+++ sys/kern/vfs_subr.c
@@ -2954,7 +2954,7 @@
int
vget_finish(struct vnode *vp, int flags, enum vgetstate vs)
{
- int error, old;
+ int error;
if ((flags & LK_INTERLOCK) != 0)
ASSERT_VI_LOCKED(vp, __func__);
@@ -2971,6 +2971,17 @@
vp);
return (error);
}
+ return (vget_finish_ref(vp, vs));
+}
+
+int
+vget_finish_ref(struct vnode *vp, enum vgetstate vs)
+{
+ int old;
+
+ VNPASS(vs == VGET_HOLDCNT || vs == VGET_USECOUNT, vp);
+ VNPASS(vp->v_holdcnt > 0, vp);
+ VNPASS(vs == VGET_HOLDCNT || vp->v_usecount > 0, vp);
if (vs == VGET_USECOUNT)
return (0);
Index: sys/sys/vnode.h
===================================================================
--- sys/sys/vnode.h
+++ sys/sys/vnode.h
@@ -689,6 +689,7 @@
enum vgetstate vget_prep_smr(struct vnode *vp);
enum vgetstate vget_prep(struct vnode *vp);
int vget_finish(struct vnode *vp, int flags, enum vgetstate vs);
+int vget_finish_ref(struct vnode *vp, enum vgetstate vs);
void vget_abort(struct vnode *vp, enum vgetstate vs);
void vgone(struct vnode *vp);
void vhold(struct vnode *);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 12:07 PM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17031636
Default Alt Text
D23916.id69144.diff (2 KB)
Attached To
Mode
D23916: (lookup 7) vfs: add support for !LOCKLEAF to lockless lookup
Attached
Detach File
Event Timeline
Log In to Comment