From nobody Wed Jan 24 05:12:21 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 4TKXBt10PXz57SmV; Wed, 24 Jan 2024 05:12:22 +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 4TKXBs4RQsz4ZXp; Wed, 24 Jan 2024 05:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706073141; 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=qnJRB7Oh8/wJIakof2al5P3H6hhBUZ+wN8D3cz6hqAA=; b=Crusv6UnitV75wuBWFkqrkZaNpYXuoG/PaoIpx7LxOsnW6ymt0CTCfznwzd6E97kX5hrmc CWJGYx3VMXRtrxBuQdhusN1VakHYEadwqvwT6lNUdtHfQGI5Fuvl+wZRGLqmnoMDCqaNCx O9aX4ftXRMTcnyNtfkyK/uemgGyh1m++6TKZ/DA5O6xbbBqV10k8Zgn3BuNDI6x7tlls8Y rvq/hZRmoJmptEOqGiKCNZMP6tlAAyDgyNNP+qNl6gJ3whBqa8u7uaVqDw6Bn13WWlRBAw Eam7fC3V/NwZV93K+XiS3xxaJ7rUjE2lraVNPzq5udz7Ysdo12F/pq/P2uJHnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706073141; 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=qnJRB7Oh8/wJIakof2al5P3H6hhBUZ+wN8D3cz6hqAA=; b=fDckRH3n95i1ICVnGfXM5ItaGDJt61cr+/DjLQn/Sn6tLdp9uwJGsfWvxGW0u4nkIDWTcP cKySBooipvZ4TeOU2t3GRTWzwMot2Ys/4AQAmTTvgXl5DrjosCaHpYBP3BLDz2eHEiJ9bV ytJIF2ILIEK1VKdGrFJwlPmTFmMnqpQ+xnTUONX8pA2Rw+Ekf4FvrsZUEoKIuZ5ohrKYtC /zU9aQBa6zFi52gQZL47CpDPisDtXfGGhIjTAh9hLbjQu8SQ9qhCb+Cz4S/MIoHJas2xe7 1lUs7XBHaYIgwjZjpq/unNyfgPZy5sDkNnRLnSRGyUKOR+3PEFFIWsD+K05N6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706073141; a=rsa-sha256; cv=none; b=g9+Bch6hj/mUv2Wk/oGU+7MHtalBawllIEaTucsdjod1Fuxg5QcHKd4AWeGJoD9qcpyvoj Xc6mBZBVng39SwEJw69xuGlYmT0bhuodiXm+IzCvLhr5LUGOLudBkyT79d0O5/Pndv291N 45tY8MFrFFJfecgY+THvV+tlblG4Q1DfPHt58iMeWij0teI4OETng26VR2EfkCuU/Ixp9S HNipXe6hNBx70e44i4jpj6pnzRiZrBXFRztbqhIRWgFRwoQN3YVizEoqu8VucMm65vIA6U ZBj+kLU+Bjxhdx3DwwqBzTH/pl5F3rz3kIKZkRo9mlfoRKYGH7WoYT8d414EiQ== 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 4TKXBs3VVlz11Vv; Wed, 24 Jan 2024 05:12:21 +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 40O5CLAW040232; Wed, 24 Jan 2024 05:12:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40O5CLio040229; Wed, 24 Jan 2024 05:12:21 GMT (envelope-from git) Date: Wed, 24 Jan 2024 05:12:21 GMT Message-Id: <202401240512.40O5CLio040229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5c41d888de1a - main - kcmp(2): implement for devfs files 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/main X-Git-Reftype: branch X-Git-Commit: 5c41d888de1aba0e82531fb6df4cc3b6989d37bd Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5c41d888de1aba0e82531fb6df4cc3b6989d37bd commit 5c41d888de1aba0e82531fb6df4cc3b6989d37bd Author: Konstantin Belousov AuthorDate: 2024-01-19 21:36:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-24 05:11:26 +0000 kcmp(2): implement for devfs files Compare not vnodes, which are different between mount points, but actual cdev referenced by the devfs node. Reviewed by: brooks, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43518 --- 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 fbb314dbbe79..3b8a624fe620 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -2010,6 +2010,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, @@ -2025,6 +2033,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 };