From nobody Wed Jul 17 21:45:38 2024 X-Original-To: dev-commits-src-all@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 4WPTyC1FHrz5QSRr; Wed, 17 Jul 2024 21:45:39 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WPTyC0lMMz4nFf; Wed, 17 Jul 2024 21:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721252739; 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=Mr0fTzNS7e8gT5Krj5FxrzEX2JbldNFp81I95DejKHs=; b=LSrvJH2DENDt+fRlo6uplka0j5DhFg/6o46aIKhkP7qDVRL3pdc+1rJknKj2Iu1CMInreu EdtzRWTzVBvZL7qiFCKtTdy43JHTXorWEBcda85aUv23bT8QYcqkwznZCfp/nLde27+sww MZyAeccaCiJOk/HQ7geQC/wsS7l+lvBv9pKGALXORIMw1ZurWQ9w9Rgyl9gyQ4/ewepwXw cDTQpySVMNd3nvGp3ooO7mB0aaoMnG78KGBpyk0vtcgyPfTrjEzNA196CcsPIP/bttCcwu nN/iDBGa0mptymWk9K8ic22x4Vmv6hJFpUo6aHPBbQEvcmezAOfggPamBo24jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721252739; a=rsa-sha256; cv=none; b=AkaubuawqmmIV8bZYyvrEGjbFfRhkwFPO9VARiZmRY2jCr8YNfF5N8EiLf0k9k5QSoSqzU yt3Oq27AOYggSDotKiRMHAbHmWatWSG9ziIydPo3vuQc5/1Y32L7qHAsfILS8OS6IcEqXy +liThmnrkmqihKLKMrq1mBu58Cd709fFPyfLJUqtdv7yT/2nM55hamoMWjoZvgtnOf41wE cDUrV2ZqLixEFL3Wvu2TNquFGHWuJ4KRCDiqUuQk6M7iAksopZA0TR8JHs3Pi040ZrzFKu sm/9jlOj2xgGPIzJduSvAIg3QW0OPDEUb7oj+k9I6/hERS1lqN6SJ94yTYchAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721252739; 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=Mr0fTzNS7e8gT5Krj5FxrzEX2JbldNFp81I95DejKHs=; b=CFzRvUTWnPvDe+a4gFc6JfqodS2NbQyuP4yjIKh8SMPzwB0KaBofPh7rJSIFSZOjsYlyP5 jQ9AJy9OT7I5dQopyMPlA7gbCd6sBVJnuQ55gjN4MSg+KyiynPtKHJwaYt8SiJ1NUpsPtW KGnEs0GCDelcruppLcHnozBdr9Xrc1YLOi3uThF3ZjgZAcsQeVy8MVuFtjuyCr4uiZemmP mPPegDbf78+Njy08ZZzUV60IGejtMYUX4n4sPg/1aDfL5Ghwpj1xEXzI64f3/P/AGM0Jsh jPBxf8DOQY44gUQLOCmHb/44s3buc2aRACbkk4NHf6hK+yRtrXhiTNZ4GMSBAA== 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 4WPTyC0LVpzL9g; Wed, 17 Jul 2024 21:45:39 +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 46HLjcxL079915; Wed, 17 Jul 2024 21:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46HLjcJp079912; Wed, 17 Jul 2024 21:45:38 GMT (envelope-from git) Date: Wed, 17 Jul 2024 21:45:38 GMT Message-Id: <202407172145.46HLjcJp079912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a4469a0d19b6 - main - pipe: convert pipelock flag argument to bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4469a0d19b64bf518c12e8c24c81ec513a45e7d Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a4469a0d19b64bf518c12e8c24c81ec513a45e7d commit a4469a0d19b64bf518c12e8c24c81ec513a45e7d Author: Mateusz Guzik AuthorDate: 2024-07-17 19:07:07 +0000 Commit: Mateusz Guzik CommitDate: 2024-07-17 21:45:32 +0000 pipe: convert pipelock flag argument to bool No functional changes, preparatory cleanup. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/sys_pipe.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 1d48728139c2..70b2a03e0140 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -225,7 +225,7 @@ static void pipeclose(struct pipe *cpipe); static void pipe_free_kmem(struct pipe *cpipe); static int pipe_create(struct pipe *pipe, bool backing); static int pipe_paircreate(struct thread *td, struct pipepair **p_pp); -static __inline int pipelock(struct pipe *cpipe, int catch); +static __inline int pipelock(struct pipe *cpipe, bool catch); static __inline void pipeunlock(struct pipe *cpipe); static void pipe_timestamp(struct timespec *tsp); #ifndef PIPE_NODIRECT @@ -633,7 +633,7 @@ pipespace(struct pipe *cpipe, int size) * lock a pipe for I/O, blocking other access */ static __inline int -pipelock(struct pipe *cpipe, int catch) +pipelock(struct pipe *cpipe, bool catch) { int error, prio; @@ -738,7 +738,7 @@ pipe_read(struct file *fp, struct uio *uio, struct ucred *active_cred, PIPE_LOCK(rpipe); ++rpipe->pipe_busy; - error = pipelock(rpipe, 1); + error = pipelock(rpipe, true); if (error) goto unlocked_error; @@ -854,7 +854,7 @@ pipe_read(struct file *fp, struct uio *uio, struct ucred *active_cred, if ((error = msleep(rpipe, PIPE_MTX(rpipe), PRIBIO | PCATCH, "piperd", 0)) == 0) - error = pipelock(rpipe, 1); + error = pipelock(rpipe, true); } if (error) goto unlocked_error; @@ -1034,7 +1034,7 @@ retry: pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdww", 0); - pipelock(wpipe, 0); + pipelock(wpipe, false); if (error != 0) goto error1; goto retry; @@ -1049,7 +1049,7 @@ retry: pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwc", 0); - pipelock(wpipe, 0); + pipelock(wpipe, false); if (error != 0) goto error1; goto retry; @@ -1071,7 +1071,7 @@ retry: pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwt", 0); - pipelock(wpipe, 0); + pipelock(wpipe, false); if (error != 0) break; } @@ -1107,7 +1107,7 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, rpipe = fp->f_data; wpipe = PIPE_PEER(rpipe); PIPE_LOCK(rpipe); - error = pipelock(wpipe, 1); + error = pipelock(wpipe, true); if (error) { PIPE_UNLOCK(rpipe); return (error); @@ -1206,7 +1206,7 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(rpipe), PRIBIO | PCATCH, "pipbww", 0); - pipelock(wpipe, 0); + pipelock(wpipe, false); if (error != 0) break; continue; @@ -1311,7 +1311,7 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(rpipe), PRIBIO | PCATCH, "pipewr", 0); - pipelock(wpipe, 0); + pipelock(wpipe, false); if (error != 0) break; continue; @@ -1671,7 +1671,7 @@ pipeclose(struct pipe *cpipe) KASSERT(cpipe != NULL, ("pipeclose: cpipe == NULL")); PIPE_LOCK(cpipe); - pipelock(cpipe, 0); + pipelock(cpipe, false); #ifdef MAC pp = cpipe->pipe_pair; #endif @@ -1686,7 +1686,7 @@ pipeclose(struct pipe *cpipe) cpipe->pipe_state |= PIPE_WANT; pipeunlock(cpipe); msleep(cpipe, PIPE_MTX(cpipe), PRIBIO, "pipecl", 0); - pipelock(cpipe, 0); + pipelock(cpipe, false); } pipeselwakeup(cpipe);