Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp259914ybv; Wed, 12 Feb 2020 23:40:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxVpWepqeB1IVAk+bW4RuGWMGaxUY67JipNXJbSiHzL3FyzD7wQuNJZTPQjoB3C0PVVHYql X-Received: by 2002:a9d:6ad6:: with SMTP id m22mr12764987otq.7.1581579631183; Wed, 12 Feb 2020 23:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581579631; cv=none; d=google.com; s=arc-20160816; b=IorFEvGABe/ekIDtcGuAO+ICMg6Ggh7se7lwG9iYBu66FJZfTzsok5oYA2b6zqKuE/ q51mb+3LTUV9ZHQ/4lNGP/Xi2atn5mblbwS1/C1U8tLo4ifSKCDgcQUfu0X8uTVjjeDZ EZ2tK4HlVnQsKYxtwwi94vmtDtrMjhqpRuQJMNfjJ01ufJqJYDLh7sA9Ss8SIcj2ijDb D+48Ao+pCk9CPLe+09hyTPvHiVzZncfJ5nl+CiAp5ZPpB525geh2Vcc02D1rQ9rCRDg4 J0Du9t7KFvZKcELfIrMwlJhhXY9vlR2Xe3yz1dmj4KRzQJKzHEBrDuYoJDivQpFxisAP M55g== 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:cc:to:from :subject; bh=YLNUGWPdnWm7awGuRNz42b4yDIzhw6nYhcnNBIXR5WE=; b=k6OtDH3S68Fr+PJJCo3feNWM7/eM0/2cd8Q5lKMuJJ6o5Ap4XYGWRsftZAaI+LSEze pUK0wDoUFquBF3xKlhkDfXeFjLUzIPzmAAUMneOMK5zhTKrSv7EmLkIOuxYMuxzccGBF yJiC1MSQ1d9zXF+Ho+7dipL9f/G906jvqHARGM7Bbyyyde/wBAtXrpMN8iw1BOWayb9a XX/sP2dW8b5Rx0gqCjXu+4d/20pv5K1oJaaNelMapWdQzy4POtDDhJQJfRvGmVR1ZCjI b7tcVwtSWdY9LFas1dGTlz8cMEu7I3Jdp4FZ/lMT9Ez2vaj+aNnNP87IDvOOhuVm64J8 OIZA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si755167oiz.131.2020.02.12.23.40.18; Wed, 12 Feb 2020 23:40:31 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729911AbgBMHkF (ORCPT + 99 others); Thu, 13 Feb 2020 02:40:05 -0500 Received: from relay.sw.ru ([185.231.240.75]:41064 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729838AbgBMHj4 (ORCPT ); Thu, 13 Feb 2020 02:39:56 -0500 Received: from [192.168.15.156] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j295u-0001Tm-IL; Thu, 13 Feb 2020 10:39:30 +0300 Subject: [PATCH v7 5/6] block: Add blk_queue_max_allocate_sectors() From: Kirill Tkhai To: martin.petersen@oracle.com, bob.liu@oracle.com, axboe@kernel.dk, darrick.wong@oracle.com Cc: agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, song@kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, Chaitanya.Kulkarni@wdc.com, ming.lei@redhat.com, osandov@fb.com, jthumshirn@suse.de, minwoo.im.dev@gmail.com, damien.lemoal@wdc.com, andrea.parri@amarulasolutions.com, hare@suse.com, tj@kernel.org, ajay.joshi@wdc.com, sagi@grimberg.me, dsterba@suse.com, chaitanya.kulkarni@wdc.com, bvanassche@acm.org, dhowells@redhat.com, asml.silence@gmail.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ktkhai@virtuozzo.com Date: Thu, 13 Feb 2020 10:39:30 +0300 Message-ID: <158157957022.111879.2458344432302909777.stgit@localhost.localdomain> In-Reply-To: <158157930219.111879.12072477040351921368.stgit@localhost.localdomain> References: <158157930219.111879.12072477040351921368.stgit@localhost.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a new helper to assign max_allocate_sectors limit of block device queue. Signed-off-by: Kirill Tkhai Reviewed-by: Bob Liu --- block/blk-settings.c | 13 +++++++++++++ include/linux/blkdev.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c index 8d5df9d37239..24cf8fbbd125 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -259,6 +259,19 @@ void blk_queue_max_write_zeroes_sectors(struct request_queue *q, } EXPORT_SYMBOL(blk_queue_max_write_zeroes_sectors); +/** + * blk_queue_max_allocate_sectors - set max sectors for a single + * allocate request + * @q: the request queue for the device + * @max_allocate_sectors: maximum number of sectors to write per command + **/ +void blk_queue_max_allocate_sectors(struct request_queue *q, + unsigned int max_allocate_sectors) +{ + q->limits.max_allocate_sectors = max_allocate_sectors; +} +EXPORT_SYMBOL(blk_queue_max_allocate_sectors); + /** * blk_queue_max_segments - set max hw segments for a request for this queue * @q: the request queue for the device diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 40707f980a2e..f5edbfea7b84 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1088,6 +1088,8 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q, unsigned int max_write_same_sectors); extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q, unsigned int max_write_same_sectors); +extern void blk_queue_max_allocate_sectors(struct request_queue *q, + unsigned int max_allocate_sectors); extern void blk_queue_logical_block_size(struct request_queue *, unsigned int); extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); extern void blk_queue_alignment_offset(struct request_queue *q,