From nobody Tue Apr 5 14:42:30 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 22A161A8F1D7; Tue, 5 Apr 2022 14:42:31 +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 4KXr2t4Jk9z4c8M; Tue, 5 Apr 2022 14:42:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649169751; 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=7nimu0fLixPQRlXn1ETiUirPT1ldSojelruxFMXIVF8=; b=Zwtew0k4EajgSKXAoEu6Ovj7/LA4+QskcPh9rUlsTns4oQY0+cbBXqtAEWva/4Z23gApJK cQzkNMuh49So7Wx9uGqLl1pgzkDrsRNgLps6VJEpyzTVfoOj3dgCtJhVqEp3KRzB48DJeL zpJGuHxCijxvNes3shpFzgKg9O+FuBpYg+S6we6Q7oBRRr2Bl942lJaSxlFKkQE3BSnIFN C8ZHmufxgsn8VrOdBAwmh6NaSL4s7WFXhnWCDFYmwblvsjxVBKMnKt9UdQ+vpRQM736s+q 9nDLBINCJeVdpQV4A+kDdOmoBfAHJzGwh6zA9HraMGjF75JXilR/4Zo9e7VXhA== 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 3E2C5882; Tue, 5 Apr 2022 14:42:30 +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 235EgUBs030006; Tue, 5 Apr 2022 14:42:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 235EgU2G030005; Tue, 5 Apr 2022 14:42:30 GMT (envelope-from git) Date: Tue, 5 Apr 2022 14:42:30 GMT Message-Id: <202204051442.235EgU2G030005@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: d1f93d6721a6 - stable/13 - linuxkpi: Move cdev_alloc into .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/stable/13 X-Git-Reftype: branch X-Git-Commit: d1f93d6721a6c51c0cb49078ad5c5d535a383964 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649169751; 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=7nimu0fLixPQRlXn1ETiUirPT1ldSojelruxFMXIVF8=; b=Av48GG+CkUtuuW6dtA67rsR4FAtU4O+u5+Ee4zYzkQpFnNtz+W8zq6qJZTmoSoB3TpIxIA cMViSrmCdF3WiLy2z+Omp7yvEOQOJBRdKnKti18Ohwf4IH7qE+VPjMw3SIzDE1hdaM3QnM gR3Gjkqw7esA23aZzWLKxgp4IDkLRzcFceXfAsai3XjaVvNlNZsBaSKDFifLwLcwysHRUY Zf+XA16vb9o3jzskfCo5M/+MTRh8/r6NMx3XynqJK57d1H3HaF+OeEhBRLTQMxt3N94+Hw 2JrXGyTWld0ZI62VXLjYfXnydBVegnE25r3H5NKdZPFzI4+2HFJC1Qv0yUCUdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649169751; a=rsa-sha256; cv=none; b=Cf8c/t5btpeTna7zK81qiFQmFqxYiDTM7CLGjfduONu9+NB2jXChFa9LmqAVbmmNsI3bF+ w6nRe0jDIoKAcFVG4TEgJjGLLeGl1sS2oUCS6VBFWfMSck7FE6RFujTyZV/WD8G8vVkuvk nWxyhQhAtHCOnf9aLu8yYxC6gaYwrWYA6o3hkBWTLRudUXLzT2brTYyAc2HZSxTUY91QmF gO2eCF4VkXY2TbGMIA+S5y5mTFLqrYLjwEbG/gWcx3RatKTiDwOaeNgxDn1Jehgcj6mNsa RNwHh4djSkQL8jlp0jsToUnK2lAUCyTJsp3mXydezcUm/UQce4wqyWt8mv8okg== 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=d1f93d6721a6c51c0cb49078ad5c5d535a383964 commit d1f93d6721a6c51c0cb49078ad5c5d535a383964 Author: Warner Losh AuthorDate: 2022-04-05 05:05:59 +0000 Commit: Warner Losh CommitDate: 2022-04-05 14:40:10 +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 (cherry picked from commit aca0bcbca344b39f2a448e8c1c0d80bac8c0d6de) --- 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 7a3378f57b3a..a146b7bc9aa0 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -601,6 +601,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)