The branch main has been updated by mjg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5842f73dbc2a4408f63da37623096ddfb0c84bc1

commit 5842f73dbc2a4408f63da37623096ddfb0c84bc1
Author:     Olivier Certner <olce.free...@certner.fr>
AuthorDate: 2023-07-05 13:40:22 +0000
Commit:     Mateusz Guzik <m...@freebsd.org>
CommitDate: 2023-07-05 13:43:38 +0000

    vfs: compute_lk_cnflags(): Remove unused argument 'cnflags'; Rename
    
    Argument unused since commit 93a0ba8f4990785f.
    
    Rename it to enforce_lkflags(), which seems to more aptly describe what it 
does.
    
    [mjg: massaged the commit message a little]
    Reviewed by:    kib, markj
    Differential Revision:  https://reviews.freebsd.org/D40848
---
 sys/kern/vfs_lookup.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 73df48e96efe..44fc91c1bd11 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -748,7 +748,7 @@ out:
 }
 
 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 @@ vfs_lookup_degenerate(struct nameidata *ndp, struct vnode 
*dp, int wantparent)
                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 @@ vfs_lookup(struct nameidata *ndp)
         * 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 @@ dirloop:
                        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 @@ unionlookup:
        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 @@ unionlookup:
                        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 @@ good:
                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

Reply via email to