From patchwork Mon Feb 15 07:01:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8310421 Return-Path: X-Original-To: patchwork-linux-block@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 DD4F49F2F0 for ; Mon, 15 Feb 2016 07:02:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16DDC204DE for ; Mon, 15 Feb 2016 07:02:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 459BB20114 for ; Mon, 15 Feb 2016 07:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbcBOHC2 (ORCPT ); Mon, 15 Feb 2016 02:02:28 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36832 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbcBOHCO (ORCPT ); Mon, 15 Feb 2016 02:02:14 -0500 Received: by mail-pa0-f67.google.com with SMTP id y7so337449paa.3; Sun, 14 Feb 2016 23:02:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4724jxR3yRsSlPWhKY3mFe8miU6zxzDPqwEva6LZZxo=; b=PXFm4FzLPEen/bGQ4LnpyIzaGEz0cmLAhArycJxw4lsqQLVz5JvYziBVwnqnQ6ehFl 76Do9u1sPc2ddzdmeoP/3K4tcsLFd9qvOm2J8VO7DwMm+w+YuKY5aAkNVGEN4aZVzfAR sNYLHZR5fB/4m4SPAtF9Qx8UC7dpSt9HrrS02c6mWmzN40NSt7RpiYRdZA4IjFjuNXQc oNMmY0zenG73QjnPSl64M6tD3u4c+uQb1oUqOWaeVDsxqAnzD4D1cbLkFoxjImXEdL9W NNYNihC2RrDJE8vtwRa3c25KQ0QozBlXgbY3vGYZiA9FFuhlbL6o7ZGnuSppfO2mZvqU k//A== X-Gm-Message-State: AG10YORIS1x5iOBaW/0fl6B4ICGyWI7AjeEVyNDeJsjBz/OS/Cj6DaV9nMlLWW2Fhuhytw== X-Received: by 10.67.1.177 with SMTP id bh17mr21610624pad.128.1455519734279; Sun, 14 Feb 2016 23:02:14 -0800 (PST) Received: from localhost ([103.192.227.7]) by smtp.gmail.com with ESMTPSA id b63sm35822268pfj.25.2016.02.14.23.02.12 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 14 Feb 2016 23:02:13 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Ming Lei Subject: [PATCH 2/4] block: check virt boundary in bio_will_gap() Date: Mon, 15 Feb 2016 15:01:25 +0800 Message-Id: <1455519687-23873-3-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455519687-23873-1-git-send-email-ming.lei@canonical.com> References: <1455519687-23873-1-git-send-email-ming.lei@canonical.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 In the following patch, the way for figuring out the last bvec will be changed with a bit cost introduced, so return immediately if the queue doesn't have virt boundary limit. Actually most of devices have not this limit. Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Ming Lei --- include/linux/blkdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4571ef1..b8ff6a3 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1388,7 +1388,7 @@ static inline bool bvec_gap_to_prev(struct request_queue *q, static inline bool bio_will_gap(struct request_queue *q, struct bio *prev, struct bio *next) { - if (!bio_has_data(prev)) + if (!bio_has_data(prev) || !queue_virt_boundary(q)) return false; return bvec_gap_to_prev(q, &prev->bi_io_vec[prev->bi_vcnt - 1],