From nobody Wed Apr 06 17:46:03 2022 X-Original-To: dev-commits-src-branches@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 28BF81AA5EFA; Wed, 6 Apr 2022 17:46:04 +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 4KYX4C5fs8z3DTw; Wed, 6 Apr 2022 17:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649267163; 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=KPZg8BuSInOLLUt+1lsNaJlMhvkTgc5+k/kN/GLEhvk=; b=H9aY3PTyKUl3MQemo4HHaAUXJyP/QZBx/L8JhT4KnjSAyvZFy++GwW0P14cf87zMcjTC/U wBeqDMDqJQ3tD0/L0WW6d89mf5RrtXv19aiLdrnSd1oxjgdpPOdrkcSbxF94FLDrOPL+Ca ISc1SY/XAlNqJ0kgBNjfydBCQcl/jlqWzrcX3RIbkG4gzJPKhW/75RU/2IP1HoKYZXtVFr LzWzkwEEGkUUxBJMg6uxn72ruxyU+AREjySm49iQmj5YC1S0DJFSDyO4N/nHxxV2BVbG9r QFlcNhRNyKwnG4yWWthobt7JfJXdgbbX2wIQNDv+9OcG0RSpc8OKOcbjM0RVsw== 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 892081F969; Wed, 6 Apr 2022 17:46:03 +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 236Hk338022585; Wed, 6 Apr 2022 17:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 236Hk3cM022584; Wed, 6 Apr 2022 17:46:03 GMT (envelope-from git) Date: Wed, 6 Apr 2022 17:46:03 GMT Message-Id: <202204061746.236Hk3cM022584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: d3113190ddf6 - releng/13.1 - linuxkpi: move kobject_create to .c file List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: d3113190ddf610fe9263efa2d01cc6725cd67d75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649267163; 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=KPZg8BuSInOLLUt+1lsNaJlMhvkTgc5+k/kN/GLEhvk=; b=WqqHnU7d4iN45k+9ow2GwQRYK+P2KALZXSx+gYuKUrXx9dd+Dk32KZL9oCowpkxEUDaZGd Fe5/9MBQ5nStcwbMstTXr4zya5OYetRG5L6pLxVYdhE0cYfgsK83+1ST5pw+nD+aovfe9J Ib+VvfNSILzt2xU+1a6sJjaM/jya46FHei7n6POzIhBwrWOiHI9P4nKEkZwigif/0gjHMO fZ7QMt+80ivZ8ZQeGokYmQZSbNkYZGH5RXoTDjqBnapt/Yu2lEnvIewfQvMROxDlQY5XeS StAoe2RBODxwOLb7IqZn4cYKI9o9LejjQuWFYzXouLAsE8ZuQ1fHQtZf1E8K7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649267163; a=rsa-sha256; cv=none; b=YIwWgEx2PQI7yhL0qaVeXMxDf7wFUUof1VtUU1YuGfu38ZO3p3/LCBjZmIKhz94Rm9apWk LlHnxaTr1z6xjJTkoPH47A2kfVdi8WVmEjHYViYnSsT5oBD7tvjfPMjdkf/Gv9nmAXL+yE TzJbYX22twEN0PvpVCDTklEmf19G5KJc6UHZIDFQOKIyIa7xXVHKE9bMJCYYDieUkFzYBr rwCBbLpdRP9JiQesfqULQEh1AjEF87/3wvLpkiJXfq4+vvuXV8K8W0rqZ1muKbKNOEN4mg CCzSMD44zxmqNOMnLES2JdcgtI6/NdNabxGN4zq4Z660kx6EVVQjX8HGwPw9Xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d3113190ddf610fe9263efa2d01cc6725cd67d75 commit d3113190ddf610fe9263efa2d01cc6725cd67d75 Author: Warner Losh AuthorDate: 2022-04-05 05:05:26 +0000 Commit: Warner Losh CommitDate: 2022-04-06 17:45:15 +0000 linuxkpi: move kobject_create to .c file kobject_create knows the size of struct kobject. Move it to linux_compat.c so this knowledge is confined to the loadable module and not the clients. Approved by: re@ (gjb) Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34767 (cherry picked from commit 36929b55849c8f553a744d6e4fbc8b1a5ff73f66) (cherry picked from commit 2f3d11894be6fb727be77184d232de24bf5551ba) --- sys/compat/linuxkpi/common/include/linux/kobject.h | 14 +------------- sys/compat/linuxkpi/common/src/linux_compat.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kobject.h b/sys/compat/linuxkpi/common/include/linux/kobject.h index e6f716254c93..ad25058028fc 100644 --- a/sys/compat/linuxkpi/common/include/linux/kobject.h +++ b/sys/compat/linuxkpi/common/include/linux/kobject.h @@ -107,23 +107,11 @@ kobject_get(struct kobject *kobj) return kobj; } +struct kobject *kobject_create(void); int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list); int kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...); -static inline struct kobject * -kobject_create(void) -{ - struct kobject *kobj; - - kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); - if (kobj == NULL) - return (NULL); - kobject_init(kobj, &linux_kfree_type); - - return (kobj); -} - static inline struct kobject * kobject_create_and_add(const char *name, struct kobject *parent) { diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 666a1bd07970..88bc1dd355ac 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -155,6 +155,20 @@ RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); INTERVAL_TREE_DEFINE(struct interval_tree_node, rb, unsigned long,, START, LAST,, lkpi_interval_tree) +struct kobject * +kobject_create(void) +{ + struct kobject *kobj; + + kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + if (kobj == NULL) + return (NULL); + kobject_init(kobj, &linux_kfree_type); + + return (kobj); +} + + int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) {