Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3883834pxb; Tue, 26 Jan 2021 07:10:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9KBZu9qgm00kyOj2cChjNH47gOjfHxU5V3zksSkjAZNWZ1lR0D5zsRMqL2G7UzsQOuhw/ X-Received: by 2002:aa7:cfda:: with SMTP id r26mr4865099edy.142.1611673834294; Tue, 26 Jan 2021 07:10:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611673834; cv=none; d=google.com; s=arc-20160816; b=gQwdIcdvLmMNj8sssu7G6TgB2oP6eTWlD740g7NpZMYA57k/SsoDM53PjQAMluLRlR RBu4KgXSxc2R860+fEMx6vezlXuLTd9RWw9/Af1xKpT+DVxLtMJUFVEt2awtreMjVh1/ 8LEpt18nDPCGi7RqcXghASpRlgRQZOSszCA9KFtFpDpM949yjixqIVcnKW4Zt2I3QqPT 4buvfsu0JOz17hprQofcDNNfSafq0sg57RGWdX8ceGgQlX2V/8LJjZVLZ/on8E/6HnBb kX1gM0BRxWAtPbjZrmpAvBxURbb7vSW2VPRGrSIge/UEB7dV8QOUz2GeqyogOUOOb6I9 VuPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KOVL9a1MkJeVtbO5wAEfyylWZoWniZN5JlBdpQ6RLVM=; b=cr3i0+/qOgAftVXkXojYrKOc9tvL0enMctS7HNQOd6kW03momj6Q879YenomzHXdIy 2RY0CziT7yBDZFKHn/ytJXhpJfWE568DS4DN5X6f5oSi/riKDNv9I+Iy9K92HuUPgtNa KLFrR+xhVxer5NEyYNcU+BSHdtvBCrDuFi3KLc5YMSpVKS+gzJTn/lQ0Qc8b0xnQl8wQ Watd7B7YNx08p2bTqXCv1H/pVIeu/za32UKaMV4KAW0MheZDjhRlKm0mQE8D8+NEkxky cedNaTbuEPLx7rvyP/xJ3EH2zrcFAu/n/VC04uQAKuvhoii+Hca5kDBX3CiT3TLnozcJ L53w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="UXprdS/M"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du19si7058423ejc.206.2021.01.26.07.10.07; Tue, 26 Jan 2021 07:10:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="UXprdS/M"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406152AbhAZPId (ORCPT + 99 others); Tue, 26 Jan 2021 10:08:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406135AbhAZPIT (ORCPT ); Tue, 26 Jan 2021 10:08:19 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D25D4C061A29; Tue, 26 Jan 2021 07:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=KOVL9a1MkJeVtbO5wAEfyylWZoWniZN5JlBdpQ6RLVM=; b=UXprdS/M6ExT6y8z2YkV6ntwGP omDC0ofe3OnxV6Yi9f2pOA923E0+NvR1wQq66SRHdZNqeVD0AQ/Acio/9Gjfz/d10FJCj/4OtjPPq 5vLqgkQ6Gw3w0jW1aGI3RDIv1430L0ay0COX8MLA1pUbgCL2jA3OvOmmWJjwcwk2myTY7jXxTdmLj Mi4ZHZsF7s1B2FS9/PgBbHuju0uOmuX3pLQJDcXwpWqzfDAQIQJbd7/DZ2lCXEyuoiqh6J3yWSM10 2Im25S5t/YszSEhuYaz0/qYB7rknN6NIVA+IhRXWoJioq0M/9ZpeFlFCgmoUfgLlfbp5pszdUTI5J oiwn5nvQ==; Received: from [2001:4bb8:191:e347:5918:ac86:61cb:8801] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l4Ps6-005mzo-8D; Tue, 26 Jan 2021 15:03:27 +0000 From: Christoph Hellwig To: Jens Axboe , Song Liu Cc: Jaegeuk Kim , Chao Yu , Philipp Reisner , Lars Ellenberg , Coly Li , Mike Snitzer , Josef Bacik , David Sterba , Damien Le Moal , Naohiro Aota , Andrew Morton , Ryusuke Konishi , linux-nilfs@vger.kernel.org, dm-devel@redhat.com, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 06/17] dm-clone: use blkdev_issue_flush in commit_metadata Date: Tue, 26 Jan 2021 15:52:36 +0100 Message-Id: <20210126145247.1964410-7-hch@lst.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210126145247.1964410-1-hch@lst.de> References: <20210126145247.1964410-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Use blkdev_issue_flush instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/md/dm-clone-target.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c index bdb255edc20043..a90bdf9b2ca6bd 100644 --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -85,12 +85,6 @@ struct clone { struct dm_clone_metadata *cmd; - /* - * bio used to flush the destination device, before committing the - * metadata. - */ - struct bio flush_bio; - /* Region hydration hash table */ struct hash_table_bucket *ht; @@ -1155,11 +1149,7 @@ static int commit_metadata(struct clone *clone, bool *dest_dev_flushed) goto out; } - bio_reset(&clone->flush_bio); - bio_set_dev(&clone->flush_bio, clone->dest_dev->bdev); - clone->flush_bio.bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; - - r = submit_bio_wait(&clone->flush_bio); + r = blkdev_issue_flush(clone->dest_dev->bdev); if (unlikely(r)) { __metadata_operation_failed(clone, "flush destination device", r); goto out; @@ -1886,7 +1876,6 @@ static int clone_ctr(struct dm_target *ti, unsigned int argc, char **argv) bio_list_init(&clone->deferred_flush_completions); clone->hydration_offset = 0; atomic_set(&clone->hydrations_in_flight, 0); - bio_init(&clone->flush_bio, NULL, 0); clone->wq = alloc_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM, 0); if (!clone->wq) { @@ -1958,7 +1947,6 @@ static void clone_dtr(struct dm_target *ti) struct clone *clone = ti->private; mutex_destroy(&clone->commit_lock); - bio_uninit(&clone->flush_bio); for (i = 0; i < clone->nr_ctr_args; i++) kfree(clone->ctr_args[i]); -- 2.29.2