Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp232762lqs; Mon, 4 Mar 2024 23:31:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWPpCbHbyARAzRnKSqEIa2OlUu6l3uc2CGvPJPPb65ifC8H5IbeiuLyxcoSLp9y0EFaUzqXEebMujiJ3MMAU8Oz7kgL18eNOTMfNdJqyg== X-Google-Smtp-Source: AGHT+IGBOz3KeTCykxswjxAbmZ1Be4N3WHzN9sLunME6N0jrsy7Q82ZKEND71UI6YeTLxpRE55QV X-Received: by 2002:a37:c446:0:b0:788:1dc0:b2c7 with SMTP id h6-20020a37c446000000b007881dc0b2c7mr1063599qkm.10.1709623893086; Mon, 04 Mar 2024 23:31:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709623893; cv=pass; d=google.com; s=arc-20160816; b=qd3LTfTNY4cerMJPnGgVTebIS73AiJia13JDjp1tOMlKa7p1qS1vibqs7rR+uSYbjx bEaHRAOrOUbFPgV+fqDfh8xYr+w/2VifwFa0I621bCn0eY+YYtK+HSoEuRSELu7AgiSE Y683Xq/jyDsGUt5xwVmqzOTBnXU/UYhZGdkaDIg8ZOhTsfpJWK8SJfr1edC2QGqWEH1g L3JQueE+61ZScLh3s7RmJe0k+2KSzL7xy9Vu7nNTp5ltjouucEkYE/Pt/lBnPxiG5VlN /9MEdvKvsVX/yg90cNZTMpCclpGTP0Ec/0kM8ZL2p/tXNB0MYJSlugmzK1QGjKZiIgab UI/Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=fuFrqCyHFvP8tBgQAgK2feV+Gk1hDob9KjujhCdk7Ik=; fh=YoyvrhSFX/gomruhs8E5v3LJBIcHojMCK8eMDUDpafQ=; b=Eh5gSXi0neVp7pYqjsNYdTeB9bjUkg53sqiYU/6dgUIhx7IYpwbc64X73vKDpR4VVR YdpHjYtw3BUvhZvzpp6+UQ+a0Nisj5aXDABOSLx3KyLMs5vXdJgDeckckY9Xxhmbr2Q5 zBljjBhR7sEYIeE2vZvUybbBiJxVI0AqTooNUEa+kPThtY02qpT91pYX8TiOeeKZMoUm p/TJmKTk27LPWVveMpRKkwU3T3W0MOrhpe2ra9v5ksMN3wtozoCNM8hEnruXIhDzb+vU j+jx23EXHC1NevE2XDh6eD67Y+nhRC8SgWmVHip0EVzUMT3hhwkC/OC3pOPIw88uKNmB VO0w==; 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-91803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91803-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pj22-20020a05620a1d9600b00787bb6786d9si11218015qkn.513.2024.03.04.23.31.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 23:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-91803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91803-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C9B421C21C68 for ; Tue, 5 Mar 2024 07:31:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC41C80637; Tue, 5 Mar 2024 07:29:37 +0000 (UTC) Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) (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 389507FBA6; Tue, 5 Mar 2024 07:29:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709623777; cv=none; b=Mpl5wALkYPjWE3kJGdkCs/H6gg8kT2O2B7+CLX439b7kykSUUelf/DfAl2WX2+qJ25vPiCO7M4zregtPzwPQ4CdEU02qZphi2WGsDC82ZvyoSlLkqKT/y2H+Gm2oVmlwC6Cy59ofdUHRNvN3xph9jR4i+Kuz3HRJqCbRyuUpfWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709623777; c=relaxed/simple; bh=a1W8ETvaPBy5gLulNcrgoIljokgm4KTvnlxO2lbuKEI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KkTViXvDv8I0ws8Q96nvt7xfFqyJvPi1niRj4BMVS9V+bJ4wxPilVsriutiisvsmF97/CkNNa7JqKo8+wcLDso0xh6a9P3OHWiszKTseqAEMMhgWY5w3x0vEj6RxPUnsK42BQYTeBtBm0PuX7wx1/UKOl7eZ4aQdA6MokUhjlcs= 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.56 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.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TpnJ21Wv2z4f3jsM; Tue, 5 Mar 2024 15:29:22 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 992591A0C19; Tue, 5 Mar 2024 15:29:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgBHGBHRyeZlGnf+Fw--.17927S7; Tue, 05 Mar 2024 15:29:27 +0800 (CST) From: Yu Kuai To: xni@redhat.com, zkabelac@redhat.com, agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, dm-devel@lists.linux.dev, song@kernel.org, yukuai3@huawei.com, heinzm@redhat.com, jbrassow@redhat.com, neilb@suse.de Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH md-6.8 v2 3/9] md: export helper md_is_rdwr() Date: Tue, 5 Mar 2024 15:23:00 +0800 Message-Id: <20240305072306.2562024-4-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305072306.2562024-1-yukuai1@huaweicloud.com> References: <20240305072306.2562024-1-yukuai1@huaweicloud.com> 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:cCh0CgBHGBHRyeZlGnf+Fw--.17927S7 X-Coremail-Antispam: 1UD129KBjvJXoW7Kr47Kr4xtrykGw13uF4fGrg_yoW8WF1kpa ySgFy3Ar4UZF43Xa4UJa1Dua45A3WfKrWjkry3uws5Xa43Xrs8CF1rGFWDKrWkWFyfAF1a ya15JF1UuF10kwUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPj14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kIc2 xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v2 6r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2 Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_ Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8Jw CI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUojjgUUUU U X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ From: Yu Kuai There are no functional changes for now, prepare to fix a deadlock for dm-raid456. Signed-off-by: Yu Kuai Signed-off-by: Xiao Ni Acked-by: Mike Snitzer --- drivers/md/md.c | 12 ------------ drivers/md/md.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 22e7512a5b1e..306cbbf92fcf 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -99,18 +99,6 @@ static void mddev_detach(struct mddev *mddev); static void export_rdev(struct md_rdev *rdev, struct mddev *mddev); static void md_wakeup_thread_directly(struct md_thread __rcu *thread); -enum md_ro_state { - MD_RDWR, - MD_RDONLY, - MD_AUTO_READ, - MD_MAX_STATE -}; - -static bool md_is_rdwr(struct mddev *mddev) -{ - return (mddev->ro == MD_RDWR); -} - /* * Default number of read corrections we'll attempt on an rdev * before ejecting it from the array. We divide the read error diff --git a/drivers/md/md.h b/drivers/md/md.h index 437ab70ce79b..684cc866402a 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -558,6 +558,18 @@ enum recovery_flags { MD_RESYNCING_REMOTE, /* remote node is running resync thread */ }; +enum md_ro_state { + MD_RDWR, + MD_RDONLY, + MD_AUTO_READ, + MD_MAX_STATE +}; + +static inline bool md_is_rdwr(struct mddev *mddev) +{ + return (mddev->ro == MD_RDWR); +} + static inline int __must_check mddev_lock(struct mddev *mddev) { return mutex_lock_interruptible(&mddev->reconfig_mutex); -- 2.39.2