From patchwork Mon Sep 18 14:14:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 141463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2772008vqi; Mon, 18 Sep 2023 09:08:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkmlF1wDcvG35u67G9XRKK5QfX81e0/MRYv662i3gsgqC+krRMQDln3nGPsqu2MctDpyqV X-Received: by 2002:a17:902:c24d:b0:1bd:edac:af44 with SMTP id 13-20020a170902c24d00b001bdedacaf44mr7285603plg.51.1695053304687; Mon, 18 Sep 2023 09:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695053304; cv=none; d=google.com; s=arc-20160816; b=CTI7uZ9PqPtcUm6Xn11IDFfFDdPnyIbcvPNTgk6/bZ7u0R7KqNfdarT0etU6NY4tKL KAWqaS/MarSmUIIoPxwEc7WPM1QMqJyvWBwalw2wKKd9E2WSHOzKvLvimhCXqes9pEFd lIvV0k6w9KVbiKR13+3A0ksLeEA8zdL7KXtn7dgtNaI3Y8phsj9dxE/mg+UVPa87t43v 5NUd2h7PTa03fAtqNXON/iirgRDYavZz5a6Sk+jjdA/fw3hnyGc2pB+lokVFJ1pOFYqj NIi9UPkhtD0i/6Z1gf5cYCC5iq88TEHMw0n/bn31JGGwoHScSeJmYoH7+GDi/eWMEaz8 lkQA== 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=bogRZaoczwI2BToouy6SlBbvPgxJVbpgfhqNZb0lxNg=; fh=ZBIeESkUb/iidfG45mvqtPm0vhj4bdZnQPzR057sc1k=; b=rgakcB/XV5UtxluCxTKfVuiIZFI6wSc3wrfJqGQ4NswOi+eyKMwapPuIs5b2bn4DaA FoHAsjWsWfwcImXX0YBIgspf8V1t/nM8GJFHblCh0as+sy/enbfmSOqK1UkHV/lMXtY6 7WqweJkwhjfSq3nJhFD+ZrhF5nNEUDE+KXzMOhRIyC2Vh76NQ0q6eux+Odu076BILMkz L2Oi7PcvOe0EbMtI6H65eNSWmS0XX81gYtW1ZScKLPBSTNevJ2GEvs/9L0UG7hPTNysR XWM6vySv0wZbp3RckpwxKc0XrTB1AnfqVVHHlB+UhSwNiKDkVN51ANtJZav/r+VReT/F nU9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=dj4aIh7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q4-20020a170902dac400b001bdba87ad54si8759068plx.603.2023.09.18.09.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=dj4aIh7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 2671C8127251; Mon, 18 Sep 2023 08:49:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjIRPs2 (ORCPT + 25 others); Mon, 18 Sep 2023 11:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbjIRPs1 (ORCPT ); Mon, 18 Sep 2023 11:48:27 -0400 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CF8EE7F; Mon, 18 Sep 2023 08:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1695051924; x=1726587924; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=fQE6cYQTb7uEo6MPqo5w53bNOJZDe0ReEYNCQa7qqK0=; b=dj4aIh7cOBNX9/B/67QFuV9QI6tZ/MLTqykMPEBwymQclas54O+gZkQ/ Hs2uDnj3Oe6OcMZkSFKniGrmZcxdnwvYKu9gMcJoEQ65+BfPTUdKu5fka ns99rH8ayeixreIcU2uG1nX1sOHMUQIVG2rO6saTP3vlhtQNYWeuUySsC ntv1AQUwQcsghCXCy5eU1shKTCG2RkIPJA/HTkr/kseiFH9mBRGf/sfRF LULMreQ+FC7CZeFdNwukdewDJ3fmDFBYpKOCahszJdF0u3/B7N4uzcVIo M5HzNfv88De1y0DGwKJrXHdgV/PgDvekHUZM+6hpUhKyEiTE9UMIHB3He g==; X-CSE-ConnectionGUID: bYCu7FojQz2C3LXV5E01NA== X-CSE-MsgGUID: Jsf4kmMURdCGC9Lfjh8kWA== X-IronPort-AV: E=Sophos;i="6.02,156,1688400000"; d="scan'208";a="242446876" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 18 Sep 2023 22:14:40 +0800 IronPort-SDR: CZL9P2IOib8kKyMNF8KdaY13Uoxi3zGnMA6b4ZZJUkQiQDXy7DjPTyziJzZodt6kVIDVUe57LZ jk8amtJF6jl6hjauhNbi80ITqBiZhiQHvGAlCLHCO5m15LGI9QHvfUcDuB0xmwvwewLMHcJSu7 CAwYhMQGbxILE6xGXskE9Qx6d0RR6+KzK36ZLCK5xYUersqSEFd7tlH4N8FY2m+HMHSRUSY++O wM31es4w7QRFiDvVrtbz0bsJbN9api+FQ9QnCJ0KWVMmajAkZEeDtBVYGDvRgse+6MXlaaGO1d nBY= 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; 18 Sep 2023 06:21:37 -0700 IronPort-SDR: 5TDNxe3i1yZJkY3LXwz/2hJ6fkynl70Mk7Z8Cn/pS7b7c3n2140f5iQQX08bNnMAV3KTIAQSnD VEqyVXHmrrDJtjcy3Km4CRJ16f3wZW0dbbPGuCjJoKus8x38lsahok+EJwNwdJR0I8G29pJDWT Fq3aH/eyY7fOTOleZY5qFDfAsPh7RTzOWBIwdkU3OdAY6B14rSfFF6BfsRtZapMYy9kzx2u5+J WRBMAmONz+eYRhrPu2LyAt1N4JlgONIqLL0utBzQFvL/BiqkPlNFehAbK4E19k6vtSxfwxVtxn 6rQ= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 18 Sep 2023 07:14:39 -0700 From: Johannes Thumshirn Date: Mon, 18 Sep 2023 07:14:32 -0700 Subject: [PATCH 3/4] btrfs: rename ordered_enmtry in btrfs_io_context MIME-Version: 1.0 Message-Id: <20230918-rst-updates-v1-3-17686dc06859@wdc.com> References: <20230918-rst-updates-v1-0-17686dc06859@wdc.com> In-Reply-To: <20230918-rst-updates-v1-0-17686dc06859@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenru , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Thumshirn X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1695046476; l=4045; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=fQE6cYQTb7uEo6MPqo5w53bNOJZDe0ReEYNCQa7qqK0=; b=+/a05AvEaTYcyS3A7GhxaWi/TMosXPDU0WnXZkuQZ9q7eD4MBxhOivfkRqpzAz8wG008He9UN p8eK82/D+smA1kHjMfBeD+VOUFD3OqtPB/8qZEEKzW8DTSRnh62Iw95 X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:49:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777392213699304106 X-GMAIL-MSGID: 1777392213699304106 Rename the 'ordered_entry' member of 'struct btrfs_io_context' to 'rst_ordered_entry' to make it clear, it is only there for updates to the raid-stripe-tree. Cc: Qu Wenru Signed-off-by: Johannes Thumshirn --- fs/btrfs/bio.c | 3 ++- fs/btrfs/raid-stripe-tree.c | 18 +++++++++--------- fs/btrfs/volumes.h | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 4c234024beae..d0a029c859e1 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -708,7 +708,8 @@ static bool btrfs_submit_chunk(struct btrfs_bio *bbio, int mirror_num) * can't happen until after the last submission. */ btrfs_get_bioc(bioc); - list_add_tail(&bioc->ordered_entry, &bbio->ordered->bioc_list); + list_add_tail(&bioc->rst_ordered_entry, + &bbio->ordered->bioc_list); } /* diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c index 0c0e620ed8b9..1bf84258dbfa 100644 --- a/fs/btrfs/raid-stripe-tree.c +++ b/fs/btrfs/raid-stripe-tree.c @@ -132,7 +132,7 @@ static int btrfs_insert_mirrored_raid_extents(struct btrfs_trans_handle *trans, struct btrfs_io_context *bioc; int ret; - list_for_each_entry(bioc, &ordered->bioc_list, ordered_entry) { + list_for_each_entry(bioc, &ordered->bioc_list, rst_ordered_entry) { ret = btrfs_insert_one_raid_extent(trans, num_stripes, bioc); if (ret) return ret; @@ -167,12 +167,12 @@ static int btrfs_insert_striped_mirrored_raid_extents( rbioc->map_type = map_type; rbioc->logical = list_first_entry(&ordered->bioc_list, typeof(*rbioc), - ordered_entry)->logical; + rst_ordered_entry)->logical; stripe_end = rbioc->logical; prev_end = stripe_end; i = 0; - list_for_each_entry(bioc, &ordered->bioc_list, ordered_entry) { + list_for_each_entry(bioc, &ordered->bioc_list, rst_ordered_entry) { rbioc->size += bioc->size; for (int j = 0; j < substripes; j++) { int stripe = i + j; @@ -201,7 +201,7 @@ static int btrfs_insert_striped_mirrored_raid_extents( } if (left) { - bioc = list_prev_entry(bioc, ordered_entry); + bioc = list_prev_entry(bioc, rst_ordered_entry); ret = btrfs_insert_one_raid_extent(trans, substripes, bioc); } @@ -225,10 +225,10 @@ static int btrfs_insert_striped_raid_extents(struct btrfs_trans_handle *trans, return -ENOMEM; rbioc->map_type = map_type; rbioc->logical = list_first_entry(&ordered->bioc_list, typeof(*rbioc), - ordered_entry)->logical; + rst_ordered_entry)->logical; i = 0; - list_for_each_entry(bioc, &ordered->bioc_list, ordered_entry) { + list_for_each_entry(bioc, &ordered->bioc_list, rst_ordered_entry) { rbioc->size += bioc->size; rbioc->stripes[i].dev = bioc->stripes[0].dev; rbioc->stripes[i].physical = bioc->stripes[0].physical; @@ -266,7 +266,7 @@ int btrfs_insert_raid_extent(struct btrfs_trans_handle *trans, return 0; map_type = list_first_entry(&ordered_extent->bioc_list, typeof(*bioc), - ordered_entry)->map_type; + rst_ordered_entry)->map_type; switch (map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK) { case BTRFS_BLOCK_GROUP_DUP: @@ -291,8 +291,8 @@ int btrfs_insert_raid_extent(struct btrfs_trans_handle *trans, while (!list_empty(&ordered_extent->bioc_list)) { bioc = list_first_entry(&ordered_extent->bioc_list, - typeof(*bioc), ordered_entry); - list_del(&bioc->ordered_entry); + typeof(*bioc), rst_ordered_entry); + list_del(&bioc->rst_ordered_entry); btrfs_put_bioc(bioc); } diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 54549e34a306..b511d17c6717 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -432,7 +432,7 @@ struct btrfs_io_context { u64 logical; u64 size; - struct list_head ordered_entry; + struct list_head rst_ordered_entry; /* * The total number of stripes, including the extra duplicated