From nobody Sun Feb 11 01:52:54 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 4TXVwQ4lzLz596L3; Sun, 11 Feb 2024 01:52:54 +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 4TXVwQ3KDNz45y2; Sun, 11 Feb 2024 01:52:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707616374; 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=OdfFfAlFJDrFgOb/W2Nlflpr/orLSH+alRlqFpyVn7s=; b=nsjCDNgthAaHf2QC8y1WzjZWl0yoRM2YIVQndHF8rRy2oijKk4+9UJe/Gl1EU9pl4sLo4h dUX6FPLCqGSpvRL69OKczq23hV9vU7tB0E/MyG96MICBm04oIAYJe4+uC2JHxWMfiAisQx i3qIe12JUT60jp59NcAnr56Dw42D3zVW3rJ65VLO22Cg5PpghUjsRJkbfSI/autoZSk1or kF2gc34eqs9ixhTqqV6iVnni3r9HjNlLPDU/hRLRInXy2Tp702vnhZek1eDj/aqS1uuPSJ hU2o+n5sSOW6wsbz8MYZqqc7f34SoRfaueOLJmbV0VcSB+TSFcRpzE3cffPUUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707616374; a=rsa-sha256; cv=none; b=P1/TX3EI896pErIImncHEadQmgn8NzUg4fqHh0+tbAZJm/5pBtMhDqbNTSR8pgmkxwhcwc 4cON15LDnkwL0aAHHqaY0nic9+GgT/UuSmLICcESgtr5ffdSCfNfE/aJaYReQayCRxtVjP wbRpUrsiaWPfyX+5KuvqhoRKH8dc8yISbdeoIKokgbtt4y1e7fcQPm8H6mLULKtmok9jj2 qXwalJyRXkjfn+PWuMhTd7AiS0t3J/Lkk3N2JZEiO7afKGFPViIj8NIJ9bncmTYIqCI3Dj qIC2wei75dJ//JxbeVFUz4GWmjBSYsvJV5TtZ+VuyhglHFfEdU6f5uzCts7XhQ== 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=1707616374; 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=OdfFfAlFJDrFgOb/W2Nlflpr/orLSH+alRlqFpyVn7s=; b=tWJ5bPmeS5BuTL4C6LWZtRR20uDpaMsB49taIS96iQ/2VC1J1RZBDcHhkffxT5kYyfDJ3N b/gG0H2Xc3avZQegvWIqDh03NGu29R3S0Lkw8eMl3kaFZalJQcxmIHd4Tz0c3NtFSFcC5O gNxHJvbNrkYTpUV2IRpITT9oIdgfaiPg7nH7j6DTjf0rnocde2uaUygAjN/LEzVeJ1wUa6 21TsphzwILDh8v18K8yWXH9PUK1Er6EpcGDDZIhWG6tdNyq4OnzfoojPr8HcpfhhJveIpQ fqXsOI9LfqhAMZFbEc+86QGvLQrcqvuEvG6g4B8B0pnPVZNT+dPTtMl19CO+pA== 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 4TXVwQ2CkszgFx; Sun, 11 Feb 2024 01:52:54 +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 41B1qsua089690; Sun, 11 Feb 2024 01:52:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41B1qsSA089687; Sun, 11 Feb 2024 01:52:54 GMT (envelope-from git) Date: Sun, 11 Feb 2024 01:52:54 GMT Message-Id: <202402110152.41B1qsSA089687@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: 920542c46341 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 920542c46341a572e4e7395e0341537f9ae6c66e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=920542c46341a572e4e7395e0341537f9ae6c66e commit 920542c46341a572e4e7395e0341537f9ae6c66e Author: Konstantin Belousov AuthorDate: 2024-01-19 22:37:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-11 01:40:29 +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 307aea407d90..aab7b1616594 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, }; @@ -556,3 +558,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)); +}