Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147962493
D40848.1784937354.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D40848.1784937354.diff
View Options
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -748,7 +748,7 @@
}
static int
-compute_cn_lkflags(struct mount *mp, int lkflags, int cnflags)
+enforce_lkflags(struct mount *mp, int lkflags)
{
if (mp == NULL || ((lkflags & LK_SHARED) &&
@@ -815,9 +815,7 @@
cnp->cn_lkflags |= LK_EXCLUSIVE;
}
- vn_lock(dp,
- compute_cn_lkflags(mp, cnp->cn_lkflags | LK_RETRY,
- cnp->cn_flags));
+ vn_lock(dp, enforce_lkflags(mp, cnp->cn_lkflags | LK_RETRY));
if (dp->v_type != VDIR) {
error = ENOTDIR;
@@ -1009,8 +1007,7 @@
* we adjust based on the requesting flags.
*/
vn_lock(dp,
- compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags | LK_RETRY,
- cnp->cn_flags));
+ enforce_lkflags(dp->v_mount, cnp->cn_lkflags | LK_RETRY));
dirloop:
/*
@@ -1149,8 +1146,8 @@
VREF(dp);
vput(tdp);
vn_lock(dp,
- compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags |
- LK_RETRY, ISDOTDOT));
+ enforce_lkflags(dp->v_mount, cnp->cn_lkflags |
+ LK_RETRY));
error = nameicap_check_dotdot(ndp, dp);
if (error != 0) {
capdotdot:
@@ -1196,8 +1193,7 @@
vn_printf(dp, "lookup in ");
#endif
lkflags_save = cnp->cn_lkflags;
- cnp->cn_lkflags = compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags,
- cnp->cn_flags);
+ cnp->cn_lkflags = enforce_lkflags(dp->v_mount, cnp->cn_lkflags);
error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp);
cnp->cn_lkflags = lkflags_save;
if (error != 0) {
@@ -1213,8 +1209,8 @@
VREF(dp);
vput(tdp);
vn_lock(dp,
- compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags |
- LK_RETRY, cnp->cn_flags));
+ enforce_lkflags(dp->v_mount, cnp->cn_lkflags |
+ LK_RETRY));
nameicap_tracker_add(ndp, dp);
goto unionlookup;
}
@@ -1303,8 +1299,7 @@
KASSERT(mp != NULL,
("%s: NULL mountpoint for VIRF_MOUNTPOINT vnode", __func__));
crosslock = (dp->v_vflag & VV_CROSSLOCK) != 0;
- crosslkflags = compute_cn_lkflags(mp, cnp->cn_lkflags,
- cnp->cn_flags);
+ crosslkflags = enforce_lkflags(mp, cnp->cn_lkflags);
if (__predict_false(crosslock)) {
/*
* We are going to be holding the vnode lock, which
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 11:55 PM (4 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29250988
Default Alt Text
D40848.1784937354.diff (2 KB)
Attached To
Mode
D40848: VFS lookup: compute_lk_cnflags(): Remove unused argument 'cnflags'; Rename
Attached
Detach File
Event Timeline
Log In to Comment