Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp858148lqo; Wed, 8 May 2024 18:29:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW98CyplWEHT68+6y741iGKWOdUbr1nMe1AqBDNLq4uVuARJLj/FetNwcmoBKlCSfUe5n8xnkYL8uKuxADXrHucEQ1PMJQaqUg9qB5Cww== X-Google-Smtp-Source: AGHT+IGF4upYgHPGjTUyDS4GomxQBTxIbdn2LAnqj1iDyrfJlBNB5teEtTp7iqXsphSP0H97cvvo X-Received: by 2002:a17:903:2343:b0:1e2:b13f:bd64 with SMTP id d9443c01a7336-1eeaf87097amr55008485ad.0.1715218173080; Wed, 08 May 2024 18:29:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715218173; cv=pass; d=google.com; s=arc-20160816; b=Cu/I2omu6PlbOI6gjoKJcZ/qnkQJ49jcFf78nI2hywLgDONX4DtV3nSqr90gV3qkqG ED3/bZ86f5r5AWwLb2B6CJnDsJDAcOzaspQt8bTlQG7fXCdXjgIcCaDkGrqowJwwNBGX 1iAOSHeUAE/teapDb/mCyHYdy47VwQPOLJXJ0MDmHkKzD73QZV/P5q/pZ8bcrlrajZ+V LfbS0kyuV/C/FciK8omF7eisXmSzEwmrPfLx/uomvSy/9dQFk7q7m4HKo7jWuLIg0O2b eCAkHl7jrX4ZXy2TxS7mzX82gHZ2Uh6o4i/xnlv2bHcsGgPwnSt2u2NHrURWHlLH7Umh EmWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=l1HTB4sqTW+uJNnkFYyp01OCsFnuGH4/tlvSYHNQSk8=; fh=vFj2LZCfsSjQyBW6TnUaUIAX9ceL72Bl/t9ngqXepOM=; b=GNHHs2OdLTfpJ7VC+zeLRfbe0KaRKxWAyqb/xyNbCK/5/fAfG/X+96AkEOPrY0YrCC PAVCbPea6Seukb8XX/oJ3iqapMB/RnON4ZfrfCEurr+L/qF2CjAxJauTZIEU+5Kn5xW0 OOk2l07TBMNfS5FHmonr669HOyztogrCHYdp4VWebZxLIaPWK8qQXDG20TJvRSro6KxD uMwYmNqVNv9DUYplwRFMbX6HskbiRAd8DYJf34LIKq/LSPVkbNIhsgVDUb1rzRH7zZzF u2gtMYxuZ2WeN3rbC8kjAFCAaaMQbEpfV0VGWBlbiIJPlChj5Z8dt1nUhuIGIuVSjib1 WSuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-174005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174005-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9cf4b9si3854805ad.94.2024.05.08.18.29.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 18:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-174005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174005-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CE8E62820F5 for ; Thu, 9 May 2024 01:29:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 274C113C83F; Thu, 9 May 2024 01:29:10 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B863113C3ED; Thu, 9 May 2024 01:29:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715218149; cv=none; b=vFlkyiN30WFUTNCfTzCW+xRg7RFseuLwS9cKrbtceUD8TTUdJjufJMRisrKuGCB5tN/zlQg5fBXRgJZIE79DCdQhSR/di6+XCFjOKSlKujIP0O0cYN0RdA/Q3H0VFN74vE2O6x1wVJIVTL0LXWrDkkQ+tSmQ/NlpLy2Tf1dktbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715218149; c=relaxed/simple; bh=U03wBk7HDXB0sFrPIc2tbiab0SncvyWu7xn1xRY1pmQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ktcnu+97VMcDlXh0CyCRDlWbE10uz9icCHcd41tRV6vGe+Ajix/YcLWMmXM5nAZLFkARsc9xzT1ATMqItZkV4EYXx3cj8ZaoRo2kYfBS7TlcBuTnNODZM9mp9RWXja3rZcv3lTneTGwYKRH0olnB8Q1YJW+fUHBSiuJM96S3rPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VZZD56JK1z4f3nKH; Thu, 9 May 2024 09:28:53 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id BCA2B1A058D; Thu, 9 May 2024 09:29:03 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgDHlxDeJjxm5MuXMA--.59814S4; Thu, 09 May 2024 09:29:03 +0800 (CST) From: Yu Kuai To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, song@kernel.org, xni@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH RFC md-6.10 0/9] md: refactor and cleanup for sync action Date: Thu, 9 May 2024 09:18:51 +0800 Message-Id: <20240509011900.2694291-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgDHlxDeJjxm5MuXMA--.59814S4 X-Coremail-Antispam: 1UD129KBjvdXoWruFy8JF4fCF4DKw15Zw48tFb_yoWfWwcEga 4kXFy3Jw45uF1UJFy5tr1S9rWjka1Ygrs7Ja43trWSyr97ZF17GF1jkrWfXw1fZrZF9r1Y vry8C3yfArsFgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbxAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628v n2kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F4 0E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFyl IxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxV AFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v2 6r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0J UZa9-UUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ From: Yu Kuai Motivation of this patchset is that during code review, I found some places is not good coded, and I decide to make code more readable. Yu Kuai (9): md: rearrange recovery_flage md: add a new enum type sync_action md: add new helpers for sync_action md: factor out helper to start reshape from action_store() md: replace sysfs api sync_action with new helpers md: use new helers in md_do_sync() md: replace last_sync_action with new enum type md: factor out helpers for different sync_action in md_do_sync() md: pass in max_sectors for pers->sync_request() drivers/md/dm-raid.c | 2 +- drivers/md/md.c | 367 ++++++++++++++++++++++++++++--------------- drivers/md/md.h | 122 +++++++++++--- drivers/md/raid1.c | 5 +- drivers/md/raid10.c | 8 +- drivers/md/raid5.c | 3 +- 6 files changed, 344 insertions(+), 163 deletions(-) -- 2.39.2