Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1179515rwo; Wed, 2 Aug 2023 09:50:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHpu2RLP71FXNKZ+V8xGahPhqMVDfcqrXKFsyPaYJhYNUmp0fO/Pl8fc+/p1EGWs+5FY/tF X-Received: by 2002:aa7:d856:0:b0:51d:d30d:a037 with SMTP id f22-20020aa7d856000000b0051dd30da037mr5645907eds.10.1690995013783; Wed, 02 Aug 2023 09:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690995013; cv=none; d=google.com; s=arc-20160816; b=t5TJTX83bQ6MnzJSAjwfC5NcAE4bw5YafJmzy9EQmL75FZVFWjPLd1yxCVgDeFc9V9 Wmk/7snK/NqumLH3ixMAriMzvHZq1+PGx3NDCkegGmiWhYiR6dPeHxfjMpPLxgwRDFt6 DEn2KuJn267EMSafJOsEpzcIfcpKPGUT+l0vzsGoSu/6JKB2cZsr8b4ffhySwtMaB+YF B69IeoPDF8vp5TjfanAXXg0pVqFUghil1FdCjKqaorMLmIUcvlrtQ1msDj2lwWXBVuJS E/dHciaa358ePjE8Hsa2Mq42miSntMKeFIVg2c4Wdx1h3xM22svcbodeyQbfNofE+5yP ANXw== 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=i4RVxh7cqcfhStKnrFuIVUqPlurNIlyMZ1NDN212nv0=; fh=EY4nBjRR1THbvUmIeG1UZvfGbBl7lvcJq64vCzE68S8=; b=O6E57ZYDYCInnWnAhd/w8sWYzWUD9sy65IefTCQeJb8zUnf7gHgCKVUR+ie3pspaaV VHEF4kMZ5mXX/ySbQUiaqG52TSV9wVQWpwzzD007E+AXWV2AsetkPv4hLO+zh/eqQuCb VtvnaikJs2/h0n0RaXKyz/y7QUCaEuzA1dRInaqhbwr7lKjge25utXPSC08NvSgGUzl4 v9WSkdtNNkdcI76Q88o2X2wRT3U3q+SYkjNv89+QlhzdKn3begELVSfnwC2NYEycpbWq Dg04F4lWeL9DCEvr92GHn2kURDmsf9rAbrJMZGii6iI5xOqYWAXmKhEor92F/mJxOXQq L/NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=m9OaeC94; 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 l10-20020a056402344a00b0051ddfc275b8si9716261edc.421.2023.08.02.09.49.48; Wed, 02 Aug 2023 09:50:13 -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=m9OaeC94; 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 S232504AbjHBPou (ORCPT + 99 others); Wed, 2 Aug 2023 11:44:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235312AbjHBPmf (ORCPT ); Wed, 2 Aug 2023 11:42:35 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4627D2695; Wed, 2 Aug 2023 08:42:23 -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=i4RVxh7cqcfhStKnrFuIVUqPlurNIlyMZ1NDN212nv0=; b=m9OaeC94Czmbb5hPBahN8SXBqI HNi7Mt4xq8QD0KfNROKtIz4cWo24dWSBz7X8e50X0RB4sQ5tkio4jz+r4r8ZXafkW2ww175yxfozT NCUZO2qzsSFjl3BFFlIRN3Wfa2mzIAi3PGZkD8Cd957ycv8VcxS6B+Gl86ETq6tCRKfhACSRqvwK7 ZdYNXIQB/XHcCPAEwZsU/ppTsd8l/Kd7bPks6ODFCghe5WMh0L9iLVh6NfcG8q01AnZzhLKiyX/4B 4MY4Wr/7eVJVJE1UTa4EMeC4cbXZti0JxzrFZGHMr43Ix5mWyHHev/cZbWwF9pp4HCsk18N+iH6el wjXcrqPw==; 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 1qRDzN-005GOT-0f; Wed, 02 Aug 2023 15:42:17 +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 12/12] xfs use fs_holder_ops for the log and RT devices Date: Wed, 2 Aug 2023 17:41:31 +0200 Message-Id: <20230802154131.2221419-13-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 or RT device goes away instead of duplicating the logic. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index d5042419ed9997..338eba71ff8667 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -377,17 +377,6 @@ xfs_setup_dax_always( return 0; } -static void -xfs_bdev_mark_dead( - struct block_device *bdev) -{ - xfs_force_shutdown(bdev->bd_holder, SHUTDOWN_DEVICE_REMOVED); -} - -static const struct blk_holder_ops xfs_holder_ops = { - .mark_dead = xfs_bdev_mark_dead, -}; - STATIC int xfs_blkdev_get( xfs_mount_t *mp, @@ -396,8 +385,8 @@ xfs_blkdev_get( { int error = 0; - *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, mp, - &xfs_holder_ops); + *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, + mp->m_super, &fs_holder_ops); if (IS_ERR(*bdevp)) { error = PTR_ERR(*bdevp); xfs_warn(mp, "Invalid device [%s], error=%d", name, error); @@ -412,7 +401,7 @@ xfs_blkdev_put( struct block_device *bdev) { if (bdev) - blkdev_put(bdev, mp); + blkdev_put(bdev, mp->m_super); } STATIC void -- 2.39.2