Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp846012imm; Thu, 13 Sep 2018 08:36:11 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda+UCKoaEvUanXFL88mLmLsUCGsK0AxEBGmoYqor1Xrr7ICB4/60ro5a1uVdEpimt1n1i2o X-Received: by 2002:a62:34c4:: with SMTP id b187-v6mr7996853pfa.15.1536852971114; Thu, 13 Sep 2018 08:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536852971; cv=none; d=google.com; s=arc-20160816; b=N/L2UoAjb+irx7m2vPerOkoXvPNQ/wwwdSXFqR7AtEs7f2UGlHsbCLbavpy08RdsBl 1SLlHu5P25zNMrlnETDyB+k+LWmFErVmQ7vP2RDQckrLsayajYWfJNj4R99B8QGz85qI /2AxdQJiVQz1rYTMVOKu9ELuB7979KTS14MAB1768iT/ifQ8jFmFwIolv/i3EXv5IZU6 EweDX23eQwu9f0O243FpzuxjYjuLR+nhM/VvUWoFpGAo/NlohJ8g5cpAFfQhB/5jRYv3 vRc0Ng9exhKEvkGlbc7ooP88sUfYJfCpKloGHroKfTzzwltJE+HiYCyyBcf0ooyvsbs+ wjjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=lUGuwyJBK+eOBIJ+Csd74OxRQFY8pSLNTRdiFxzxFDg=; b=pFm6dfl7TLlwfo9LCpoR/N9G6F0o8Qd6mnLhhcBK+77OAVKwCzakEXwtRhebBWdSJ5 LHj6f5nhuxT20LisrkJEG1j44AVCY0AkKHUquwPC3qBi1bzzdHtSS65q8/kWy5YRcmMp ubzH3WpIpZVR4LUPW3ai2jNomhTmHF1/pdQbUen0WLDrFubT6tPk09cRtXH4xnU1WbT5 RBJn+22zMVmDW+vARfl77iQFjctTcvV4yeb73munQqL7T3W22B/fMAl96As/UFapsDMu MvtV6ueUM5zIZYuwtSzy7rsZVsQE37IZLdtLWTjHi9h4zXjCR/wiSCYFQ/Pj6peQlx45 mzIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VZxvatSD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si3939038pfh.353.2018.09.13.08.35.54; Thu, 13 Sep 2018 08:36:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VZxvatSD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728304AbeIMUpg (ORCPT + 99 others); Thu, 13 Sep 2018 16:45:36 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34023 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727803AbeIMUpg (ORCPT ); Thu, 13 Sep 2018 16:45:36 -0400 Received: by mail-ed1-f68.google.com with SMTP id u1-v6so5008103eds.1; Thu, 13 Sep 2018 08:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lUGuwyJBK+eOBIJ+Csd74OxRQFY8pSLNTRdiFxzxFDg=; b=VZxvatSDU4XFyONhokO3sHKwyYRKC6IyhfGK2+V39I2snSsFzr7bfTc9d5oxyxaq+Q G7/SJjA8y9CsHnmeqO2YdP53gE6fdvZu0G3lbiM+5fPvaxNYnbIOxogkAfVUWgwyBLQD czQQv2T2wcw84OMSVCDbqZCIWnWooaX0KvZhpvjYjtEv0KABVrCX0RzL3P6GKTtrQJfQ 3dcouLBZTBrDmRg7YfIgDHUhYNrqaMr4UMp7bHgKhFr5IynPhr0C7CDezGoNcQKaulu9 rrfApDcUMhJ65NXC+hC976JEgPCt8JpDAsRbuRNkU9zkka+Ai1DxOs8W9O9sRUXTS7Qm sFgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lUGuwyJBK+eOBIJ+Csd74OxRQFY8pSLNTRdiFxzxFDg=; b=t5JHv1FNmEZzt73LZr8AJ9OmBnOiMPHvNrFV7hUqj5BJC/YtKAIWl0gMwTnz6LesXd jEh8RFto5KWrI1NxLqyppYCko4tw8FhUZhvEVOv3Ko3cJieDTess5zHGog11l2NKKgS/ LcikR1+yUVZfSws9q9u3DHivrqREr8rRFOryWK19KCZBIk7hl5knqYYlCbWJnBcruuTa qFFWWVopYdFZSq1JZdjQZ+8KyjoWbx8skSyR2cWbNDev7J7EDgu4Q0dO5ZSL9YaXjFqx o5PWPy7RbnzC0PG9n5PCUA3UT1t+PoAhDdOc9jd70Ur3wNeGbxpFP/FRtznHuPcAoRr1 NniQ== X-Gm-Message-State: APzg51DiMQ/of0mQ9c9X4VWq2yeThIcOmDpRwKIoOoD8SlynEgNp0T/p hrhfvd/uu59XUJKuPJxscVk= X-Received: by 2002:a50:ad0f:: with SMTP id y15-v6mr11909028edc.78.1536852933039; Thu, 13 Sep 2018 08:35:33 -0700 (PDT) Received: from jinpu-GA-870A-USB3.pb.local ([2001:1438:4010:254c:1e6f:65ff:fed4:d10]) by smtp.googlemail.com with ESMTPSA id d3-v6sm2171210edi.80.2018.09.13.08.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Sep 2018 08:35:32 -0700 (PDT) From: Jack Wang X-Google-Original-From: Jack Wang To: shli@kernel.org, neilb@suse.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jack Wang Subject: [PATCH] md: bitmap: use mddev_suspend/resume instead of ->quiesce() Date: Thu, 13 Sep 2018 17:35:30 +0200 Message-Id: <1536852930-18926-1-git-send-email-jinpuwang@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jack Wang After 9e1cc0a54556 ("md: use mddev_suspend/resume instead of ->quiesce()") We still have similar left in bitmap functions. Replace quiesce() with mddev_suspend/resume. Also move md_bitmap_create out of mddev_suspend. and move mddev_resume after md_bitmap_destroy. as we did in set_bitmap_file. Signed-off-by: Jack Wang --- drivers/md/md-bitmap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 2fc8c113977f..c369f1753ea6 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -2123,7 +2123,7 @@ int md_bitmap_resize(struct bitmap *bitmap, sector_t blocks, } if (!init) - bitmap->mddev->pers->quiesce(bitmap->mddev, 1); + mddev_suspend(bitmap->mddev); store.file = bitmap->storage.file; bitmap->storage.file = NULL; @@ -2239,7 +2239,7 @@ int md_bitmap_resize(struct bitmap *bitmap, sector_t blocks, if (!init) { md_bitmap_unplug(bitmap); - bitmap->mddev->pers->quiesce(bitmap->mddev, 0); + mddev_resume(bitmap->mddev); } ret = 0; err: @@ -2288,9 +2288,9 @@ location_store(struct mddev *mddev, const char *buf, size_t len) goto out; } if (mddev->pers) { - mddev->pers->quiesce(mddev, 1); + mddev_suspend(mddev); md_bitmap_destroy(mddev); - mddev->pers->quiesce(mddev, 0); + mddev_resume(mddev); } mddev->bitmap_info.offset = 0; if (mddev->bitmap_info.file) { @@ -2327,8 +2327,8 @@ location_store(struct mddev *mddev, const char *buf, size_t len) mddev->bitmap_info.offset = offset; if (mddev->pers) { struct bitmap *bitmap; - mddev->pers->quiesce(mddev, 1); bitmap = md_bitmap_create(mddev, -1); + mddev_suspend(mddev); if (IS_ERR(bitmap)) rv = PTR_ERR(bitmap); else { @@ -2337,11 +2337,12 @@ location_store(struct mddev *mddev, const char *buf, size_t len) if (rv) mddev->bitmap_info.offset = 0; } - mddev->pers->quiesce(mddev, 0); if (rv) { md_bitmap_destroy(mddev); + mddev_resume(mddev); goto out; } + mddev_resume(mddev); } } } -- 2.7.4