From nobody Tue Apr 05 14:42:26 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 04CD61A8F04E; Tue, 5 Apr 2022 14:42:27 +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 4KXr2p6kwbz4cLQ; Tue, 5 Apr 2022 14:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649169747; 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=yIC0zaSsG/Rro/6cmUC+qfI7gXEHDdINbERxLMeoaQU=; b=t2PsI5TiO/P4A+ct9Ua00FF4SzUQbYnCtzThmqbMpWxLMqmHvYNsGIgQ5ybZc6plBFPozZ 8UMA2D+dVnymG0C0B/UpclzNGx/owqunm1W2gJ2CqUhexEPmBbcE34R5YayOgF0gmgZ2+x oSJSBPTv119lH3xrFvCtbJvUIjFpsDQ/n+uG9uWjdm92Rt5eR50oJ8TS0lBu/dpLmgCwYg wQZAglZaVPV+EVJtogPYPV4dlws0NTGkJBLM78dp75wI+qkdEsxrbDUTCyGzBJtyVs4vVl eg1gRUiTLNa1qqBS59l/RVSmV29+1NJYWYk6kpN7P+pI9+gIqGrKZ3z1U8Sx0w== 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 C8871803; Tue, 5 Apr 2022 14:42:26 +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 235EgQc1029933; Tue, 5 Apr 2022 14:42:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 235EgQiC029932; Tue, 5 Apr 2022 14:42:26 GMT (envelope-from git) Date: Tue, 5 Apr 2022 14:42:26 GMT Message-Id: <202204051442.235EgQiC029932@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: 2f3d11894be6 - stable/13 - linuxkpi: move kobject_create to .c 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2f3d11894be6fb727be77184d232de24bf5551ba Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649169747; 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=yIC0zaSsG/Rro/6cmUC+qfI7gXEHDdINbERxLMeoaQU=; b=MdT1I9l0idbU4rPoQ8ZM1IS98ztOKUgv46r05UzoFs7m5C9Xv5DFHUbm/fXqGg+sL+ZW2b tsukgeZR59z3YaTb0tXgndwTmwvj0EFFmaGAPaUwS8jK2RrNZIAqq4U4wW8NPdWmnCe/wv mrIhklde2hwm8BD0/zlp3shMmi6WdQBqywsCdXTHUX/DSH1OByUNY8D3m9E4PnYadm6lyW FXzXbnBDpSixaE8XSOop4kWFaid6GZWMDD7uSzkGoSxOzhpwS0ryDlgTE3gg6oMQKCRLy8 iIKiBmM1sEvrifRdl4omneVmjfV7h8LJZZWZ/smaW6tnc3eJD3v7E2KrT+Iw8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649169747; a=rsa-sha256; cv=none; b=TZWYqtFkQlJB2AMSsxME6YM+7tlzpoioIbpTbrEBDmD6i5pusWb7VI5VkAe0tkPpiI0gUW T0vTTorqpjCOKWcfry4NaFNo2kQPDaYyHZlILg7lmF12T95kF6H32+qrjxqBwAa77VEkRl KbpoAIMGfdeqNluteGrXG/Fy4h8IebIrNTkKQPP+GYXar0hEOqoIfdX14b+QJn1DJkpUJV v0BnsGbbX1nUGp2rR1wM+nA1YECJujx0jA+wFPetsugIHgewT3Dp9cRwNsr7GDDxS/2bCu KiTdWS2BHXKPP3X0I2wuLMEnOYdRZ5OXGovrZbaox7h5+hQlTrewAiiiDcBugA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f3d11894be6fb727be77184d232de24bf5551ba commit 2f3d11894be6fb727be77184d232de24bf5551ba Author: Warner Losh AuthorDate: 2022-04-05 05:05:26 +0000 Commit: Warner Losh CommitDate: 2022-04-05 14:40:10 +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 (cherry picked from commit 36929b55849c8f553a744d6e4fbc8b1a5ff73f66) --- 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) {