From patchwork Thu May 3 15:20:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10378649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 314B1603B4 for ; Thu, 3 May 2018 15:21:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A4802925B for ; Thu, 3 May 2018 15:21:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 140C429215; Thu, 3 May 2018 15:21:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D48C22925B for ; Thu, 3 May 2018 15:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751196AbeECPUw (ORCPT ); Thu, 3 May 2018 11:20:52 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:34032 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbeECPUu (ORCPT ); Thu, 3 May 2018 11:20:50 -0400 Received: by mail-io0-f195.google.com with SMTP id p124-v6so22094377iod.1 for ; Thu, 03 May 2018 08:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6UjDbtiraQhcMvu8W9knHCOItbFcUNtMG1eMpAy/WIk=; b=IGFh5e6E2gAxzjz35ixW/tt0jfww46eTYI3wABsYXsLIpShn/6fBXoxcUcfJH8+MKz opREbO3XTvW5x9+oaPoMl6f/WCswymldU5LLSnRF1WWEA+JVzngnHxwuWjCqJ/+sDiW8 QUi5ynnt94V+x1I/HE766USdhmk1LG3YaCwoz3WMBfmsrz+1JXTSIkY1En65mNK0Z55e 8yGt+RDJLMYHeat1tCuiX6m+Krcs01OR7VGnTncjL2OqGXAkq3d4iNW84W2Wo6Kv7lMt TOzhYlB2GhVTBoHWwGQlmHEIT7b1XwaphZrrlaW9zw5V90VpwRauuhWoLjM1WeM6t+PN hrBw== 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:in-reply-to :references; bh=6UjDbtiraQhcMvu8W9knHCOItbFcUNtMG1eMpAy/WIk=; b=b7VL7Uha17AwAZlt/bkSD/T4x/QcqFBuVwJWRt+VqO3rlLaosI9SvjCBs1SXyXy3BQ FuCZYeEmz+M7AteWjI7oVpcTz9aEID5kjKZCAa0bYyWLjblzW043v4DKv5tqZYxFUq0t E4VxAcwhv6uE7zxwhi04oI2Ve3SET8WBZwhyQAtu9vlOkOntpS714yQ9Gqx0qgEduG5t 7XePgrX/J+xh5CoigywjwN+wyTMd6G9h3XH3ETpDkOSE0hyQj7hFDcXla6WGYpQI5Kxa Sc7mxa1d1YkdHt0IdAImEo4fL9KsuKbpgZX2xcZl6GOFFPGfyDBEP2M6yl81Cvs1p+u6 Lweg== X-Gm-Message-State: ALQs6tC17SGfjuIIRBE9v20k1ejX2Sdqn1R5EFuE6WRnN9aY8F7K4DDX J/wMf/or2pyDmR5Gd9tLWMZGHA== X-Google-Smtp-Source: AB8JxZp4KCOzM5eTYc9akJTC57INL7p5kiSTILhXHhLlCLnHbfhT9G+ILnWmiCcdEEXY3tLymABCvg== X-Received: by 2002:a6b:d918:: with SMTP id r24-v6mr12937675ioc.301.1525360850005; Thu, 03 May 2018 08:20:50 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id 10-v6sm4860537ite.28.2018.05.03.08.20.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 May 2018 08:20:48 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-xfs@vger.kernel.org Cc: dchinner@redhat.com, hch@lst.de, Jens Axboe Subject: [PATCH 2/3] blk-wbt: account any writing command as a write Date: Thu, 3 May 2018 09:20:42 -0600 Message-Id: <1525360843-6504-3-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525360843-6504-1-git-send-email-axboe@kernel.dk> References: <1525360843-6504-1-git-send-email-axboe@kernel.dk> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We currently special case WRITE and FLUSH, but we should really just include any command with the write bit set. This ensures that we account DISCARD. Signed-off-by: Jens Axboe Reviewed-by: Christoph Hellwig --- block/blk-wbt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-wbt.c b/block/blk-wbt.c index f92fc84b5e2c..3e34b41bcefc 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -701,7 +701,7 @@ static int wbt_data_dir(const struct request *rq) if (op == REQ_OP_READ) return READ; - else if (op == REQ_OP_WRITE || op == REQ_OP_FLUSH) + else if (op_is_write(op)) return WRITE; /* don't account */