From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 06/24] md: open code vfs_stat in md_setup_drive Date: Wed, 22 Jul 2020 16:05:25 +0200 Message-ID: <20200722140525.GA16395@lst.de> References: <20200721162818.197315-1-hch@lst.de> <20200721162818.197315-7-hch@lst.de> <20200721165539.GT2786714@ZenIV.linux.org.uk> <20200721182701.GB14450@lst.de> <20200722074432.GD2786714@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200722074432.GD2786714-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Al Viro Cc: Christoph Hellwig , Linus Torvalds , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-raid.ids On Wed, Jul 22, 2020 at 08:44:32AM +0100, Al Viro wrote: > On Tue, Jul 21, 2020 at 08:27:01PM +0200, Christoph Hellwig wrote: > > On Tue, Jul 21, 2020 at 05:55:39PM +0100, Al Viro wrote: > > > How about fs/for_init.c and putting the damn helpers there? With > > > calling conventions as close to syscalls as possible, and a fat > > > comment regarding their intended use being _ONLY_ the setup > > > in should-have-been-done-in-userland parts of init? > > > > Where do you want the prototypes to go? Also do you want devtmpfs > > use the same helpers, which then't can't be marked __init (mount, > > chdir, chroot), or separate copies? > > Hmm... mount still can be __init (devtmpfs_mount() is), and I suspect > devtmpfs_setup() could also be made such - just turn devtmpfsd() > into > static int __init devtmpfsd(void *p) > { > int err = devtmpfs_setup(p); > > if (!err) > devtmpfsd_real(); /* never returns */ > return err; > } > and you are done. Yes, that seems to work. We can obviously call non-__init functions from __init ones, and kthread_run doesn't seem to care if it gets passed a __init function. Here is what I have now: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init_path From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD83FC433E3 for ; Wed, 22 Jul 2020 14:05:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACAEA20656 for ; Wed, 22 Jul 2020 14:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732501AbgGVOFa (ORCPT ); Wed, 22 Jul 2020 10:05:30 -0400 Received: from verein.lst.de ([213.95.11.211]:56460 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728837AbgGVOF2 (ORCPT ); Wed, 22 Jul 2020 10:05:28 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 7C57268B05; Wed, 22 Jul 2020 16:05:25 +0200 (CEST) Date: Wed, 22 Jul 2020 16:05:25 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Linus Torvalds , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH 06/24] md: open code vfs_stat in md_setup_drive Message-ID: <20200722140525.GA16395@lst.de> References: <20200721162818.197315-1-hch@lst.de> <20200721162818.197315-7-hch@lst.de> <20200721165539.GT2786714@ZenIV.linux.org.uk> <20200721182701.GB14450@lst.de> <20200722074432.GD2786714@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722074432.GD2786714@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2020 at 08:44:32AM +0100, Al Viro wrote: > On Tue, Jul 21, 2020 at 08:27:01PM +0200, Christoph Hellwig wrote: > > On Tue, Jul 21, 2020 at 05:55:39PM +0100, Al Viro wrote: > > > How about fs/for_init.c and putting the damn helpers there? With > > > calling conventions as close to syscalls as possible, and a fat > > > comment regarding their intended use being _ONLY_ the setup > > > in should-have-been-done-in-userland parts of init? > > > > Where do you want the prototypes to go? Also do you want devtmpfs > > use the same helpers, which then't can't be marked __init (mount, > > chdir, chroot), or separate copies? > > Hmm... mount still can be __init (devtmpfs_mount() is), and I suspect > devtmpfs_setup() could also be made such - just turn devtmpfsd() > into > static int __init devtmpfsd(void *p) > { > int err = devtmpfs_setup(p); > > if (!err) > devtmpfsd_real(); /* never returns */ > return err; > } > and you are done. Yes, that seems to work. We can obviously call non-__init functions from __init ones, and kthread_run doesn't seem to care if it gets passed a __init function. Here is what I have now: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init_path