From nobody Wed Jan 31 00:46:12 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 4TPjyY58nkz580Xn; Wed, 31 Jan 2024 00:46: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 4TPjyY1vrrz45gn; Wed, 31 Jan 2024 00:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661973; 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=Pi1L2w2AxnJntDPsqa7ht+38iTOrk57JguT5UMZY7pU=; b=huCPcb+oiktxrRtQ8WnznwbN2rYQfE06no7jCFGGX5CqwQG8PI5YLscd/UibU0KyQ/saJu 8nPqHrKk4N6UyXaq9L2Dpg2Tp8y8jQS3e2IPwfQ9zutOtjcL5OHg/UavXqRnH5wu+Nxa/C 5iNGA0lAoAfjUbQLi60SPctO2HMXHaeiR99Vjc12D4CxfHKeuCppvPIbKJcqmfzvNCgsCa NoGclZf1SV98C6siSa7FiQV77TKekJxBp49hjDPHeqnocR0VjkSrp+xe8rbCec6Sfc6PR0 VEcJqGGmq1PG/dAjZWFCWHaRg8Wes6RTW7APq5A4pnCW6eIPOofpEVzQFFbrLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661973; 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=Pi1L2w2AxnJntDPsqa7ht+38iTOrk57JguT5UMZY7pU=; b=mFiY7dsWSDCh6lk4qSTwbfigh+GPU8aeCyf25G/qsNctrcbsDb1+Qq3LHQgHv+1PnCeo/e zNeZtRyBCH6K3ceTbwIJC5hjVE6DEjjS472czc5/clYvQZm8VvMz8WI4aetL79hgukmUzf xaN3hXp/NPPjBRVIAakN0ycRI5mSslo15HrNttxKc7Q6uGySvWRvgc5n1duaQv3/Yqt34D qvWdMuuubXfjS1mUsTGh2jlEFCd5+VNuSwKOKzMjlP4z2gK15ftFAuQFcAYBZ11rp8YEZ5 clBm15gpV5Ge3+8xdTiiqa3FwihAGKJiGDoFoCq+nBpdIpSPqBtOTXejWFgYWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661973; a=rsa-sha256; cv=none; b=gtwzTVD2uygQ7IwTvFtu0wpofwBQUUT2WPFEryTHGKrTinOHfM3BuSzYJtp4o/ejeE1hhL lExj1Pw1jInDLe9gHOwKcaJeQCDTT+KPJuBUayZlqlels7HmNtDj4xkQpa9ibDnRlMQVpg GW/6QpPQTRfadyGx70OAO5ngCBjWex0soumBRyPh8IStNFzUrlCta98H5toACc3LD/dyfF Gi8dRHDu5fy6IYZ//uEtij345lS2Chp+0/1F+URG6kFBUVzxvL/cxVUQHVlRL/jEcZKmlF ICo5B3MY4tgTu/lqluEGXtsDNJmd2MdotsxDrpxFRABrgNLYR4jkzMVD4Z+DwA== 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 4TPjyY0h2mzxxH; Wed, 31 Jan 2024 00:46:13 +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 40V0kDsd063593; Wed, 31 Jan 2024 00:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kCdL063590; Wed, 31 Jan 2024 00:46:12 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:12 GMT Message-Id: <202401310046.40V0kCdL063590@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: 7dff3d1cdfd1 - stable/14 - kcmp(2): implement for devfs files 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 7dff3d1cdfd1556d2137ddd8dd1916e0945ed240 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7dff3d1cdfd1556d2137ddd8dd1916e0945ed240 commit 7dff3d1cdfd1556d2137ddd8dd1916e0945ed240 Author: Konstantin Belousov AuthorDate: 2024-01-19 21:36:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 kcmp(2): implement for devfs files (cherry picked from commit 5c41d888de1aba0e82531fb6df4cc3b6989d37bd) --- sys/fs/devfs/devfs_vnops.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 1df7d13be919..b8cf8c12d32e 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -2012,6 +2012,14 @@ dev2udev(struct cdev *x) return (cdev2priv(x)->cdp_inode); } +static int +devfs_cmp_f(struct file *fp1, struct file *fp2, struct thread *td) +{ + if (fp2->f_type != DTYPE_VNODE || fp2->f_ops != &devfs_ops_f) + return (3); + return (kcmp_cmp((uintptr_t)fp1->f_data, (uintptr_t)fp2->f_data)); +} + static struct fileops devfs_ops_f = { .fo_read = devfs_read_f, .fo_write = devfs_write_f, @@ -2027,6 +2035,7 @@ static struct fileops devfs_ops_f = { .fo_seek = vn_seek, .fo_fill_kinfo = vn_fill_kinfo, .fo_mmap = devfs_mmap_f, + .fo_cmp = devfs_cmp_f, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE };