Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2662111pxb; Tue, 9 Mar 2021 07:58:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoHexqgX+qDTURLWlZ4nkLQDtWotsuNCx0KMaX6qtXs51gvfmyyRatc7pm04Vt/pDj+AtL X-Received: by 2002:aa7:c903:: with SMTP id b3mr4941092edt.156.1615305517047; Tue, 09 Mar 2021 07:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615305517; cv=none; d=google.com; s=arc-20160816; b=s+4MKfkMckakjMSJFsEqn5q8gfEhZgjoQr+yP0ud8j2l1UDgUTqRpjVlwq8zmoHO9e D2Xj1EMkIRB6X1MWxuLHJm4VxF4XfKAtsCbF28HBJQbwBjauRfxj6+Kx+ny5nGWaFZbz pbImUg5M/42cegKcxMjHXLOQ1YePO2o5DueWLoHbk7IVwh4K3bsVbF3knV8jJEDbsZ7A jYXBL9rLFnlFsENEUll0ogR1KTjL9T1MAYMD4w0C0zzmewR7P2/DN2xNzxZsfXTI6Vce Bup5F4oW9kEyy8yqgm4Kijq5zwsMayAvWuQwRj86D7CmdTDeLKSmXUY+JNhZXH0JqDXj bidw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H2ld+QgidDGzgxm+N1lJ7nVSOxHC57yc0v6xTacIbY4=; b=pJM410flAPyos35kGiJaOGoZhKlIk7waY2EJ5a90NdSuEF32mrek1i/gPpVX1+rXU6 yMXXEtL/rMhcDK0j+WRy+cNs7SobW+Z76YoCXrlkQOOTiquzjTFfIzOb3tc9iq5vu1Nc Xhy6VBsI3sfGAR5HPiBVsxnYDasxnKsHAi7TD8DqKAei+brB0DtZWQfwHqwMjSnx2Deb ISxFbcElzXVJp+KMyLn5a2jE34FuSMLoy9vq/lgxget2LKKD+ory5YEVhPoDIuq2fL8R JPtGP9sTVISDcc+wvVYWQJXqrIdUgcTSWfjoO3NTs308sF6t7V8ZCP1lAt+1e+1cnYB+ ajrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iK2JlFyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si9128197edt.491.2021.03.09.07.58.14; Tue, 09 Mar 2021 07:58:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iK2JlFyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbhCIP4y (ORCPT + 99 others); Tue, 9 Mar 2021 10:56:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbhCIP4W (ORCPT ); Tue, 9 Mar 2021 10:56:22 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8DC9C06174A; Tue, 9 Mar 2021 07:56:21 -0800 (PST) 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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=H2ld+QgidDGzgxm+N1lJ7nVSOxHC57yc0v6xTacIbY4=; b=iK2JlFyhSt2fAxdUtndJ31jjUd hNycyMaLROgr5IP/6Vd9G0ejFwt4PjtbUOIllT6lpcyNO5JSrh2jzNp2gMWO+ruzsynjop/tobJfY Ktw36wP3bjGaJFUqad8boRQbzSj/WVqC2vdDF1erI4/UR8j/TiljW5ZWLiSLDSKyNVvtr+fZ51EBV pCBrYUDXEQT4MqRPo4dXzQFXnfTWXGQxciUvtoMiNYfJ8YId0Jxl0+zNdyZ/Wd4dtmXuU6KZ77azt BWf2kqMD8H4xw36e5pyhM+5SVtwMNqv43fs7ARRc/rD1HyYU5hEmwq8fHIT4tm/rith+FefXPeIqW /gsKX6iQ==; Received: from [2001:4bb8:180:9884:c70:4a89:bc61:3] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lJehM-000lUZ-SR; Tue, 09 Mar 2021 15:55:09 +0000 From: Christoph Hellwig To: Al Viro Cc: Andrew Morton , Daniel Vetter , Nadav Amit , "VMware, Inc." , "Michael S. Tsirkin" , David Hildenbrand , Minchan Kim , Nitin Gupta , Jason Gunthorpe , Alex Williamson , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 7/9] iomem: remove the iomem file system Date: Tue, 9 Mar 2021 16:53:46 +0100 Message-Id: <20210309155348.974875-8-hch@lst.de> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210309155348.974875-1-hch@lst.de> References: <20210309155348.974875-1-hch@lst.de> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- kernel/resource.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 0fd091a3f2fc66..12560553c26796 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1838,37 +1839,14 @@ static int __init strict_iomem(char *str) return 1; } -static int iomem_fs_init_fs_context(struct fs_context *fc) -{ - return init_pseudo(fc, DEVMEM_MAGIC) ? 0 : -ENOMEM; -} - -static struct file_system_type iomem_fs_type = { - .name = "iomem", - .owner = THIS_MODULE, - .init_fs_context = iomem_fs_init_fs_context, - .kill_sb = kill_anon_super, -}; - static int __init iomem_init_inode(void) { - static struct vfsmount *iomem_vfs_mount; - static int iomem_fs_cnt; struct inode *inode; - int rc; - - rc = simple_pin_fs(&iomem_fs_type, &iomem_vfs_mount, &iomem_fs_cnt); - if (rc < 0) { - pr_err("Cannot mount iomem pseudo filesystem: %d\n", rc); - return rc; - } - inode = alloc_anon_inode_sb(iomem_vfs_mount->mnt_sb); + inode = alloc_anon_inode(); if (IS_ERR(inode)) { - rc = PTR_ERR(inode); - pr_err("Cannot allocate inode for iomem: %d\n", rc); - simple_release_fs(&iomem_vfs_mount, &iomem_fs_cnt); - return rc; + pr_err("Cannot allocate inode for iomem: %zd\n", PTR_ERR(inode)); + return PTR_ERR(inode); } /* -- 2.30.1