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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 C0BFFC433DF for ; Fri, 16 Oct 2020 13:42:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 496C020848 for ; Fri, 16 Oct 2020 13:42:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="eM5+C5kR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408359AbgJPNmw (ORCPT ); Fri, 16 Oct 2020 09:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407357AbgJPNmw (ORCPT ); Fri, 16 Oct 2020 09:42:52 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB59C061755 for ; Fri, 16 Oct 2020 06:42:51 -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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=dVC+oPNA4c4mlsDL++B4TVjVYz10iLER5z4ZQesiGIY=; b=eM5+C5kRXJ1pfqMo0qB9WLz0z5 8dh75k//TeG5yIjspl6X93BYUz5CLSa9qfBJWZ3ma7NQJPp+xNm67JpmdMICr4sJ6iiQzyl9GD2Hq e9iJznKdcEopyPWYwulpYQ5WkxmVm3R/mgbAKqDLvHEMN7M0Tz+jUk3eKNPpUr8PhMekss2oyHOaK KAjfTQZDKnfCfoLFl8yLovCOABYZTdEJ7qqK1tXtSdhFMORb0foC6ryu9BS0AeQJSLDwVrGwxStHD afpFddoHmlo0aB5QiQWcNjlw3WU6ysnliFXf8taqpAuAXnH62oaEvU21X1FLCncYOZF69wjnPuGuD 2W5996iA==; Received: from 213-225-9-134.nat.highway.a1.net ([213.225.9.134] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTQ0K-00042I-JW; Fri, 16 Oct 2020 13:42:44 +0000 From: Christoph Hellwig To: Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , WeiXiong Liao Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] pstore/blk: don't depend on CONFIG_BLOCK Date: Fri, 16 Oct 2020 15:20:47 +0200 Message-Id: <20201016132047.3068029-10-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016132047.3068029-1-hch@lst.de> References: <20201016132047.3068029-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 pstore-blk contains of two different layers: a) a tiny layer of sugar coating ontop of pstore-zone. This part has no dependencies on the block layer, and can be used e.g. by mtd b) an implementation of a default fallback pstore zone backend for block devices Add an ifdef for the latter so that pstore-blk itself does not have to depend on CONFIG_BLOCK. Signed-off-by: Christoph Hellwig --- fs/pstore/Kconfig | 2 +- fs/pstore/blk.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig index e16a49ebfe546d..6eadb538316e52 100644 --- a/fs/pstore/Kconfig +++ b/fs/pstore/Kconfig @@ -164,7 +164,7 @@ config PSTORE_ZONE config PSTORE_BLK tristate "Log panic/oops to a block device" depends on PSTORE - depends on BLOCK + depends on BLOCK || !BLOCK select PSTORE_ZONE default n help diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c index bd4eadfc9bd795..d3d25edb943cdd 100644 --- a/fs/pstore/blk.c +++ b/fs/pstore/blk.c @@ -182,6 +182,7 @@ void unregister_pstore_device(const struct pstore_zone_ops *ops) } EXPORT_SYMBOL_GPL(unregister_pstore_device); +#ifdef CONFIG_BLOCK static struct file *psblk_file; static ssize_t psblk_generic_blk_read(char *buf, size_t bytes, loff_t pos) @@ -269,6 +270,7 @@ void __init pstore_blk_early_init(void) __pstore_blk_init(devname); } #endif /* MODULE */ +#endif /* CONFIG_BLOCK */ /* get information of pstore/blk */ int pstore_blk_get_config(struct pstore_blk_config *info) -- 2.28.0