From nobody Wed Jan 31 00:46:15 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 4TPjyb5rYNz580b3; Wed, 31 Jan 2024 00:46:15 +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 4TPjyb3Qkyz45hF; Wed, 31 Jan 2024 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661975; 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=a4BvHkBYmmgH/6sp6ZNwLGXdB345KorE1uK1aB1hxWg=; b=F8gVzIb4XVpOykOBl92mDE9tSazYMaWzEqoA6Zr0bLel/Lrat+wvNzv+w8HdkoFpVc6LZQ y/1ldYCcJZGHkH9vP9Xxklwti8zlzk81yNyN0tVPdrYetSsLs13ebGEcstowPqzyEZ75AE oU1Uz9Zea7G+UE01CSq9BYPzYakNm2HTQZVq0DHFY+nl4ObV9wSseS3Py4+zgTKrIGRAOe OrTUvtVKIy5JSf3FcFuVn9VpM+c8RCuaBCfpPBj/Ss973K2OBEsG6RcnzHSpqo4rzmKLYY XXFgkDcMcpE7TS0ZiJHcX0xCtUCdzCFX4c9c9MwIviDilZeUhis1Im4qxmUX4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661975; 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=a4BvHkBYmmgH/6sp6ZNwLGXdB345KorE1uK1aB1hxWg=; b=mDDTg7KN5DAPXsNgL5SQnwAQNA0rvD8IOUsLUwQQx5esDM23HcF0CX6HqW92Fun6Zf0Pf2 uPkZNGMn06HYlOdpUD73fdwSkE9gy5t3N0RyNcCJFrASHofASmTCrWgBDfqkYyWvicX0Tj 9/wdoS+Bjbyt72lR32TJyDHYGGfwSiyz0Y3kWKORXrn+54nF5QPXNKJMfCh1u/Ev8hzUt1 N0xWUB+Uct+W/6qIhJk7OrwB8h1SWQR4/oJ8ouW4m4yoazad3IgKlhMTnu+XGvNbDlY0hE lXuRGj8vpDxsWJ+hZvkqvcVKoTNYXoEpXk6EXoaRt68b+FYVjFWJ47Ebc7LLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661975; a=rsa-sha256; cv=none; b=BBuyNGKboXro59cPPTqlgZxK7gmlT+fq1ota46eLMUHWnaXBQtRR6J1O/OeUXSZVRAHGiS i69SG7HzHImchtX10WXLas4B6K2nWDjvnkrqB34Bs+/l9S1vCrefu6ObOpqXRfbPILUQ9e Hixhvpxzc7ordYF+NTfKiPlpJpUigrRi4312/jdqhIf5zUFVfNjNxn6KUBQydW6fZBavAg rzPPBm/swg+7ak6U8u0J2C55PvNQmQ6xgBF8v8ioYuWVNW1tuZGbus28QdsXXybrHHhmZh hBVOEcIciVOiYuDqqKfSd2sXSsEtwaikBbr2LhA/zDlEDUKotU0oNY8+jVqavQ== 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 4TPjyb2WbGzxwH; Wed, 31 Jan 2024 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40V0kFde063674; Wed, 31 Jan 2024 00:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kFhT063671; Wed, 31 Jan 2024 00:46:15 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:15 GMT Message-Id: <202401310046.40V0kFhT063671@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: 0b864eb03f66 - stable/14 - kcmp(2): implement for procdesc 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 0b864eb03f6621d9d0f122e6b18360a4778a4647 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b864eb03f6621d9d0f122e6b18360a4778a4647 commit 0b864eb03f6621d9d0f122e6b18360a4778a4647 Author: Konstantin Belousov AuthorDate: 2024-01-19 22:37:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 kcmp(2): implement for procdesc (cherry picked from commit f006524d6d696cc2a10b9e90a9a6ea412f1839eb) --- sys/kern/sys_procdesc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c index ac94c3b44730..e8e0efd5bb00 100644 --- a/sys/kern/sys_procdesc.c +++ b/sys/kern/sys_procdesc.c @@ -97,6 +97,7 @@ static fo_kqfilter_t procdesc_kqfilter; static fo_stat_t procdesc_stat; static fo_close_t procdesc_close; static fo_fill_kinfo_t procdesc_fill_kinfo; +static fo_cmp_t procdesc_cmp; static struct fileops procdesc_ops = { .fo_read = invfo_rdwr, @@ -111,6 +112,7 @@ static struct fileops procdesc_ops = { .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = procdesc_fill_kinfo, + .fo_cmp = procdesc_cmp, .fo_flags = DFLAG_PASSABLE, }; @@ -555,3 +557,15 @@ procdesc_fill_kinfo(struct file *fp, struct kinfo_file *kif, kif->kf_un.kf_proc.kf_pid = pdp->pd_pid; return (0); } + +static int +procdesc_cmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + struct procdesc *pdp1, *pdp2; + + if (fp2->f_type != DTYPE_PROCDESC) + return (3); + pdp1 = fp1->f_data; + pdp2 = fp2->f_data; + return (kcmp_cmp((uintptr_t)pdp1->pd_pid, (uintptr_t)pdp2->pd_pid)); +}