Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1720472imm; Thu, 27 Sep 2018 01:10:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV6308fMtynZOrC9vG5sPQQaHElvXJH2lJRiZhkXUnIbvFLThIcAey2C1+wgiAno3yyh0Dlw/ X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr8868179pgj.356.1538035834008; Thu, 27 Sep 2018 01:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538035833; cv=none; d=google.com; s=arc-20160816; b=VoJyTk21ZZPojvV8fEQfPh4Pp7BxvELhx7JhQlENO/yN59RuUYhGjbgf1mGd+BaXmv T7t5KqeqFl8hFSxEt9X6NYJ5EyP6evgXQ6LCwsKTKRMATekhPhozsckdcFF5a4Xky1SB OoWWD/+ax5IFJoJFZpiQ+GZzNrA7OuO+NrDTmNC25eIdkHnks/e6PT5S8PnZlBMZ+R0V 0X5z7GpUWuqEns0AFou9whfAAJ6ZHdnKZjElQWu5dG4wAoS/KdGo2zO0fQp1Qz8/ofgJ O9U0/fasZF75fPy77NSPRjQms0ESgPyyapeG1ZwDPWYpiwevObHwN0AtiD9c6qKIX1Xt f5pA== 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=I3IjiiTtgj3cp3ij0TNgBVCKK7QImTXbAYlmJHpzt0A=; b=Rbs3RwmLNQS5M03jnXDVb6Cyk8lQ6khW5ziSSs33qquf4z8f6KQlHikUZZybZT0P2u DSpn9IwADegLcfs5i4A7xrBDtLmkIVTs6I0+RjyXko/jdBeA+1/tsFEzA2davMKyeDiR xGKVwvj7pwlL3aK9HDBQJO9t6geSpuHiw4zPT5PQ/gqdL98v98RPlHdI/vpwm0cDpXdJ zzeBtZ6M7/GyM+VcqjRHMcWm6vsvDcC9D8d8hD1VCtrT+Z1DMkMvUFIfEP114h2CCI24 b0KYiVbay+RLw7MqI5wMiNdHAkYT46SPJrQQe3do33xAZvf8MKsvaoYz00szir7GrPZN r7cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UYABdoke; 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 x23-v6si1356377pfk.25.2018.09.27.01.10.18; Thu, 27 Sep 2018 01:10:33 -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=UYABdoke; 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 S1727326AbeI0OZA (ORCPT + 99 others); Thu, 27 Sep 2018 10:25:00 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:36510 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727064AbeI0OZA (ORCPT ); Thu, 27 Sep 2018 10:25:00 -0400 Received: by mail-ed1-f67.google.com with SMTP id f4-v6so4223483edq.3; Thu, 27 Sep 2018 01:08:00 -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=I3IjiiTtgj3cp3ij0TNgBVCKK7QImTXbAYlmJHpzt0A=; b=UYABdokezUuF0hllbqv1TxyopXGL79NTO65oX4cgY4TbLlpgiJjaQvkqjvW+cTiMa+ tl7qsTP0AB3P251MWzt9htDkQmGh1GcM0bHQVimlOvvsEh/R3QL69eLaBwYEcAHTQ8iu OdT2UUPk1qzu2V6YcMB2vSCJMb1KvCEprqWRSIvt3Qivh83RN2+q1/ZTKlFl6cjXCbBM AoXMB3KnqjAok6LHtWQzNzR/miBoZ3/RsJ98tSuBdaaObxbsN9BseKp7a5V113IOCk5f 7SZ2ldOyRfjo71s4KrHEUIakF8D/UCDJNr3d+nSiqmPFddPrskzzm5MvFIXKqTE5TGlq FxHQ== 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=I3IjiiTtgj3cp3ij0TNgBVCKK7QImTXbAYlmJHpzt0A=; b=aYisEP8ttqbf9Of9XfkNB1re2F0yugBdblSr2qQPyBS0wKtx2zl8cLDasRbI4mPkDD VHxtphJjejaMAotpsGqIcIsrrw7/nCO25UvgJQJ1akmficvFDoE9gUHW+xnBG2RCXq6b y9WQFhtoyD81HpYjv28eNgHaX3HuTxwfRVJME2rY8QWY+qGZE2sb4Q4ZeOH3UYuiSUiQ uVorHhtaCwvjJWEI9WWzs+0DSmtIWfnGbqL2VEij95LKE0GWrRVD7hrjqbu2gN2NOPFZ 4uFOT8aUx52QAUjpdCjDCa1WZPHjEWyDZpYYSDzX258MqsC+vGundU049aeSXEdfznae EMIQ== X-Gm-Message-State: ABuFfogUzUlHiPRj0xzRpIv0E80Fqv9gcGu1/a2hgLHXlFOu9MbGnjte bI/TwlVHETHsE+X6eSOQ4Xg= X-Received: by 2002:a50:ace6:: with SMTP id x93-v6mr11763921edc.176.1538035679826; Thu, 27 Sep 2018 01:07:59 -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 g39-v6sm1127372edg.63.2018.09.27.01.07.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Sep 2018 01:07:59 -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, 27 Sep 2018 10:07:57 +0200 Message-Id: <1538035677-20770-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 Reviewed-by: Gioh Kim --- v2->v1: add reviewed-by. --- 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