From nobody Sun Feb 11 01:52:53 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 4TXVwP3QK6z596DW; Sun, 11 Feb 2024 01:52:53 +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 4TXVwP28qlz4637; Sun, 11 Feb 2024 01:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707616373; 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=KlvE3a4hbMTtiBlq6YArsZPSKOubBsFeJ7ZY/+Gr3V4=; b=l4TkHJ5Lp4Pn/he4hcp9pkjppJKxaJ9ExRCLaGITqpgt/T+Qx5NI+u0uBh5cwUpVj4DuxC vMON4oEIaHDrxZWmnJ4Re2ycBysy8PKKzhN6izS/2c8qp3ASPcCtJetAlN9Vwnv43hDZ25 bSPtXM7gj4+c/yudn6MHfEOsIhrjGgIN0SiAvS9wwIbajMM+CmQ7u4bIXd5QrIm8tGnXoe pFleFOgrNyn4PcCwwbGY+u3Csu+orxQMTEuOQBDOfRa7JqvcqNH8FOHsxqhzznQAJbWwNO FcEeAp5dcFbTc3FdhQWuNFr11k8eLeVhF7G0t2PaUKt4RGWKwrhtO1YA9mvq4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707616373; a=rsa-sha256; cv=none; b=Sw+uo0p2AFgBdJPinRv3MfdkR8VQcPP+Vje+oZGiBlFjmFpgD3/DFcx3UCr2fr8fJ9/CbK terxaDI14Mg/SZBLQD4akzOy8OdiD6g3+3ewXd6oYqcGbqaFcj3zlyTaLHmjXSdo9pwi3l u9AHsWdZ3QXcx+HtzJRDWDp8yp/yzrgky7YsAJRt2ly2UUsDjt1oGo7YiU8PkP6lEz4sE6 7o6sTroiXWwO9Nw2PiNDbBWTdtCvtQbLDrbW5n1W47itOzUCghqoaD3LnBwZLjWA8tB/jn id+Zbnc7uVckNzOoylQ4Xf4DS5951+fCo9fYNeTio+lFsl3AolVaBqFMRTk9qw== 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=1707616373; 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=KlvE3a4hbMTtiBlq6YArsZPSKOubBsFeJ7ZY/+Gr3V4=; b=PQYpRDCPZDcX1IkalGBWJw5K0Q3P6Mw25q7bE3WjAq+OX0etIseJXMPKm1lqXL7DjojX8E ebPAjVO0C7RlrCSw/Ehl9PtN8LNfgwo66kxxOeFpOrU8JHPjejQzMeRNzOHR2P4lK4hZy3 rLR1/oxefe4PcXtVCvgOoQms+ZzLXtKg08auoP6Wz3xur847PZk0wFguTFBODeoMaFnArE bfv+d1ywEfSaPQCZtJ4v+Z7fR4944vjPJQhy6TjoaeAb7VfxEeSgdUEDCmbwUrfbzIxKHm 3NLsLRn7HE5rNevDQrqKliSPW3H7K3m+ogVJVZp1RR3MxQHXQpyLgBuH9T//qA== 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 4TXVwP1Gfjzgjv; Sun, 11 Feb 2024 01:52:53 +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 41B1qrpC089651; Sun, 11 Feb 2024 01:52:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41B1qrjj089648; Sun, 11 Feb 2024 01:52:53 GMT (envelope-from git) Date: Sun, 11 Feb 2024 01:52:53 GMT Message-Id: <202402110152.41B1qrjj089648@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: e314d3d7aa65 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: e314d3d7aa65159291fad83ea95c867b473b0dca Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e314d3d7aa65159291fad83ea95c867b473b0dca commit e314d3d7aa65159291fad83ea95c867b473b0dca Author: Konstantin Belousov AuthorDate: 2024-01-19 21:54:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-11 01:40:29 +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 df48674163aa..85fb072b9943 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1900,6 +1900,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, @@ -1914,6 +1927,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, };