From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0252C433E4 for ; Wed, 22 Jul 2020 08:51:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBF0F20792 for ; Wed, 22 Jul 2020 08:51:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HBhs7XXY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731050AbgGVIuw (ORCPT ); Wed, 22 Jul 2020 04:50:52 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:22375 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731026AbgGVIut (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=1595407848; 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=HBhs7XXYUsZnZBl5sU85W/BFjxpdKv3ZJLBl+VZZi6Jz+BpzbmYLubLQpkK7iC1n65siEA E+D0lsZEdHuwPJ8KiEP8g4W81VUaWNjlz/6O0s+1IOrnpgql/HB4/BQYJCGfTTsCmj351v 2BlYHpT9z1gt3FknxaYGz9bJ1B4wybU= 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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@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