From nobody Fri Nov 11 17:57:41 2022 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 4N85yZ32ydz4dTkn; Fri, 11 Nov 2022 17:57:42 +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 4N85yZ1DYfz3QTm; Fri, 11 Nov 2022 17:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668189462; 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=LEM6ZGc2bVJHP8nEQ5ZpSmiyNwUMYTmihIXG2CLU17w=; b=eRWY/vlYxFtFJA9u3evtJjorjOAgXbGEm8Cmyn4wAhAW9OAiIdIMJPRe932MzYbTKWFi1Y QFA1gw7qSmm0YsbZgGZJQULdH881QDvheFGm3QZAMUJYK5VoAEZt083OJ0IUZrywPQKZVp FfidQT8zPvGppBgoIr6Ohv+9g8vFzbpTp/c3mWnJqcduS1l7Po0zJpnPCRDKhZTdVsgE91 S1oU7TfvITXiTzZ1YIowrzB48eae2DyLBuuYULmgXU1VD50GKeSJZNY/QvBkaOfErF6IoM sMIX9I/9qfh3ZSe3G/5m3jp0EZkw7Y2zRlBXa2soZ0O9Lq5hTYd/0ceCpz2vsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668189462; 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=LEM6ZGc2bVJHP8nEQ5ZpSmiyNwUMYTmihIXG2CLU17w=; b=deEF+pvIqPwKRc6vmx7cN6cse0TOFPx9jU/waRR7dx8JIi2lQpQCtczRdXSnnPdFDJ9wGc 3rml+SM3r6Xi/L+UwwXvIdPUZIGYVO718HcgOcWa1O4AgeYNbNTAsaw2jLShIquObvruBu nonCaPvhO1p7Y+er8tNsqly2/VmczkwZjEmSF+Wb92ZUx2OJ4FzcGNIaWdlu+rvJYUduCi Wjo10IgFEdFv21weRiab01Io6E+kwhe+6NoMA7wzMbjn5M190AIjwwl+B4UyTS4G3VJ3IA 2+fYMFkcKJNJJhG6a/jpZKirRrItWpp1py9/p1HkGpzEtZbUy7sahROu/Bcqew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668189462; a=rsa-sha256; cv=none; b=yfQUh/6fBGMMZJsV/DlhXjsURjHAntlNpa3uOS6EvzzDEFa8CUPjNKLJqfWrzmF7BYHBls mTBG/hzW0snmu1Q9ius+p0deeOsx8SP9x9nlwCi5Lp5rYnRsmnXQvq527xNmNMb5zIyrLX +3KqLUSKhOMofEp72Pr+A3+ao4iESyGEafnw9DH6MysTmwY35v47qWodfjY61wpC1uIV+5 O8rEj8PRT+qiEJKBvmBBa2Ukg+gLR6M7OgCfr3ucahLhALuBs2l3DJ0jClDWXrWXlfD1ba o/vuv7wurfuqxGj5Ipu0VY1RW2gE7Afyhkg2OZ8q7Cb9H5oItKgcmgrbzE4gjg== 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 4N85yY754TzrlC; Fri, 11 Nov 2022 17:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2ABHvfFo044724; Fri, 11 Nov 2022 17:57:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ABHvfRa044723; Fri, 11 Nov 2022 17:57:41 GMT (envelope-from git) Date: Fri, 11 Nov 2022 17:57:41 GMT Message-Id: <202211111757.2ABHvfRa044723@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=20P=C3=A9dron?= Subject: git: c72dd0aabe25 - main - linuxkpi: Introduce `vma_set_file()` 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: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c72dd0aabe25dd4ea82e5b83d36f706d8bd2e783 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c72dd0aabe25dd4ea82e5b83d36f706d8bd2e783 commit c72dd0aabe25dd4ea82e5b83d36f706d8bd2e783 Author: Jean-Sébastien Pédron AuthorDate: 2022-11-11 17:36:00 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2022-11-11 17:36:00 +0000 linuxkpi: Introduce `vma_set_file()` This code was moved from the i915 driver in Linux 5.11. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D36957 --- sys/compat/linuxkpi/common/include/linux/mm.h | 2 ++ sys/compat/linuxkpi/common/src/linux_compat.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index a0a96bcdb5a2..930d588902af 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -311,4 +311,6 @@ void lkpi_unmap_mapping_range(void *obj, loff_t const holebegin __unused, #define PAGE_ALIGNED(p) __is_aligned(p, PAGE_SIZE) +void vma_set_file(struct vm_area_struct *vma, struct linux_file *file); + #endif /* _LINUXKPI_LINUX_MM_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 1367556a6f43..26af40836c64 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -834,6 +834,18 @@ zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, return (0); } +void +vma_set_file(struct vm_area_struct *vma, struct linux_file *file) +{ + struct linux_file *tmp; + + /* Changing an anonymous vma with this is illegal */ + get_file(file); + tmp = vma->vm_file; + vma->vm_file = file; + fput(tmp); +} + static struct file_operations dummy_ldev_ops = { /* XXXKIB */ };