Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1114190rwo; Wed, 2 Aug 2023 08:56:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYssNXi440d+5niGcMchfx7drpVetSYzrP7/PE6sh5TetPqjxcSBsclRP0Pgqw7t+UgkSM X-Received: by 2002:a2e:9049:0:b0:2b5:bc27:d6eb with SMTP id n9-20020a2e9049000000b002b5bc27d6ebmr5124553ljg.8.1690991777095; Wed, 02 Aug 2023 08:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690991777; cv=none; d=google.com; s=arc-20160816; b=rr2Hq4n94tKijeXXSy0MOKTNUa32Cv7xf6V8/Ww3xhG29Ru0VIkX+uu+GNoyCNK8R0 DH08AhArlZ8pfK4hQqC9hV8P9RVa1wl3wxpthrbs62TaQwqAMd/Bco04EsgjXwgo7INz vUbA8MwFJsl7UrzCeWWzXewDjLCOSthbhdn+dhubT/WLJVITC20mFpvQUAoSJqVI38Ly a8qNYWtJtJ8R2tx5i39Q3ESVZd8lYBNTmTtsIdtINUbkJWumC0Q8pVJdxETJl8S8TqMW TbNCfPxmaL9KCY4ChPYutAnnvv35lk+c/4/qbXxhPEcKp1t/oBEtZwJUS9utJEDGhd/n qQCg== 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=t1/fXxbj2uJU5xas1rDU20QLxJIeGJx3IPPvaW9KT9Y=; fh=EY4nBjRR1THbvUmIeG1UZvfGbBl7lvcJq64vCzE68S8=; b=Vj750lXx8W8Glj11Bo3H5TcZX+sWOL11krVZjtMtxZSusUH8GehltHf5Kl2nxtD5Xk ueNQoEs3k0h0qKguw0Ef306iiL+2DZNlkjroXSZpnpu4H0e+rZfdnt1MKwIgVQgn7Soy vMfJCRi4mQa/CNERSPjqxxttDr20qRRNhakVPVb0TIyCNEbfPpImBRWb+0//Cq6BSOHq Qof5tyJbSR3nGvdfrrULnT+7IRJukVD2HUnHfqn/Vj62RQVxGU5CctUjHK3ug9REHDbc /FNDJRUA88zpS1svXEvnLiv50Y4mQ5HaiYEproFpPQ/h0PnQasDUU4BXbxytLvlP/y3j fJfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2i+Ccpco; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020a17090634d300b0098770b8882dsi6572170ejb.1030.2023.08.02.08.55.53; Wed, 02 Aug 2023 08:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2i+Ccpco; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234314AbjHBPnc (ORCPT + 99 others); Wed, 2 Aug 2023 11:43:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235299AbjHBPm1 (ORCPT ); Wed, 2 Aug 2023 11:42:27 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E49422689; Wed, 2 Aug 2023 08:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=t1/fXxbj2uJU5xas1rDU20QLxJIeGJx3IPPvaW9KT9Y=; b=2i+CcpcoXVSq4J7NqyEaRQu0MS DSsA4T4HQ7JZ+g7Ov6bcczZ/tpF4ZkTz9NxECM9geFk5dv1/TztPUrp17xFtlDXKLyoX3pkpemqeB OQPpsZdYMVdmbDglOG0I9dpqcqqeyV/XjkQ67mNuOFgWIEwDlobHlmhsm0iPi3w+6wR+6G5B1YZQP iWapYBcFtpmWKbvl+Jn8/7LBe0gSETLk1M6EwK0Ny2GMRQFmOIyT6N6Ad/dzBzf+vmZA2pOhMR8re MOaux36gSAexWnIViecm5TMwu6JeqWJ/qWyq27xWHNPjx/AhL2CBf5lfuvqnCDWkGqZsv5nzmKORQ JAio8dFQ==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qRDzG-005GLm-2Q; Wed, 02 Aug 2023 15:42:11 +0000 From: Christoph Hellwig To: Al Viro , Christian Brauner Cc: Jan Kara , Chris Mason , Josef Bacik , David Sterba , "Theodore Ts'o" , Andreas Dilger , Jaegeuk Kim , Chao Yu , Ryusuke Konishi , "Darrick J. Wong" , Jens Axboe , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH 10/12] ext4: use fs_holder_ops for the log device Date: Wed, 2 Aug 2023 17:41:29 +0200 Message-Id: <20230802154131.2221419-11-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230802154131.2221419-1-hch@lst.de> References: <20230802154131.2221419-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use the generic fs_holder_ops to shut down the file system when the log device goes away instead of duplicating the logic. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 2ccb19d345c6dd..063832e2d12a8e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1096,15 +1096,6 @@ void ext4_update_dynamic_rev(struct super_block *sb) */ } -static void ext4_bdev_mark_dead(struct block_device *bdev) -{ - ext4_force_shutdown(bdev->bd_holder, EXT4_GOING_FLAGS_NOLOGFLUSH); -} - -static const struct blk_holder_ops ext4_holder_ops = { - .mark_dead = ext4_bdev_mark_dead, -}; - /* * Open the external journal device */ @@ -1113,7 +1104,7 @@ static struct block_device *ext4_blkdev_get(dev_t dev, struct super_block *sb) struct block_device *bdev; bdev = blkdev_get_by_dev(dev, BLK_OPEN_READ | BLK_OPEN_WRITE, sb, - &ext4_holder_ops); + &fs_holder_ops); if (IS_ERR(bdev)) goto fail; return bdev; -- 2.39.2