From nobody Tue Apr 05 05:09:59 2022 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 8BD431AA36E5; Tue, 5 Apr 2022 05:09:59 +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 4KXbLH3VFzz3hdw; Tue, 5 Apr 2022 05:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649135399; 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=8q+OJfrq3UhISPPCzBWPScJXWzoyzZ0hndgaSP54WUQ=; b=KXZ0/MtRiWgr5S+OXPbnJ64k+8Wxvg79aLg5NGlt4agj1KkOZzyQAvKcY/EX2Itp0TorCB 1mq7dEUVyQzcqbk7P2qRNuFHb6wZl1N3MbktYYInGNiXVtjo2gaog9vzWYyFBoPXetpZ5R EClmuQpH9YwiEQVaLjrzccRsN/NRjDVyUzwnFv6govDGG3kxoxBqt5fsUM0mHDTdhH25HS Wc718y3h9+w6jy3viFM6e0v2oVFNIUkmgM9LLq030kFiXCcTAawGWXVU8Crlfr8MD7g9YZ sHaZ9eN2qsaVP84Hpx86xduQJpvGwkSdLtYXHKliMeVhQ8IXSxsgM4Yxr9w+0Q== 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 5769F1FBFF; Tue, 5 Apr 2022 05:09:59 +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 23559xTY051361; Tue, 5 Apr 2022 05:09:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23559xxw051360; Tue, 5 Apr 2022 05:09:59 GMT (envelope-from git) Date: Tue, 5 Apr 2022 05:09:59 GMT Message-Id: <202204050509.23559xxw051360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 36929b55849c - main - linuxkpi: move kobject_create to .c file 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 36929b55849c8f553a744d6e4fbc8b1a5ff73f66 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649135399; 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=8q+OJfrq3UhISPPCzBWPScJXWzoyzZ0hndgaSP54WUQ=; b=kc3ygceIwAoRk9qLOE83tL44vJjcWgts9bphwfYEtKe6BWxEDGqxa2PVgJArJ/PJGwEwql 0ydi1I/spxCcW/4jaFu7mY7KiXKV+aDc2JUaeJMYhvAIG0ubu8zmYNmCc/f4R62NeRDZFh P7OBjNVN6wI7cGoMs422oynuGOOSj7+KfCl8YL5FIkJhTYhSVVYMAsHpxiikNKrS7VDvmX lQPzFun+MZVXf+S85bY7dx9KgAHRS1doTu117Zo7i0BWHYrOirM/NIA6RCrdA5guhi7h28 xinV6JAQ8fQMDXpTHhIAqYX1p5hgxQ3mFzE/Mympx4dE+36TWgj1u/Lv2TbrOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649135399; a=rsa-sha256; cv=none; b=woZfPB/OeD6DzW2j8h0012NHzn8IoxpQFeHBsH7WwWsBGii4h/xdsVuH/Fo0zxCRNebil9 9p+jQx3ZchC8YEEvt0O2aUMWZ2jAwICZgFPzhbXGkHaJEbfPIChH/97r4xdVHTH6OcWjmO ctjvF38AckTlKyE2jVOHhq14SmlHnIVqCO81yuPvKiwdHTAPWE/Te1iSvPnbAw9hmbmJnb JarWgQPAUBCRmi75P9dcuAm5AliKU3cmLB5xrL8uxyOFBVxSqfJSB0uR0XvOvzCEAIbeoZ 41dagX6ehaPYCCw1APshFQ8AjLnaVjh4f3p7FE03+7vxKV1URN0dijp1TP5+Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=36929b55849c8f553a744d6e4fbc8b1a5ff73f66 commit 36929b55849c8f553a744d6e4fbc8b1a5ff73f66 Author: Warner Losh AuthorDate: 2022-04-05 05:05:26 +0000 Commit: Warner Losh CommitDate: 2022-04-05 05:05:26 +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. Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34767 --- 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 4159cef9ffba..37294230c62e 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -156,6 +156,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) {