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=-11.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 30884C433E8 for ; Tue, 28 Jul 2020 16:36:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10A4E207FC for ; Tue, 28 Jul 2020 16:36:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="mspBTjUW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731900AbgG1Qgb (ORCPT ); Tue, 28 Jul 2020 12:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731429AbgG1QeZ (ORCPT ); Tue, 28 Jul 2020 12:34:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D09AC061794; Tue, 28 Jul 2020 09:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=kVQtb0EC5zPxTA2ayYfBJx4HY/CNxKUjYbbIch9w8To=; b=mspBTjUWtgpPb4qLvI5PjYWwOM 4xZNHTabFfBvssqH7c/39Sc1ekp+M5+SqBDUYBkt2ucniLwNBWaq94zkkYOoIAPj/UaRMf4mtx3YK W0L5iZg+7xHA9TiFXC8u5fc6fYHDe6CT6b15J8Oesifa05gXH7hnFa0iYkc8g+AcyI/0rNI4O8Ox0 obSdlxKChKraUYqMq1yyafpl/in4CI0Hav66IYrJPtqDtGUSPZR2/x9DBfWbuLTlo8NYaOgCPZqJD OvUuAnCvA43Twt/6GA+RD8XxJ33FRrI6T32fxA0LxAHyvgCch5i6HSuh9FxyNeJUH2sjVKeCH7mvP Ev8vTchw==; Received: from [2001:4bb8:180:6102:fd04:50d8:4827:5508] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0SYV-0006wk-6T; Tue, 28 Jul 2020 16:34:19 +0000 From: Christoph Hellwig To: Al Viro , Linus Torvalds Cc: 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: add file system helpers that take kernel pointers for the init code v4 Date: Tue, 28 Jul 2020 18:33:53 +0200 Message-Id: <20200728163416.556521-1-hch@lst.de> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hi Al and Linus, currently a lot of the file system calls in the early in code (and the devtmpfs kthread) rely on the implicit set_fs(KERNEL_DS) during boot. This is one of the few last remaining places we need to deal with to kill off set_fs entirely, so this series adds new helpers that take kernel pointers. These helpers are in init/ and marked __init and thus will be discarded after bootup. A few also need to be duplicated in devtmpfs, though unfortunately. The series sits on top of my previous "decruft the early init / initrd / initramfs code v2" series. Git tree: git://git.infradead.org/users/hch/misc.git init_path Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init_path Changes since v3: - rename fs/for_init.c to fs/init.c - document the purpose of the routines in fs/init.c with a comment - don't mark devtmpfs __init as that will cause it to get overwritten by initmem poisoning - add an init_dup helper to make Al more happy than with the version commit to the "decruft the early init / initrd / initramfs code v2" series Changes since v2: - move to fs/for_init.c - reuse the init routines in devtmpfs after refactoring devtmpfsd (and thus the broken error handling in the previous version) - actually use kern_path in a place where user_path_at sneaked back in Changes since v1: - avoid most core VFS changes - renamed the functions and move them to init/ and devtmpfs - drop a bunch of cleanups that can be submitted independently now Diffstat: