From nobody Wed Jan 24 05:12:22 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 4TKXBv1TMdz57THX; Wed, 24 Jan 2024 05:12:23 +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 4TKXBt5bbQz4ZdY; Wed, 24 Jan 2024 05:12:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706073142; 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=zgHXa+6/qLE/BXQ+gGyxhzfBwEpfy6LHijFGsIeeUsM=; b=uWX3E7Ao8oaNCMQLQq8ZH2IElxgTSti1hun/CxlhxsrPk4uLKDfzHyoFyB+ts9BiSlZVcT eCbcTyeRIGhkO9wrVd5j3rkNy9uQ0dd0FRD1JROWvmWK1h/tSS+Cc57cNGq94Gb0cSjg+x XSoY1GdpwWjA8npomrWl7+2aT9G+M9BHTAG6Ioaih4d8uK7FEnNTyTUfdz3pqMBlrRcVGY L/hNsVSBAFzSqNA3xbxoPxvap15p1pm4WCd0HB9HB4WF7CGRPBBkTZPI5Cwbm12DShxUiN ACXWWRjkAxc5D571wuVV+Tqe2W/SPKqJjAWTZu/GwIRX4uH/VwzlEx1H19mAYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706073142; 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=zgHXa+6/qLE/BXQ+gGyxhzfBwEpfy6LHijFGsIeeUsM=; b=o3rQYM7bcmarFdKKcf9D90YG94Y7y574T+O/xWIVPx9a7s/fsP3TqCG+SEEtUf+ivQwMPR tAO9r7urdJr4FPob6qbSzo4nO9uIoq5L6S1pFLH1AgOrVDAcsKRz0kErvjop5x6ujjO835 Ugo8tMK/XMl6HJWLoi0DNTywhiEXrojmVY8wkTiavhFhZAVWhLYgzTZgQOf4P5JTAlc9fz XNkKPHvP5s4uzPvCrL9zLZH6y7ZIcBxCvTHelRrEC0QU5ciOzkgr3LzzEcf3OfA7rCyGaN 9Yo5jAd9flnXz7ch7gBpTXTknufXSnhsCExyvRCCrxrOvnM9HwNmQWff1TjtWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706073142; a=rsa-sha256; cv=none; b=w6OiZX964+tbUhxOqKZn4j2+/7WVF2sryJcLdC16HW8Kzvi0aSKNstVZ3zZRpOaqkHowM3 JxUYbh+tRId5ZQojTKHA0/nqvKfUHJjzpd+P6mArHmT3+rYtlQlkRkTIhVQgZl6RbxxR5I KQWcb916f+MHf3xzfuYNVGQ3t6EXG8vnvGNkmWw9SWXuyfuxW3D5/a8xHMcRs77LA+gPvT fOP3WYjMuj07Jr3pMrA1Y+2V4SB6aBAbl+c4Idtm9PptRkP0bQN4/rr7PBAabCFWaNL/Bw 5mAfU+GFApIllne9T+wPLyFq5oMJMR+1O/IyMiTx9np5jcAddphr2qlgksWJPg== 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 4TKXBt4jTkz11Sj; Wed, 24 Jan 2024 05:12:22 +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 40O5CMYv041090; Wed, 24 Jan 2024 05:12:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40O5CMuL041082; Wed, 24 Jan 2024 05:12:22 GMT (envelope-from git) Date: Wed, 24 Jan 2024 05:12:22 GMT Message-Id: <202401240512.40O5CMuL041082@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: 41fb6dc3d4df - main - 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/main X-Git-Reftype: branch X-Git-Commit: 41fb6dc3d4df632ffacf91b5631a718442d129d5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=41fb6dc3d4df632ffacf91b5631a718442d129d5 commit 41fb6dc3d4df632ffacf91b5631a718442d129d5 Author: Konstantin Belousov AuthorDate: 2024-01-19 21:54:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-24 05:11:27 +0000 kcmp(2): implement for linuxkpi cdevs Reviewed by: brooks, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43518 --- 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 4a998a557514..36ed7b84cc94 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1721,6 +1721,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, @@ -1735,6 +1748,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, };