Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp12993pja; Fri, 22 Nov 2019 02:48:14 -0800 (PST) X-Google-Smtp-Source: APXvYqztVr7Z/plO7TBuJzuD6Rn6NZiMbYlAaDlLm91zJOs4d7Cz8k2Di5c4HGotgEG+zv5rRMUu X-Received: by 2002:a17:907:2078:: with SMTP id qp24mr21323024ejb.157.1574419693977; Fri, 22 Nov 2019 02:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574419693; cv=none; d=google.com; s=arc-20160816; b=SRrOKryUpDAtLkk5WHin1aCBwk3xkDxuWtAXn1bBqvrWAZYTlRpbTYGxjYom9dTHJX YKfqMFbiTVV/MlDkEtcc68vpWtUm4ZCQkoUQA8B4HyxIYDx/OzUXZ2u0FNH2c8gc+9Co IyK0HFNg9/MLc0zBq1aOGr70fpBFcSWMwbi519p/euJXCRXtBEwDJ455YdsY2d3Ak1L5 WwRdJMeylDoCJFIrGKKU2nTuuKCuCiTBZZYPgA6XJuCazS/+Rvp6/jnZKiTPwQbobNFk NYsWkehENhq1lPcT+97QZtEXUcIZhg5zZyxNLpd8PwXg22+1/TnW3TPwerO7LfhfQjuj Tk0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kEY1sfXjdWAaLE9UT4rQYE+HJSepTzwymlrkQPu4TfE=; b=txlcpQpHJL/WLDH1DcH6oPyrB3/DiiTEUpaVBv9MZvrss29p58zKzRDOBr/cm6E95v Rujg/4KN20ZIKcfKdV0/3otcYjpUGCzONwxYMGerdB/tCwtwaTJ5m+XGj5SvHUINK4e8 7dGyW9ECIc7vEdDI7Dxv7Lo3fqzQFev5y9/NtZ+mc1t8v8eAAQd/FBDEj84w/AcbpS67 XlaeCVaPJdAPURAmZco6qWnGbvlkIAll4McUSD5qDtEie7HFb7wVA6qi0F1IylQhtAVv /Syejbnrqcx2JuNInIJfeYkKF1yu9NGr7m3sODq5iVnouP9gQBMkTmG9JM3shrWgkrPS lLqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CMikqmNJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26si3917476ejb.223.2019.11.22.02.47.49; Fri, 22 Nov 2019 02:48:13 -0800 (PST) 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=@kernel.org header.s=default header.b=CMikqmNJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbfKVKqG (ORCPT + 99 others); Fri, 22 Nov 2019 05:46:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:52940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729545AbfKVKqC (ORCPT ); Fri, 22 Nov 2019 05:46:02 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3060020748; Fri, 22 Nov 2019 10:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419561; bh=DLqtyD3FkQpL4d6hSuqWxbmsfSbHPKfvIDSHACFVQUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMikqmNJ69Z2h5ffuKYtmu61LgraIdDEvszalaFTG8fAUww1L9nK4R48IZa9lUXB6 Ow+hJoO6TGHrer6EAx5Nfn6XU/9t9fokvC+MOLw6fAmQ0yQacWCoDOlYqwZrrO2EqG UoRDjWBtFdMS0lpl5xh4krjjHTJsAwMctCJSWjNQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Jens Axboe Subject: [PATCH 4.9 153/222] block: introduce blk_rq_is_passthrough Date: Fri, 22 Nov 2019 11:28:13 +0100 Message-Id: <20191122100913.777795515@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100830.874290814@linuxfoundation.org> References: <20191122100830.874290814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig commit 57292b58ddb58689e8c3b4c6eadbef10d9ca44dd upstream. This can be used to check for fs vs non-fs requests and basically removes all knowledge of BLOCK_PC specific from the block layer, as well as preparing for removing the cmd_type field in struct request. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe [only take the blkdev.h changes as we only want the function for backported patches - gregkh] Signed-off-by: Greg Kroah-Hartman --- include/linux/blkdev.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -212,6 +212,11 @@ struct request { (req)->cmd_flags |= flags; \ } while (0) +static inline bool blk_rq_is_passthrough(struct request *rq) +{ + return rq->cmd_type != REQ_TYPE_FS; +} + static inline unsigned short req_get_ioprio(struct request *req) { return req->ioprio; @@ -663,7 +668,7 @@ static inline void blk_clear_rl_full(str static inline bool rq_mergeable(struct request *rq) { - if (rq->cmd_type != REQ_TYPE_FS) + if (blk_rq_is_passthrough(rq)) return false; if (req_op(rq) == REQ_OP_FLUSH) @@ -910,7 +915,7 @@ static inline unsigned int blk_rq_get_ma { struct request_queue *q = rq->q; - if (unlikely(rq->cmd_type != REQ_TYPE_FS)) + if (blk_rq_is_passthrough(rq)) return q->limits.max_hw_sectors; if (!q->limits.chunk_sectors ||