From nobody Thu Mar 17 19:40:13 2022 X-Original-To: dev-commits-src-main@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 EC4771A26A24; Thu, 17 Mar 2022 19:40:13 +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 4KKHY95HnDz3Gd4; Thu, 17 Mar 2022 19:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647546013; 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=CkW4UgDTqn7jyDGzVh3ZFSlFpPBEyD97w1wbeFkjyR8=; b=YYLBxpjTCUu5aHA9UBjUNGLUH8nVkSIzAvVONAIWvxUYPPk7y/UPUAWMso+3IEjsf2hyLm avIeYrKnj5eLdv+pyq6DyPoK0dfDxmOJQ2xcq4p8fYfhx1PQxGOvE9nmvkzpnODtNP59la B9i8fDP5bkKouJ4Rl7Aogt2CdeZ3DM3wK8lvZCCuTX/56uiE+HbWJtWhZ2p0c70lefpT9s 2q5GrnxuVMCtavo4VgpmvELONfW5eVH5BjK1oUXx+1dA7CMzigrtfJc0UtQ6bod2cGbiXy mXNbnNs1sp1g5oYdprmR6kSMkUDBU6k/N+7JvewtZ8xkVUykjU+CR4RXMU5gqw== 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 95B96105E3; Thu, 17 Mar 2022 19:40:13 +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 22HJeDqW066842; Thu, 17 Mar 2022 19:40:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22HJeD1X066835; Thu, 17 Mar 2022 19:40:13 GMT (envelope-from git) Date: Thu, 17 Mar 2022 19:40:13 GMT Message-Id: <202203171940.22HJeD1X066835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fc7e121d88d6 - main - file: Move FILEDESC_FOREACH macros to kern_descrip.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc7e121d88d65aabbb8ce87d8e1d13e3c3cf18eb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647546013; 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=CkW4UgDTqn7jyDGzVh3ZFSlFpPBEyD97w1wbeFkjyR8=; b=x7UbB8woUgG4+6ltM40Uon64KeRMu+vvZMGllPdf66A2MuYOXUGxVvcVXoSOJ0AcVa8hzX U0Rg/26m9uF0joZcpwb2L5ROGKu09bBD2t0wX72R7nQ6fPRrQipPfPL6w6wwCZWimODExp Lnif8zz829z/xr66kko0dDmlzkrmMX30tA7g3imYQCtwyJ37gpSnVvXLhZNGM6c6Am5XmB vZJhuDOF/nwLLZOZCgXlutn3T4k7Q35eDvI3gzZDwOwoiT2BlwKixRVn6OtxJ9OJieDHRo fwzqgs9gW9gRpvPNhT1/EH6WZvgiit0pF8/U/YbvtXS1nh/YcdrXYlbSRYiz7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647546013; a=rsa-sha256; cv=none; b=LjFN668m81SyvZmgnCqWglcwGp9qA+2RYxLQteuTkCVjt+jGJpRN0Riq4gzF6tHMwtd4I5 mAJpxM1jlYLm7zRh4JC+JmTmk5I9k6jyEGih/lFA8KFUYLU4S36mURCvWEdWgEulLWbS4n 02SIfKWOZ7Cw67n6vX+NU1H/DguwT/gmtDcT9+5nlJmR8Ncn2R+Rs6AQhz83VyfwHLBiye 1HlWxHAnnyVqBsRQuU8hpqiQj5dd3SnS2tc/SKauYlTz2PMyjZxOVtsYaLsHT4J7cB1vxl pLIaJBB6AjpmVJdgzTafMbVSjGFa+QUTt5PJBGyRhpFRytu7LHKzvJapVIqCxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fc7e121d88d65aabbb8ce87d8e1d13e3c3cf18eb commit fc7e121d88d65aabbb8ce87d8e1d13e3c3cf18eb Author: Mark Johnston AuthorDate: 2022-03-17 16:58:56 +0000 Commit: Mark Johnston CommitDate: 2022-03-17 19:39:00 +0000 file: Move FILEDESC_FOREACH macros to kern_descrip.c They are only used in kern_descrip.c, so make them private. No functional change intended. Discussed with: mjg Sponsored by: The FreeBSD Foundation --- sys/kern/kern_descrip.c | 12 ++++++++++++ sys/sys/filedesc.h | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index da1eb24cf9c8..b13fc719c2b0 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -155,6 +155,18 @@ static struct pwd *pwd_alloc(void); #define NDBIT(x) ((NDSLOTTYPE)1 << ((x) % NDENTRIES)) #define NDSLOTS(x) (((x) + NDENTRIES - 1) / NDENTRIES) +#define FILEDESC_FOREACH_FDE(fdp, _iterator, _fde) \ + struct filedesc *_fdp = (fdp); \ + int _lastfile = fdlastfile_single(_fdp); \ + for (_iterator = 0; _iterator <= _lastfile; _iterator++) \ + if ((_fde = &_fdp->fd_ofiles[_iterator])->fde_file != NULL) + +#define FILEDESC_FOREACH_FP(fdp, _iterator, _fp) \ + struct filedesc *_fdp = (fdp); \ + int _lastfile = fdlastfile_single(_fdp); \ + for (_iterator = 0; _iterator <= _lastfile; _iterator++) \ + if ((_fp = _fdp->fd_ofiles[_iterator].fde_file) != NULL) + /* * SLIST entry used to keep track of ofiles which must be reclaimed when * the process exits. diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index b64a4c4849d9..8ecf7d8cb45e 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -193,17 +193,6 @@ struct filedesc_to_leader { MPASS(curproc->p_fd == _fdp); \ (curproc->p_numthreads == 1 && refcount_load(&_fdp->fd_refcnt) == 1); \ }) -#define FILEDESC_FOREACH_FDE(fdp, _iterator, _fde) \ - struct filedesc *_fdp = (fdp); \ - int _lastfile = fdlastfile_single(_fdp); \ - for (_iterator = 0; _iterator <= _lastfile; _iterator++) \ - if ((_fde = &_fdp->fd_ofiles[_iterator])->fde_file != NULL) - -#define FILEDESC_FOREACH_FP(fdp, _iterator, _fp) \ - struct filedesc *_fdp = (fdp); \ - int _lastfile = fdlastfile_single(_fdp); \ - for (_iterator = 0; _iterator <= _lastfile; _iterator++) \ - if ((_fp = _fdp->fd_ofiles[_iterator].fde_file) != NULL) #else