Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp512979rdf; Tue, 21 Nov 2023 08:33:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFcm+oCLIQafzvvLESxlq9aQBm6l6hiK7qY0rBphEMV1X5sZbLVe1K+wRuBzIWK02J8ADC X-Received: by 2002:a05:6808:1385:b0:3a7:2690:94d5 with SMTP id c5-20020a056808138500b003a7269094d5mr15093380oiw.8.1700584405264; Tue, 21 Nov 2023 08:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700584405; cv=none; d=google.com; s=arc-20160816; b=xfsii38Jl0OF3DQmoFLnE7qApyKL1pu8abovLYCEiHnSblWTGR1K06Z1cXAuFdvhAb EJoY+U0TljCzZ9mYG6QJkFfoMVVOsMrVejNAyXu238AeDQqwG8eWtMRAloL7rL6qNXjg RtSfjQ1nyqYNazOvyFmpCH5LN/JgQ6wiewZ82j7BQXs2OywQbCJJCpaq0Sx6XqmCyWll v2MYXtROWMt3IjH9elOY1Rufif6A7pyHDFlsnLzECIe+mqF9OYwiOxpTmBvzJZ2L0K/e XzgGe3mg/lLabOzOrbimmroeK5MhbTbtg2JQwjaERVwdIz2qyMlF1SqM/tLRCEfq2a1S 2kWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :wdcironportexception:ironport-sdr:ironport-sdr:dkim-signature; bh=rYDYJBDrJTzyA0cYAsc2w9qQBp+FTqpoqfvOlvwnC7w=; fh=5/viNv8Fzx+nCNW5PGLTL+Se/9D0Q8TrzLPV3SudCmU=; b=rBd/kQVjbwjUQWDTRr8nufE5UZ6CrwgCveYNenZjXbh0xWBLfbgmkP/62uWZGLLPLB pMcpgvh8iEbw97o2FCw+n+oegMpPDCNV4DIvFk5AbRul7DTTKTFw32vAB+3mprRFE7S2 bafpqNE0mPUHOg+EFT1w0Gnwcro5GXljXwtn2BGhRR1Ca6y3ijc6U7ijaR2qeox4Ez3i ITEocQ9P3wNjU3N78eJey42mia71p/STfU/e06kQj88ofhhYP6lWgQsG5LqjMV2VzPUE vXlmHXwBMsNxeOuGrQ/GAhzJ4blJ3ul19B7+gV6optLWK1e/VT5qxSCtKQLbDkejS3Mc eaqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="LdRK/UFB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c7-20020a631c47000000b005c1b5aa3f16si10163779pgm.777.2023.11.21.08.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:33:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="LdRK/UFB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 21A7A80417FB; Tue, 21 Nov 2023 08:33:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233994AbjKUQcz (ORCPT + 99 others); Tue, 21 Nov 2023 11:32:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233706AbjKUQco (ORCPT ); Tue, 21 Nov 2023 11:32:44 -0500 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3EAC1A1; Tue, 21 Nov 2023 08:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1700584360; x=1732120360; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=4x9R0AUQK9GRVyrX+VtnFLrU6NC+W4I+bSE1UwCceA4=; b=LdRK/UFBflkZ7wkdBupPi3NgHGOjw6tc8f6cPcnTwb3gg6Dw8a7arE55 zFR+P7C5RrISc8cq6lF/L4Tokma2onD45zq+3IE8IcEtuwoEMDpf/3AsQ S/zfAi97+Oh7GVojy2uK5kB9m7bfH21XKEz+6YRdj0wJsDrYZ6dhJQ+6F C9nzYPWarllCg3cDtkgWY7i233XH33Y5BtU1hx4JwgVL3zRpZHRT/fAIl ZnYJOyh1udBmyw/juCNL4y4x8S9VaK/IvXw+2NtBsXE9Or9aKxYN2Y4dZ qDMBU3LRNZ0rx5OssfimMFfFpYnueF89Gu+IXPFknIa1gCnSAiZjYn20a w==; X-CSE-ConnectionGUID: zoB9iurbSQyP9XntX2r2Bg== X-CSE-MsgGUID: i+5U2UjVS2K2fnllLZb3qA== X-IronPort-AV: E=Sophos;i="6.04,216,1695657600"; d="scan'208";a="3076041" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 22 Nov 2023 00:32:39 +0800 IronPort-SDR: TAkEFTY1z1bdNrIVPgm88VV+nzcUD0QS/+E/vnPfnzXj+RlPfJX8OVuKFuuZP3lCCipmczmcD1 t/QeMS0q4BWzLiPw76pp+lApx2b0c9jA2s/XLZpv/jNvjVbOOeovvIobhykLgdQ9pWb0X2KryJ bTnTBdlAI8XLixibQWAEPyoEgZOWo6c4FQ4RZ2q9Hta2tlPx3nL5/7XmmqTuMCLQnOP+tagaD/ 30G7Auu6AjdhIsUhcodnFNF7tzuxEP8dc4370pVNMmMSgYXd2ZN++Kh1HFDoLrite0yB+EC651 b0c= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Nov 2023 07:38:17 -0800 IronPort-SDR: GR1ZMbJhEH2SHBk4dtqaQNpLlAoNwKPwcEmFj3egwXbL6nrVNUVXKU1RjdDyhEuWBYo7sBam57 0FLqajz9AICXWEUb7rmxVCROQB68wAulgzqAR9Y+wullZrvfa2Y34sH+9pShoejEJ3YygcWviz GPPLSm5QtfG938z6nZZMdWRz33kbnDShc+6c030L+tpcfJ+MoDsSfLBADSD58nNGcOF7i5Mmwd s2VloPU+6OSWzMVHaCPUrxwza33lVTHHmB6045tv8DjxFaPzJC5fELu0tIfzi8+oX8RgqVwur7 mT4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 21 Nov 2023 08:32:39 -0800 From: Johannes Thumshirn Date: Tue, 21 Nov 2023 08:32:32 -0800 Subject: [PATCH 3/5] btrfs: remove now unneeded btrfs_redirty_list_add MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231121-josef-generic-163-v1-3-049e37185841@wdc.com> References: <20231121-josef-generic-163-v1-0-049e37185841@wdc.com> In-Reply-To: <20231121-josef-generic-163-v1-0-049e37185841@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Naohiro Aota , Johannes Thumshirn X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1700584354; l=3915; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=4x9R0AUQK9GRVyrX+VtnFLrU6NC+W4I+bSE1UwCceA4=; b=WltesEGdCChgU2zlttMM6Os6XzuHwaithQPvnaT3s4u8tUjmDjB7YY0/3dfGrvaHQbd1da6Te +r2QE6li6P9BFUff+3aYvgGSt3fMdpkro4lye6FYnW/3Ml8HauQ3CcG X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 08:33:11 -0800 (PST) Now that we're not clearing the dirty flag off of extent_buffers in zoned mode, all that is left of btrfs_redirty_list_add() is a memzero() and some ASSERT()ions. As we're also memzero()ing the buffer on write-out btrfs_redirty_list_add() has become obsolete and can be removed. Signed-off-by: Johannes Thumshirn --- fs/btrfs/extent-tree.c | 5 +---- fs/btrfs/tree-log.c | 1 - fs/btrfs/zoned.c | 17 ----------------- fs/btrfs/zoned.h | 5 ----- 4 files changed, 1 insertion(+), 27 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index f6cbbec539fa..6beff11e692e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3445,10 +3445,8 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, if (root_id != BTRFS_TREE_LOG_OBJECTID) { ret = check_ref_cleanup(trans, buf->start); - if (!ret) { - btrfs_redirty_list_add(trans->transaction, buf); + if (!ret) goto out; - } } cache = btrfs_lookup_block_group(fs_info, buf->start); @@ -3479,7 +3477,6 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, must_pin = true; if (must_pin || btrfs_is_zoned(fs_info)) { - btrfs_redirty_list_add(trans->transaction, buf); pin_down_extent(trans, cache, buf->start, buf->len, 1); btrfs_put_block_group(cache); goto out; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 7d6729d9fd2f..bee065851185 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2575,7 +2575,6 @@ static int clean_log_buffer(struct btrfs_trans_handle *trans, ret = btrfs_pin_reserved_extent(trans, eb); if (ret) return ret; - btrfs_redirty_list_add(trans->transaction, eb); } else { unaccount_log_buffer(eb->fs_info, eb->start); } diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 117e041bdc7a..931ccc839152 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -1715,23 +1715,6 @@ void btrfs_calc_zone_unusable(struct btrfs_block_group *cache) cache->zone_unusable = unusable; } -void btrfs_redirty_list_add(struct btrfs_transaction *trans, - struct extent_buffer *eb) -{ - if (!btrfs_is_zoned(eb->fs_info) || - btrfs_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN)) - return; - - ASSERT(test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags)); - ASSERT(test_bit(EXTENT_BUFFER_CANCELLED, &eb->bflags)); - - memzero_extent_buffer(eb, 0, eb->len); - set_bit(EXTENT_BUFFER_CANCELLED, &eb->bflags); - set_extent_buffer_dirty(eb); - set_extent_bit(&trans->dirty_pages, eb->start, eb->start + eb->len - 1, - EXTENT_DIRTY, NULL); -} - bool btrfs_use_zone_append(struct btrfs_bio *bbio) { u64 start = (bbio->bio.bi_iter.bi_sector << SECTOR_SHIFT); diff --git a/fs/btrfs/zoned.h b/fs/btrfs/zoned.h index b9cec523b778..7bfe1d677310 100644 --- a/fs/btrfs/zoned.h +++ b/fs/btrfs/zoned.h @@ -59,8 +59,6 @@ int btrfs_reset_device_zone(struct btrfs_device *device, u64 physical, int btrfs_ensure_empty_zones(struct btrfs_device *device, u64 start, u64 size); int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new); void btrfs_calc_zone_unusable(struct btrfs_block_group *cache); -void btrfs_redirty_list_add(struct btrfs_transaction *trans, - struct extent_buffer *eb); bool btrfs_use_zone_append(struct btrfs_bio *bbio); void btrfs_record_physical_zoned(struct btrfs_bio *bbio); int btrfs_check_meta_write_pointer(struct btrfs_fs_info *fs_info, @@ -180,9 +178,6 @@ static inline int btrfs_load_block_group_zone_info( static inline void btrfs_calc_zone_unusable(struct btrfs_block_group *cache) { } -static inline void btrfs_redirty_list_add(struct btrfs_transaction *trans, - struct extent_buffer *eb) { } - static inline bool btrfs_use_zone_append(struct btrfs_bio *bbio) { return false; -- 2.41.0