Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp339724ybh; Wed, 22 Jul 2020 01:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnFxfxHCy5xnEFvtrGns4OHHU4cL9SSNKgyZMYDUZAnZMYSF8l2AZWm4wRN+eDid5FIRvF X-Received: by 2002:aa7:d7cf:: with SMTP id e15mr30334248eds.236.1595407968277; Wed, 22 Jul 2020 01:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595407968; cv=none; d=google.com; s=arc-20160816; b=jDGqoMHzq1z013AK/d+F0VQZm+UK3O6sAGDyU5vQ1VEV8c0ATVhxSeHwMNhDU1Y1Mu /BJD0ep6zvOb8JthMPqGRSzunynNfuFWWGqdKbYvBgJk4UrmTojpgznpyRzV41hsS0D7 /P8CgNKHigyM8hyL9bfjgUihRamhvnbgMTVpq9+wABkCu1HLkUYfKyv9/ZUfz3Ma8byH 3BZUZYAH8B0MJk6gb5HUn89uMrKUMYpoglvavfvuPwGPzICo5/XxcN0m3hAWqEO2yFXd x/QZso65dlbJyfnItbWPsw4mM73/gJL0TxLppjzEzBx8dgtLTllhdWJLpzOp2owJ0OXY b11g== 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:date:cc:to:from:subject :message-id:dkim-signature; bh=H24R8qVAxwYFcsepHzRqkh8E1U4cEvx3I96Wl9ElKtQ=; b=DTnZuTa2rBHTEAfWGXqaSuz3jWRC6d3qpOTFqShz9hBHHd1a97ZeZjBdS+jDaOJYWP psdWgBerM647be6v+hlvzZ7UDRnMhHH2s3r8EuLKF/i3H31W2IAAZYqRrMmdFxSKfkJG zSb5RrgwlYJxL3fbfHXsF5igjAmb8mTHYDkdl4ZLxfSZQeRGQKay1e6QX8aoZSQEH0tk P0P7Np1UWnrcvJdidhb1jjp2dVLvhCnOfhWaUdJb4ntnxjPlCb235h5QWaUQ+WAVGQ+d AWLJCFmIqPzbFrTwqAnDEFkEzAK+3uwJ92CfL48yw6YVmLcD+6FHfaz89Y1UuU6N3nBZ qdDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ROYAZX1s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si14436999edq.507.2020.07.22.01.52.25; Wed, 22 Jul 2020 01:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ROYAZX1s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731069AbgGVIux (ORCPT + 99 others); Wed, 22 Jul 2020 04:50:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53407 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731030AbgGVIut (ORCPT ); Wed, 22 Jul 2020 04:50:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595407847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H24R8qVAxwYFcsepHzRqkh8E1U4cEvx3I96Wl9ElKtQ=; b=ROYAZX1szSoMARZRMpF2q/NG4KHJgZsZeJik+1+F16EUy3ZrJdlE0JEw5oqeSyolVOwZ+O zskVxstkJauatF4vIQpy3UTJffOoRqNENZ+ZzBYwe+H8aEgcGqpORhXoskexCsqIQqpFj4 tgIe+f1d//4PvBqIfXEzTVIGaj9/Yfk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-M4qKbPESN9G2w4ycP9uygQ-1; Wed, 22 Jul 2020 04:50:46 -0400 X-MC-Unique: M4qKbPESN9G2w4ycP9uygQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13A376C2F3; Wed, 22 Jul 2020 08:50:34 +0000 (UTC) Received: from fedora-32-enviroment (unknown [10.35.206.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3615969317; Wed, 22 Jul 2020 08:50:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH 01/10] block: introduce blk_is_valid_logical_block_size From: Maxim Levitsky To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, Keith Busch , Josef Bacik , "open list:BLOCK LAYER" , Sagi Grimberg , Jens Axboe , "open list:NVM EXPRESS DRIVER" , "open list:SCSI CDROM DRIVER" , Tejun Heo , Bart Van Assche , "Martin K. Petersen" , Damien Le Moal , Jason Wang , Maxim Levitsky , Stefan Hajnoczi , Colin Ian King , "Michael S. Tsirkin" , Paolo Bonzini , Ulf Hansson , Ajay Joshi , Ming Lei , "open list:SONY MEMORYSTICK SUBSYSTEM" , Satya Tangirala , "open list:NETWORK BLOCK DEVICE (NBD)" , Hou Tao , Jens Axboe , "open list:VIRTIO CORE AND NET DRIVERS" , "James E.J. Bottomley" , Alex Dubov Date: Wed, 22 Jul 2020 11:50:26 +0300 In-Reply-To: <20200721151313.GA10620@lst.de> References: <20200721105239.8270-1-mlevitsk@redhat.com> <20200721105239.8270-2-mlevitsk@redhat.com> <20200721151313.GA10620@lst.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-07-21 at 17:13 +0200, Christoph Hellwig wrote: > > +/** > > + * blk_check_logical_block_size - check if logical block size is > > supported > > + * by the kernel > > + * @size: the logical block size, in bytes > > + * > > + * Description: > > + * This function checks if the block layers supports given block > > size > > + **/ > > +bool blk_is_valid_logical_block_size(unsigned int size) > > +{ > > + return size >= SECTOR_SIZE && size <= PAGE_SIZE && > > !is_power_of_2(size); > > Shouldn't this be a ... && is_power_of_2(size)? Yep. I noticed that few minutes after I sent the patches. > > > if (q->limits.io_min < q->limits.physical_block_size) > > q->limits.io_min = q->limits.physical_block_size; > > + > > } > > This adds a pointless empty line. Will fix. > > > +extern bool blk_is_valid_logical_block_size(unsigned int size); > > No need for externs on function declarations. I also think so, but I followed the style of all existing function prototypes in this file. Most of them have 'extern'. Thanks for the review! Best regards, maxim Levitsky