From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 06/24] md: open code vfs_stat in md_setup_drive Date: Wed, 22 Jul 2020 08:44:32 +0100 Message-ID: <20200722074432.GD2786714@ZenIV.linux.org.uk> References: <20200721162818.197315-1-hch@lst.de> <20200721162818.197315-7-hch@lst.de> <20200721165539.GT2786714@ZenIV.linux.org.uk> <20200721182701.GB14450@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200721182701.GB14450-jcswGhMUV9g@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Christoph Hellwig Cc: 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 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. As for the prototypes... include/linux/init_syscalls.h, perhaps? 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=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 E7304C433E1 for ; Wed, 22 Jul 2020 07:44:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA9ED20714 for ; Wed, 22 Jul 2020 07:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728101AbgGVHol (ORCPT ); Wed, 22 Jul 2020 03:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726153AbgGVHok (ORCPT ); Wed, 22 Jul 2020 03:44:40 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A2AC0619DC; Wed, 22 Jul 2020 00:44:40 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jy9QW-000ABC-Ed; Wed, 22 Jul 2020 07:44:32 +0000 Date: Wed, 22 Jul 2020 08:44:32 +0100 From: Al Viro To: Christoph Hellwig Cc: 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: <20200722074432.GD2786714@ZenIV.linux.org.uk> References: <20200721162818.197315-1-hch@lst.de> <20200721162818.197315-7-hch@lst.de> <20200721165539.GT2786714@ZenIV.linux.org.uk> <20200721182701.GB14450@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200721182701.GB14450@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. As for the prototypes... include/linux/init_syscalls.h, perhaps?