From nobody Wed Jan 31 00:46:14 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 4TPjyZ5swLz580Zw; Wed, 31 Jan 2024 00:46:14 +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 4TPjyZ3HJxz45h3; Wed, 31 Jan 2024 00:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661974; 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=UrZOlxfj9F8lNEEQeN+boRAsM2MyMb/LyBx+qhqrU4s=; b=Wgspx6VrxMgiNWBhVZ0Kwf62KBfrJk7NbVgPPgeJPMKTrWtzbUXIXa9FVQg4p4PaVFMB/8 sfB+GO60tik7cCRfI/3qzgkIVqjJgMrytEfddV76gFKB2tjQbTx17XEp2OSPwhsG77A7jt BZ48hXVvzLquyXw9WHy3d5uXIZCLIE8313uzoRdbZaXGs3NRzJOJEog6LL+C8Vo74D5OJe Sy3VYsQCMh84hp3j9kgJjlofDrqOwm/rRsLvy1ojNAxl6ot125cs6jC30LRIUxRT9MdoNP vaGE7GANPc18uEcIoo28y/yS6mO5l2UT5OywNNWezSxpWOx0JqNLNXvMeS6dVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661974; 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=UrZOlxfj9F8lNEEQeN+boRAsM2MyMb/LyBx+qhqrU4s=; b=uT9h0TccMGP7GhpwpHkinuKQYnMLEStgOonrb4iqFC6FAUQUmJvdd7UrgXNfluCMMscEpi vIHnMn85KyX+/oVOoNSNwsUEnLQHRXI2D/sAjiBJaKx9WwoL56Vl/C6uK19agtYp+NuDT2 1zoAz+WJHE+Vt2/PNo+xLmaU5qzlOp+sS0WY9JYcv+y42ANw2bjSjzYyzLNJ+GLMFltpA+ VRbAktPm04iF/RU7NUrpGYQQekVoKplRhqJs/tiZl+jQa+yKzD0za+XbRvDfZ6Js9fkpSB 5rE3A0VmmcQS162dWjg7ZeOmnIVnnfGhKeEuiiwq4l/dvtSzCHfEnmiTBPM83Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661974; a=rsa-sha256; cv=none; b=mcRnYTSGEaBvdysJ05u2AL+uCHNjbTwP8E6J8QWyWj1d99u/ngLUUKoReaCY8jOjYuGoD3 LeVrqYJYJd77dLJBwiKDh7FUktet++SNXIgeYYs45thIn+ZDk8l+sfIwuWIQW8mxpgnPOM Q2XOAJk6P/GVRI2d9JJA4sWCfmeiSuPV2HU52czQmBRU8brMDiSfkDk9jyeeU+psuMGJGX oFbQVEY1yl2xlnFMgOJEH5cJJVvIaoZ0zZmffsR1q+/LDc9XmBqyd2m+V3KIE5fsr6oDC8 JH1Lmo2dG0V7sFeIjEEo296rVXKTJdVcp5G5gjsawQZCyQV4BGtnuKNFWIfE0g== 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 4TPjyZ1k9jzxVt; Wed, 31 Jan 2024 00:46:14 +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 40V0kEll063635; Wed, 31 Jan 2024 00:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kE48063632; Wed, 31 Jan 2024 00:46:14 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:14 GMT Message-Id: <202401310046.40V0kE48063632@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: 81cee1350ff8 - stable/14 - kcmp(2): implement for linuxkpi cdevs 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: 81cee1350ff87537f8203d2db0e8ed2acdff7aef Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81cee1350ff87537f8203d2db0e8ed2acdff7aef commit 81cee1350ff87537f8203d2db0e8ed2acdff7aef Author: Konstantin Belousov AuthorDate: 2024-01-19 21:54:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 kcmp(2): implement for linuxkpi cdevs (cherry picked from commit 41fb6dc3d4df632ffacf91b5631a718442d129d5) --- sys/compat/linuxkpi/common/src/linux_compat.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index b913ae602ab3..69a17ea1a4a4 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1899,6 +1899,19 @@ linux_iminor(struct inode *inode) return (minor(ldev->dev)); } +static int +linux_file_kcmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + struct linux_file *filp1, *filp2; + + if (fp2->f_type != DTYPE_DEV) + return (3); + + filp1 = fp1->f_data; + filp2 = fp2->f_data; + return (kcmp_cmp((uintptr_t)filp1->f_cdev, (uintptr_t)filp2->f_cdev)); +} + struct fileops linuxfileops = { .fo_read = linux_file_read, .fo_write = linux_file_write, @@ -1913,6 +1926,7 @@ struct fileops linuxfileops = { .fo_chmod = invfo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, + .fo_cmp = linux_file_kcmp, .fo_flags = DFLAG_PASSABLE, };