From nobody Tue Apr 05 05:10:03 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 B48F01AA377F; Tue, 5 Apr 2022 05:10: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 4KXbLM70ZTz3hWZ; Tue, 5 Apr 2022 05:10:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649135404; 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=s/ssAT5SS3D0LgCZDwWhr/DeYyzp2G8OvwvMldCyDTg=; b=r5iKIlsdTaSxNAflliskb/iptIM0ixOI374o4B8MsJQC6YgbXcVZDThTfVEFkj/f7koSJN zEA3NVdQTdYNL8+Dm3/2dGPZG41ql53VFGwkeW7UFiofX/NtZtyDfNVU3Q9P4g1u3IXg+v f69b9Dl7OcHp3797o2hYpNCyGe473QQBfVVsyD/kg7vuyszLfEeEWMRlXFNpVhly/cnWT7 vswOSNA1RpxSv4nqlcDnGXR5rPva02YdOmgbewo7wClYetzbu73fVieurX9LF6ofhbYEL8 zFXYk29wydsZ5vHxmyyLo1Q0a3koiGcr3uoaXImnZBqy1i+dXy3hp6D6aYb8hQ== 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 B1846203A8; Tue, 5 Apr 2022 05:10: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 2355A3Pt053506; Tue, 5 Apr 2022 05:10:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2355A3JC053503; Tue, 5 Apr 2022 05:10:03 GMT (envelope-from git) Date: Tue, 5 Apr 2022 05:10:03 GMT Message-Id: <202204050510.2355A3JC053503@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: aca0bcbca344 - main - linuxkpi: Move cdev_alloc into .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: aca0bcbca344b39f2a448e8c1c0d80bac8c0d6de Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649135404; 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=s/ssAT5SS3D0LgCZDwWhr/DeYyzp2G8OvwvMldCyDTg=; b=mUpSRPmVrrgkH8SsCi9nxviB8jBfbtgtpBGzl8K6A47Urba3Cv4/9CzZmRpy7lh5bJh8i7 bB3DZ9SaLu+ZWuAzJafviE0PPDHYqXm8asTKDQA9MkfCQ9qkYqqxYRmwHU+YLFcyltS+Yo JIjpNxgch6YnEffPke/sSaZv5JV6KUgDK1d1UA8a3cWx8uMbgHaqplZAGC/9NRhyLaYC/I 6Stbmi+Hkj1fYrFNbrqXotYgPbDy/0hCtvYjaGGq0uJ3oePVI5e3jCzBJL1pTydjc237Ey 26uLyx5ehzAboJtVkwwYi0au8wG6/mL95jRlvSQqauoWXr57i63dnMBUDLBt7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649135404; a=rsa-sha256; cv=none; b=bPc491zOTn7DUedakJ1BMOksHnrD8EyU7LD9q6PO2nX/eInaZrkIOW6WG+x+Ttn0HtdiHA SGuQLLjohlngyZjJQxETHwzsHhJdmI5GlXOevjHfLxujLMan6YCOjFwJJIUDGaf+yYBFeG y8XSnzFb7FNGYbBQjlJeImgKHa6a1tV8Ql2YJ1eCkJEhUrsVLQ2kYdSu4o9YobH/Wo4L/P mj+Sh3CUF0XqpVGW3aIKUChYcgdkZPA69SqgNnu51zcHdXTnw2F4AYYRoSdofgIqK40kX3 z0dMcJSs3SSXXB8gTw9OjT8wfv5HmzsVBdgSWLgnsdQrRd8QgfwhhHyqcw5kuA== 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=aca0bcbca344b39f2a448e8c1c0d80bac8c0d6de commit aca0bcbca344b39f2a448e8c1c0d80bac8c0d6de Author: Warner Losh AuthorDate: 2022-04-05 05:05:59 +0000 Commit: Warner Losh CommitDate: 2022-04-05 05:05:59 +0000 linuxkpi: Move cdev_alloc into .c file Move cdev_alloc into linux_compat.c since it encodes the size of struct linux_cdev into the client modules otherwise. Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34771 --- sys/compat/linuxkpi/common/include/linux/cdev.h | 13 ++----------- sys/compat/linuxkpi/common/src/linux_compat.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h index fb7a3cf0b447..2befe9b259cb 100644 --- a/sys/compat/linuxkpi/common/include/linux/cdev.h +++ b/sys/compat/linuxkpi/common/include/linux/cdev.h @@ -57,6 +57,8 @@ struct linux_cdev { u_int siref; }; +struct linux_cdev *cdev_alloc(void); + static inline void cdev_init(struct linux_cdev *cdev, const struct file_operations *ops) { @@ -66,17 +68,6 @@ cdev_init(struct linux_cdev *cdev, const struct file_operations *ops) cdev->refs = 1; } -static inline struct linux_cdev * -cdev_alloc(void) -{ - struct linux_cdev *cdev; - - cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK); - kobject_init(&cdev->kobj, &linux_cdev_ktype); - cdev->refs = 1; - return (cdev); -} - static inline void cdev_put(struct linux_cdev *p) { diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 404b0e0857a5..52dc010b100f 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -602,6 +602,17 @@ linux_file_free(struct linux_file *filp) } } +struct linux_cdev * +cdev_alloc(void) +{ + struct linux_cdev *cdev; + + cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK); + kobject_init(&cdev->kobj, &linux_cdev_ktype); + cdev->refs = 1; + return (cdev); +} + static int linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, vm_page_t *mres)