Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp189749lqg; Fri, 1 Mar 2024 02:06:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWjcxCi82wjN3cUqqY75jmiWkUKDIWOxhPIygKBzvvu0Dx4ygtlb0IfLBta62yo5Yc5oNOMqZHwtjmTKXS69bdmtXmpmMX7BjBfc39dvQ== X-Google-Smtp-Source: AGHT+IG2HjcHk/KDeMAeA4j4Eec4CSSgFeuWT+2tkiWpcayMHsCcg7vjFFaCQur4WInb2sl0xn2/ X-Received: by 2002:a05:6808:e8d:b0:3c1:d10e:17cb with SMTP id k13-20020a0568080e8d00b003c1d10e17cbmr1262927oil.59.1709287560260; Fri, 01 Mar 2024 02:06:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709287560; cv=pass; d=google.com; s=arc-20160816; b=AWs1Jy4hCThckI97v3mtsI9cTOOHDCvjkfUxm+RCcQ+baDRo07Z8IzEtv2bPn0BnmY XKpHQuKlSmaTZdhy7lc2lHvpTxRG5S+G9NzlJwnz2MIayf/h8xamuPJE4P2sY6KXl3V2 RiFlixC2r4iCSZQo+7nCWKezYK/7AKx/GOBDLNm96Rh5XAlw8Rokzpkp24VAAyBFnfH1 Adwg2wIn2ufWsbPkHF5omaHayJfKzvTA7NIr1MMwnI9M1LP6ElvvzrmJigSSmKgUaowc HiYj084RP6usGAfT8nFdlCUoAEIkal5ELsJs7py7ETkZiKb+MuHzd54R4hMw+kB/iFuF HH/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=XSVW9sYbSd5CQd6oRQLalARVAvedep43VRwrwdraJbM=; fh=D0tHjPHp+NwWiP9dALgrUrDY+JdDylAJlTP6wFQuWjg=; b=fQYvpF2GfWn0fM/Uu2+9H9GRpXzTRNVghE28SyOo4FgLKRmVZrrw6QmjPDUtyyILuR I42Fm98vqOz791Yc9mISjYWFMK2sGxpAQxTJfP+LppstlvG62dzcXfopYhXcHL/f8QFp pQtRqB0Y9T42o9e3yoi9oxPfCUQCNk2vRNKojSvE2rq+k8BJXnvfnLWxnO+KqKMoHlAy QYLNRgT3ZiJGVn/1ZAOiXEiD9nVGcgAi28qdBlRnDzRzww60PqyJS9s2Ql62pEj9e6m5 Ny/K3OyxVsK/y4d2+QCb/Ko07opXPxd1jrCosz5ftarqk7KZMX+NS5jrMhiE5K+mzJDN Pqag==; 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-88228-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88228-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w26-20020aa7859a000000b006e52f0b49basi3152002pfn.209.2024.03.01.02.06.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 02:06:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88228-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-88228-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88228-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 E65CA2881CF for ; Fri, 1 Mar 2024 10:05:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47B5B6F520; Fri, 1 Mar 2024 10:03:12 +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 0086D6BB57; Fri, 1 Mar 2024 10:03: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=1709287391; cv=none; b=Y49F6BaoefBeT6xYZkP0Xd+GayN34FbCychnhsbXK41UZD5DP4ENoVOXbg10CGLMGmMHZdHROnng7mjQ1f2CrvPiQ655Y5kvMhGt0jGAMrDhE4/szpNZcRVSRHHbtbppSAKQ1wQjPOhqLnKiT6HZmLdNC7CfDc2I3s8F+MGVjt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709287391; c=relaxed/simple; bh=24WD8tgwVtddCKq7F8lxRkz6GTenNtBeLM7ja6eExBk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YY+0S9T/zqkyX4BPOXKu8yXUa/kIS3f5M4mFVMaZAgcdXw/NumVGhKTx4N/NQY9vIgM9c2xeMfA6rDsSBgnx/zmgzY+SrfF3Sh6t/5Nq0QUsdh9xP5XEvLIbseuxMSx9e2GWJl7fB0Tn3buAfMZgDliTfsF64cAfDHS1hh5Sjbg= 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 4TmNv54ZtPz4f3nbq; Fri, 1 Mar 2024 18:02:57 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 08ED91A0838; Fri, 1 Mar 2024 18:03:05 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgCXaBHTp+FlqmBuFg--.36874S7; Fri, 01 Mar 2024 18:03:04 +0800 (CST) From: Yu Kuai To: zkabelac@redhat.com, xni@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, neilb@suse.de, jbrassow@redhat.com Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next 3/9] md: export helper md_is_rdwr() Date: Fri, 1 Mar 2024 17:56:51 +0800 Message-Id: <20240301095657.662111-4-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240301095657.662111-1-yukuai1@huaweicloud.com> References: <20240301095657.662111-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:cCh0CgCXaBHTp+FlqmBuFg--.36874S7 X-Coremail-Antispam: 1UD129KBjvJXoW7Kr47Kr4xtrykGw13uF4fGrg_yoW8XFWrpa ySgFy3ArWjvF43X3yUJayDua45Z3WfKrWjkry3u395Xa43Xr4UCF1rGFWqgrWDWFyfAF1a ga15JF18u3WvkwUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUP014x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kIc2 xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v2 6r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2 Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_ Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8Jw CI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUbJ73DUU UUU== 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 --- 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 5f6496cf43f5..2fe8b937998b 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 a6d33f10b107..09368517cc6c 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