From patchwork Wed Nov 4 16:32:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 7552001 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CBC499F36A for ; Wed, 4 Nov 2015 16:36:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A77220652 for ; Wed, 4 Nov 2015 16:36:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 459E02065A for ; Wed, 4 Nov 2015 16:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030614AbbKDQgT (ORCPT ); Wed, 4 Nov 2015 11:36:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52093 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030515AbbKDQdh (ORCPT ); Wed, 4 Nov 2015 11:33:37 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 1E5288BA62; Wed, 4 Nov 2015 16:33:37 +0000 (UTC) Received: from rh2.redhat.com (vpn-58-103.rdu2.redhat.com [10.10.58.103]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA4GXTUv000415; Wed, 4 Nov 2015 11:33:35 -0500 From: mchristi@redhat.com To: linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, drbd-dev@lists.linbit.com Cc: Mike Christie Subject: [PATCH 04/32] block: prepare blkdev_issue_discard for bi_rw split Date: Wed, 4 Nov 2015 10:32:59 -0600 Message-Id: <1446654807-6935-5-git-send-email-mchristi@redhat.com> In-Reply-To: <1446654807-6935-1-git-send-email-mchristi@redhat.com> References: <1446654807-6935-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mike Christie The next patches will prepare the submit_bio users for the split. There were a lot more users than there were for submit_bio_wait, so if the conversion was not a one liner, I broke it out into its own patch. This patch prepares blkdev_issue_discard. There is some compat code left which will be dropped in later patches in the series. 1. REQ_WRITE is still being set. This is because a lot of code assumes it will be set for discard, flushes and write sames. 2. submit_bio is still taking a bitmap. This is to make the series git bisectable. Signed-off-by: Mike Christie --- block/blk-lib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 9ebf653..0861c7a 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -42,7 +42,8 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, { DECLARE_COMPLETION_ONSTACK(wait); struct request_queue *q = bdev_get_queue(bdev); - int type = REQ_WRITE | REQ_DISCARD; + int op = REQ_OP_DISCARD; + int op_flags = REQ_WRITE; unsigned int granularity; int alignment; struct bio_batch bb; @@ -63,7 +64,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, if (flags & BLKDEV_DISCARD_SECURE) { if (!blk_queue_secdiscard(q)) return -EOPNOTSUPP; - type |= REQ_SECURE; + op_flags |= REQ_SECURE; } atomic_set(&bb.done, 1); @@ -108,7 +109,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, sector = end_sect; atomic_inc(&bb.done); - submit_bio(type, bio); + submit_bio(op | op_flags, bio); /* * We can loop for a long time in here, if someone does