From nobody Sat Nov 16 01:41:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XqxSL3kHYz5cbss; Sat, 16 Nov 2024 01:41:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XqxSL3115z4HMp; Sat, 16 Nov 2024 01:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731721282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vokEFAeW3pDb3jp736Yn5uYkCj9h25c6zWoL+KCn4Zw=; b=XivLQLLtDUpsed02wKwGWfXJRXxg6YtnvKeKr1aA7NpNzlx8HvNznSC9jdliQZKMM/1NAJ quRUPGHWLsLChUoIxUEX/ygpUytPm/tr9rJdoVLSRDhVqw1Ms587A9dK6Jxtd+/OYUX9xB na0GVfF5woWXco3hGHh4UJiyMR+bUJgz245TCuO1b9YKYA+2rJAsto0GAxajCQM3AJsrHQ VWtR3/JGT7s6X1vkJLvM164LlYDuAn/gSFNRX+GD63f+tpzAlQvC+D9RaiVl8dmLFOH/nh qfhblDSedHISsTAuTIfznNghFuVEtzXRez36AhSaCCcXnPP+mzwsSm3w5wdz1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731721282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vokEFAeW3pDb3jp736Yn5uYkCj9h25c6zWoL+KCn4Zw=; b=KkmtpkSvsUDjyMybhT69aje4zUTh+69AulbPETcK8HGTOpu4ynlW1vtfVoxh5+YLV+nutg xyUhVKA8BGG86lnmlFavE1cQsg6XSgUyRNBO4ZmZ0c/Z5F+vvM+Y6Yos3+lZ5cCFkJN59i DFb/O52b13vh7JG+LfhJFxOuqvUIfdtx915kYOf0hi7zaIfFnx9pGsrIpCCTKCu+rfW4IU R9G+SJSfswgM8p4PTKOtYYGYdNcqnB122vxRh4IzL1xsCM/BlOo2im1v4Fs2JxOgooSiEM GOyHZ+ZSgBgilljGBi6iI4puHKcRSLaD8QjhUO02gEdAa+sumbV0ouCTB89/DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731721282; a=rsa-sha256; cv=none; b=nkqZgo8KPiQ3WjT3ok/ictPL+ZOCL5aGR0w6zBBKNT2qIsO5E7kHlfk8277Iy7lKWfdmCP czn/4gWyZqBHucvZbw2A8E+hk5FtG6p+1IrQFy9oBZV+YYJqNnVTUZQJ0vSWJ/MfUmGNMH ThEP2jjO96sSIxdPwFj21W1IFfCylgK9QiX/Joqf4pDJS/vWcG8k9U8C1yxJgPAeX5V+WW qME93aJd4GSe5pyjvrvn3hGwVz4ucFOs6k+qt1K3LfcsUw163FRlESOWhCeML/g/7JSjjX LrAIOJD/TlTUaUAZn0RC3A3gx4oKAgabLJ3Sk+1ke2vi/flY8CXD7EO4X1W1IQ== 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 4XqxSL2cFRznNH; Sat, 16 Nov 2024 01:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AG1fMMv084392; Sat, 16 Nov 2024 01:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AG1fMZf084389; Sat, 16 Nov 2024 01:41:22 GMT (envelope-from git) Date: Sat, 16 Nov 2024 01:41:22 GMT Message-Id: <202411160141.4AG1fMZf084389@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: 9d9a14c5b612 - stable/14 - bufwrite(): style List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 9d9a14c5b612f6e63781be47a8428556b9fbee30 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9d9a14c5b612f6e63781be47a8428556b9fbee30 commit 9d9a14c5b612f6e63781be47a8428556b9fbee30 Author: Konstantin Belousov AuthorDate: 2024-11-12 06:22:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-16 01:07:33 +0000 bufwrite(): style (cherry picked from commit c1d93f81e49c5c32262eefcd087b9c5582e0f83c) --- sys/kern/vfs_bio.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 1b55c523c436..7b483b003cac 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2299,10 +2299,10 @@ breadn_flags(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int bufwrite(struct buf *bp) { - int oldflags; struct vnode *vp; long space; - int vp_md; + int oldflags, retval; + bool vp_md; CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); if ((bp->b_bufobj->bo_flag & BO_DEAD) != 0) { @@ -2311,24 +2311,21 @@ bufwrite(struct buf *bp) brelse(bp); return (ENXIO); } - if (bp->b_flags & B_INVAL) { + if ((bp->b_flags & B_INVAL) != 0) { brelse(bp); return (0); } - if (bp->b_flags & B_BARRIER) + if ((bp->b_flags & B_BARRIER) != 0) atomic_add_long(&barrierwrites, 1); oldflags = bp->b_flags; - KASSERT(!(bp->b_vflags & BV_BKGRDINPROG), + KASSERT((bp->b_vflags & BV_BKGRDINPROG) == 0, ("FFS background buffer should not get here %p", bp)); vp = bp->b_vp; - if (vp) - vp_md = vp->v_vflag & VV_MD; - else - vp_md = 0; + vp_md = vp != NULL && (vp->v_vflag & VV_MD) != 0; /* * Mark the buffer clean. Increment the bufobj write count @@ -2360,19 +2357,19 @@ bufwrite(struct buf *bp) } #endif /* RACCT */ curthread->td_ru.ru_oublock++; - if (oldflags & B_ASYNC) + if ((oldflags & B_ASYNC) != 0) BUF_KERNPROC(bp); bp->b_iooffset = dbtob(bp->b_blkno); buf_track(bp, __func__); bstrategy(bp); if ((oldflags & B_ASYNC) == 0) { - int rtval = bufwait(bp); + retval = bufwait(bp); brelse(bp); - return (rtval); + return (retval); } else if (space > hirunningspace) { /* - * don't allow the async write to saturate the I/O + * Don't allow the async write to saturate the I/O * system. We will not deadlock here because * we are blocking waiting for I/O that is already in-progress * to complete. We do not block here if it is the update