From owner-dev-commits-src-all@freebsd.org Tue Aug 3 09:52:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5E5A6347C5; Tue, 3 Aug 2021 09:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9Cc4NBKz3NRx; Tue, 3 Aug 2021 09:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EF0A10E74; Tue, 3 Aug 2021 09:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1739qigV081279; Tue, 3 Aug 2021 09:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1739qiV3081278; Tue, 3 Aug 2021 09:52:44 GMT (envelope-from git) Date: Tue, 3 Aug 2021 09:52:44 GMT Message-Id: <202108030952.1739qiV3081278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 75e8553e7908 - stable/13 - null_bypass(): some style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75e8553e790877b1339597bbf7f880399392d724 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 09:52:44 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=75e8553e790877b1339597bbf7f880399392d724 commit 75e8553e790877b1339597bbf7f880399392d724 Author: Konstantin Belousov AuthorDate: 2021-07-20 00:48:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-03 09:52:35 +0000 null_bypass(): some style (cherry picked from commit 7b7227c4a601d92a46cf625ca7ae245664a809fe) --- sys/fs/nullfs/null_vnops.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 3b4e30d8a499..29be2a34614c 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -223,13 +223,12 @@ int null_bypass(struct vop_generic_args *ap) { struct vnode **this_vp_p; - int error; struct vnode *old_vps[VDESC_MAX_VPS]; struct vnode **vps_p[VDESC_MAX_VPS]; struct vnode ***vppp; struct vnode *lvp; struct vnodeop_desc *descp = ap->a_desc; - int reles, i; + int error, i, reles; if (null_bug_bypass) printf ("null_bypass: %s\n", descp->vdesc_name); @@ -252,26 +251,28 @@ null_bypass(struct vop_generic_args *ap) for (i = 0; i < VDESC_MAX_VPS; reles >>= 1, i++) { if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ - vps_p[i] = this_vp_p = - VOPARG_OFFSETTO(struct vnode**,descp->vdesc_vp_offsets[i],ap); + vps_p[i] = this_vp_p = VOPARG_OFFSETTO(struct vnode **, + descp->vdesc_vp_offsets[i], ap); + /* * We're not guaranteed that any but the first vnode * are of our type. Check for and don't map any * that aren't. (We must always map first vp or vclean fails.) */ - if (i && (*this_vp_p == NULLVP || + if (i != 0 && (*this_vp_p == NULLVP || (*this_vp_p)->v_op != &null_vnodeops)) { old_vps[i] = NULLVP; } else { old_vps[i] = *this_vp_p; *(vps_p[i]) = NULLVPTOLOWERVP(*this_vp_p); + /* * XXX - Several operations have the side effect * of vrele'ing their vp's. We must account for * that. (This should go away in the future.) */ if (reles & VDESC_VP0_WILLRELE) - VREF(*this_vp_p); + vref(*this_vp_p); } } @@ -279,9 +280,9 @@ null_bypass(struct vop_generic_args *ap) * Call the operation on the lower layer * with the modified argument structure. */ - if (vps_p[0] && *vps_p[0]) + if (vps_p[0] != NULL && *vps_p[0] != NULL) { error = VCALL(ap); - else { + } else { printf("null_bypass: no map for %s\n", descp->vdesc_name); error = EINVAL; } @@ -295,7 +296,7 @@ null_bypass(struct vop_generic_args *ap) for (i = 0; i < VDESC_MAX_VPS; reles >>= 1, i++) { if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ - if (old_vps[i]) { + if (old_vps[i] != NULL) { lvp = *(vps_p[i]); /* @@ -328,17 +329,18 @@ null_bypass(struct vop_generic_args *ap) * (Assumes that the lower layer always returns * a VREF'ed vpp unless it gets an error.) */ - if (descp->vdesc_vpp_offset != VDESC_NO_OFFSET && !error) { + if (descp->vdesc_vpp_offset != VDESC_NO_OFFSET && error == 0) { /* * XXX - even though some ops have vpp returned vp's, * several ops actually vrele this before returning. * We must avoid these ops. * (This should go away when these ops are regularized.) */ - vppp = VOPARG_OFFSETTO(struct vnode***, - descp->vdesc_vpp_offset,ap); - if (*vppp) - error = null_nodeget(old_vps[0]->v_mount, **vppp, *vppp); + vppp = VOPARG_OFFSETTO(struct vnode ***, + descp->vdesc_vpp_offset, ap); + if (*vppp != NULL) + error = null_nodeget(old_vps[0]->v_mount, **vppp, + *vppp); } return (error);