From patchwork Mon May 7 16:13:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10384453 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 9A60D60318 for ; Mon, 7 May 2018 16:13:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83AEC26E98 for ; Mon, 7 May 2018 16:13:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 780EA2866F; Mon, 7 May 2018 16:13:46 +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 EAF6826E98 for ; Mon, 7 May 2018 16:13:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbeEGQNp (ORCPT ); Mon, 7 May 2018 12:13:45 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:38434 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbeEGQNo (ORCPT ); Mon, 7 May 2018 12:13:44 -0400 Received: by mail-it0-f66.google.com with SMTP id q4-v6so12494506ite.3 for ; Mon, 07 May 2018 09:13:44 -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=/N9RFj23H9kXFtbFURRPkwqLZhwpdAOSoTjj1LxtFP0=; b=JVbGlh5lNYkthRaGN74yOuDRXl0J7ldNAikRMH7UA4X7FmMSO0hbnoJqOGyk6LTnet LXyHHen60A+zX6LkrE9qTE1XlmLgSbREGJXvg6MV5HhRnLCFb4gp6RnoDb93NCXrPfQI fMBGeX5oqVClflpazPdYizcc/b2CXlo852xuJWrHAXZp4npEic2NFJ358z12L/qgpJt4 cvUH/8EwWFYRvcrQtrSbSlLMiUjtTIWiGdfd3luizCF0AZlXKNGXjKRhh02IEX5ApRkz dvXI/jM+bSFr/w9Y2aZ6WChM8qmtUCDaZNX3f4ADZFWYi5vbTQk79lcJMLy8x0ygm0x5 I3rg== 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=/N9RFj23H9kXFtbFURRPkwqLZhwpdAOSoTjj1LxtFP0=; b=aTjXeWWqaR4n3IJ9D24L80bJmQhMcBAWEEGvDYV8TKJ8TDFMNRjMxpWi7CGu/LO2nH 7G+y5SP0z/I2pAZKAU5MPv0zj656ZM6pNYjotFBOI1mmrqrN2GYuYP4r4flsnGMKzZyX zqYZA5BgTXS/jpgucRLj5aEvOzlY5BlEYzKC5M0tkwf3icSMgjc/orm2R4/RDHXdF6K5 1WrVxEt7RjOQgfI6yctgVkr16X+i/lz1bu8oj8fEs+nACU6PImFymobICLelwhwhS0Fa S5Nht1P7SaZ3Ex57fYiAQ4oybg5CIxl4YE89b6wdcuKbZsIp4ljFx9adPzxHDxdYfL99 UgqA== X-Gm-Message-State: ALKqPwetpZkoW8SJuOMkvBjZ82IxHGEavwzXsmYZeXtU4IFxd3AAgQI4 HV+snSenQMyxIBVh/Wi6mCb5kA== X-Google-Smtp-Source: AB8JxZoKMPULIDE8n8dSDLp2zWzH/jGKjjqh4u6k3/IhjKTPIzM9vhcjcCzm4CGhvP8C3drJL5IhAQ== X-Received: by 2002:a24:9794:: with SMTP id k142-v6mr1947848ite.105.1525709623606; Mon, 07 May 2018 09:13:43 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id q5-v6sm9003192iod.32.2018.05.07.09.13.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 May 2018 09:13:42 -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/4] blk-wbt: account any writing command as a write Date: Mon, 7 May 2018 10:13:33 -0600 Message-Id: <1525709615-14395-3-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525709615-14395-1-git-send-email-axboe@kernel.dk> References: <1525709615-14395-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. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe Reviewed-by: Darrick J. Wong Reviewed-by: Omar Sandoval --- 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 */