Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19527745rwd; Wed, 28 Jun 2023 10:26:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xbAwR0OgMqe4AxDY9MfmwRV14qzjo1jKPNyeJW9GnrLfBr5ffwtuL+sDnhUipj65aCl7B X-Received: by 2002:a05:6a00:1a51:b0:67a:153d:1cf9 with SMTP id h17-20020a056a001a5100b0067a153d1cf9mr8084418pfv.6.1687973177547; Wed, 28 Jun 2023 10:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687973177; cv=none; d=google.com; s=arc-20160816; b=KXWLmHmOyPk/WdwTZJagOP/xg4Sd2oRCR1LrcdPNtZB6siVFkc9plXQztBRf9uvcoY joOwsN9FNxTO/d5U8//ZpcxGNW36F/rz6E338lfNqY7wXVbV9PKnUeYtNgKrGUqIWz2P 4LURxHMnacEh/YdV/MstK6EyRnzQJZRl0G33+tyxVri7imS/gAgMsYhe4/UiChh7Qk1i Adtstx/8IhU3rXudjVLVIe8D4MgBAHZgqZV+Y1F7v/twYeEIgUXA24AlDUvNi79oggPm rYw0vI0o6CSNLuVDqhGXAn+j/Uah0WRu4Um9Xau6QCNG7bxvQncOORfpogNj+zbtIOb2 957A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9vOBIaytrYiPkaqMIJvuxkcnZSEVMg/kCzHHy7/59jY=; fh=rAT+/ffoWXzJvQc/Z3ruw5luvvtxeuVQ8fJH11TlvwU=; b=0kJ8xJdzTgSlJIl3FU2fObefJ6cMgMMC1d2BbmrcT2bWF3HKxyRDQ5hjjGbdCIJkE4 53h7c4q3hRmbsvdPowFrJyZWbzg9Yo94jCPfllvR8JzrL2My1qyyP2kEjH1EXUmTc5yG 4xj3D3g1eAyBH2Y/7sMVKOiz2PaH7nkkKpvyeQneLKNkPCRg/fw37+uT6uycFA1VAoHt znwbGovuPj12oWvyuXUQ+vUrXa7eYWPR/UCKa0cUPkM681c1CRcC5s/X+tkrbWCABSpB nbOLjEnqeSgqwGx4iirXhpgDQ3qzR/ncvLbMSZAlfI109fFhNa0xueD8c6v4ftZHa5Bo X0ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="X2WG/GJr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a056a0022c400b006724753efe8si8021104pfj.192.2023.06.28.10.26.05; Wed, 28 Jun 2023 10:26:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="X2WG/GJr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231833AbjF1Qqd (ORCPT + 99 others); Wed, 28 Jun 2023 12:46:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:32176 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231731AbjF1Qqa (ORCPT ); Wed, 28 Jun 2023 12:46:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687970743; 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: in-reply-to:in-reply-to:references:references; bh=9vOBIaytrYiPkaqMIJvuxkcnZSEVMg/kCzHHy7/59jY=; b=X2WG/GJrDCZpue6ZrVvzSyYow8uaXee7mlKbwTsnhnVZRlVzbDEJMv/oLG20/BdUzYtonF sHOQgOBTTs6iOX/rtA+6dvWnTmkIn5gVK/yqr2dZc3hW/NQXxipgy9edUZTVjrYDlWrWlU HOFjRWZsTSppRafGXPhlgjg8eX//geo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-459-NikTkMo9Ncix8VYrrcJkow-1; Wed, 28 Jun 2023 12:45:37 -0400 X-MC-Unique: NikTkMo9Ncix8VYrrcJkow-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1A20185A7A5; Wed, 28 Jun 2023 16:45:36 +0000 (UTC) Received: from redhat.com (unknown [10.22.8.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 126A4F5CD4; Wed, 28 Jun 2023 16:45:36 +0000 (UTC) Date: Wed, 28 Jun 2023 11:45:34 -0500 From: Bill O'Donnell To: Yangtao Li Cc: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH 1/7] block: add queue_logical_block_mask() and bdev_logical_block_mask() Message-ID: References: <20230628093500.68779-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 05:34:54PM +0800, Yangtao Li wrote: > Introduce queue_logical_block_mask() and bdev_logical_block_mask() > to simplify code, which replace (queue_logical_block_size(q) - 1) > and (bdev_logical_block_size(bdev) - 1). > > Signed-off-by: Yangtao Li Looks fine. Reviewed-by: Bill O'Donnell > --- > include/linux/blkdev.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index ed44a997f629..0cc0d1694ef6 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1150,11 +1150,21 @@ static inline unsigned queue_logical_block_size(const struct request_queue *q) > return retval; > } > > +static inline unsigned int queue_logical_block_mask(const struct request_queue *q) > +{ > + return queue_logical_block_size(q) - 1; > +} > + > static inline unsigned int bdev_logical_block_size(struct block_device *bdev) > { > return queue_logical_block_size(bdev_get_queue(bdev)); > } > > +static inline unsigned int bdev_logical_block_mask(struct block_device *bdev) > +{ > + return bdev_logical_block_size(bdev) - 1; > +} > + > static inline unsigned int queue_physical_block_size(const struct request_queue *q) > { > return q->limits.physical_block_size; > -- > 2.39.0 >