From nobody Fri Jan 31 16:03:22 2025 X-Original-To: dev-commits-src-main@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 4Yl0zt5Djnz5mQw6; Fri, 31 Jan 2025 16:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yl0zt2Jmqz3hfN; Fri, 31 Jan 2025 16:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738339402; 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=pvhRlke05SmArOVN5aDfoR4nqwBTlmtxULCS0oINRfs=; b=Sk8tLaDPfTp2WpUnNPyP8hkIP2ajYZnH4zYnB/KLi2S1nZxm0Nb5l65T3vcBgFQW/UNRW7 F8pELwhv4NG4nJSagufjy14UPTYXlSLQj9Zy3CAd9OQOCZLZDH+JxvXkr6VTfFP8N6wUbk 0G85z6h7rs3dRCM+5gBa2RW7p4/BTWYg/C/kacZpy6BHfY6WyqGpYsinIpMSJybmi3dt/J TwksOf0pLQnRfu36ZGLWS+e8DUKwpSTuUZFVwtQVE9C6AryI/dD7q28QZ7uVgVNpRNPWoo VLNeyO0/xoYJS4/CKIy8sMFdX1p6opZ4jPEaTKplSuPyNZBhzBVBTRUKripQXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738339402; 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=pvhRlke05SmArOVN5aDfoR4nqwBTlmtxULCS0oINRfs=; b=c0VU/PWo+zUyvV7OposUkJxDWCdidd5aumJsZLQ7rtbEDMvvk89qbeqTmKk8Yl/9uj9vuY eSm8o9/UQqPSLfioU0cWVCyiGMz34bMouwhpMaLQ1l1yWtoTh1VVQDTjIbvH+iWF9tJFVg FTs9piT8QnDLnPF+pN9hNM0eBpv0K0d7DGKuawk+CSWtDOnIz9SpQ91aIzkMpz87WDt9kU nmnUjqf5srXIFgD6DLQN/2nyDJ1xz1D3vNGZ0qpuW0qRuxa+Rv7bxbbyWg1A0XLZD0OCSq OFxnnWaTOpOFQ+qDIhDcEpWoqCHgDkDpUjqjdB+4emFmXHRKfvr+f2gqQHjZBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738339402; a=rsa-sha256; cv=none; b=MTIRnuo9BNMPHmVm2XqT5+1U1KM8ykpwghFfi5grmRcGt3Yrda+3lFmqyolqILZDe7VWlI 5beuUZih//v/ilGl1v+WWcCoIeDdtktw0UHNvldTnoETCkYDskx9eBJ1I1GajEPvi6u4Oz rPPr5NI8kJ1c5pxuKLcTD2AryRof+wpCwBdwn/2qcfff7eGpNXP4Re9U1ts4RNtX5RfjWs kNPpJFV0z+6js31wYb/z9ywLGPOAsUlvHu/xgGkMVwjW1/ns0tJRqAK4AB1HLPa1UwyE8+ hzHKn4sUR3ceSc+PtZOuE8dDzI3HlQ2qkjdTl4T5T0psS5Qytv+PQoei/uLADg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Yl0zt1sqDz8xH; Fri, 31 Jan 2025 16:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50VG3MZh038860; Fri, 31 Jan 2025 16:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50VG3MnG038857; Fri, 31 Jan 2025 16:03:22 GMT (envelope-from git) Date: Fri, 31 Jan 2025 16:03:22 GMT Message-Id: <202501311603.50VG3MnG038857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: e3cf2321b084 - main - linuxkpi: Add `get_file_active()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3cf2321b084df599a28979e624ff8083c150dc7 Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=e3cf2321b084df599a28979e624ff8083c150dc7 commit e3cf2321b084df599a28979e624ff8083c150dc7 Author: Jean-Sébastien Pédron AuthorDate: 2025-01-01 14:38:38 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-01-31 16:00:49 +0000 linuxkpi: Add `get_file_active()` [Why] This is used by the i915 DRM driver starting from Linux 6.7. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48757 --- sys/compat/linuxkpi/common/include/linux/fs.h | 1 + sys/compat/linuxkpi/common/src/linux_compat.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 86b922ac9a1d..56de0e3e490a 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -265,6 +265,7 @@ get_file(struct linux_file *f) } struct linux_file * linux67_get_file_rcu(struct linux_file **f); +struct linux_file * get_file_active(struct linux_file **f); #if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60700 #define get_file_rcu(f) linux67_get_file_rcu(f) #else diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index e5049a4b8f43..3e2938ab2c2b 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1121,6 +1121,20 @@ linux67_get_file_rcu(struct linux_file **f) } } +struct linux_file * +get_file_active(struct linux_file **f) +{ + struct linux_file *file1; + + rcu_read_lock(); + file1 = __get_file_rcu(f); + rcu_read_unlock(); + if (IS_ERR(file1)) + file1 = NULL; + + return (file1); +} + static void linux_file_kqfilter_detach(struct knote *kn) {