Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2830285rwr; Fri, 21 Apr 2023 15:06:25 -0700 (PDT) X-Google-Smtp-Source: AKy350ZOPU4Zpbpmw4d/u21nbIg4xGzNWFnsi4p3HadP5WkWQTfzia0iBFJoQP0HcVVNr2RoCNio X-Received: by 2002:a17:902:f690:b0:1a9:581b:fbaa with SMTP id l16-20020a170902f69000b001a9581bfbaamr1740258plg.2.1682114784827; Fri, 21 Apr 2023 15:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682114784; cv=none; d=google.com; s=arc-20160816; b=spLXfSctkGirg5O8JCWmWVxu0gT8kZWsevSKm9UrTt/+yv6dYAXzQGWKL268dqoMvA FN2r9iMUWibZ9Bolcqx6+To5uGhXcyAARw0Yok++LvlZ8Rza1QR8W1TQzr+XainjLsaY OUPadupCjMd8f4676G2ivutIOOkT9uTsdrLVhtEzDeqkGdQZbApCfH8gWmlPazeW2PxQ audoPQM9VlP1NMRPDqN48jbVPw3HenrLT8FFEtFeQ5CT6oCHj4UoSCU40bS8TITJPuyw oTTySIoQ6lvvb6yS5y5cOJmXaOVEi2PT+fD9OmMdlom9n4j6es2AD/9j13gmRp9DUbOO dV+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zJtElQBBcdjQLKuTgcAUU6SVKeCB/u/2QO+HYPXJ5yM=; b=bj8vk+7cqavwpbpT0faXkwRvC7sG5WSO3i0m34EMpKsOp+IMvmRZ8wN2/TsRf9c7N2 z2HhbCfZ/4ofbY4gx7sVgLbGW1ZXkQ443Fb7RZxjArM41rYuWSY4dGAEk1s9TX3/GPhA ENdFB03S/VFCnk8LHeRNVnt4OsPxfq+X81poF3XUOSF6W0ZYCiMnc7Kjc4soNquzJEFp TfyeYR+FJgAwlO22LXoD3xoIkLiKcqOYCNsprupgWZ+9OE/5mm8ThdwfyInHsszVNWBh K0jPWaNYqgCluzlXOaT4NJigNEBsYvJfaSj3cbxAyujz257RLuj0u4Qefr9licCAp7pI v1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="TZu/Zi5u"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a17090ac68500b00247968ab348si5465208pjt.80.2023.04.21.15.06.08; Fri, 21 Apr 2023 15:06:24 -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=@infradead.org header.s=bombadil.20210309 header.b="TZu/Zi5u"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232732AbjDUWCm (ORCPT + 99 others); Fri, 21 Apr 2023 18:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233734AbjDUWCj (ORCPT ); Fri, 21 Apr 2023 18:02:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E884B10FF; Fri, 21 Apr 2023 15:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zJtElQBBcdjQLKuTgcAUU6SVKeCB/u/2QO+HYPXJ5yM=; b=TZu/Zi5uyNmtM3AYC5F+uKMVsg hHiw+cqzzyEH5I7hS1byjWvZbtD93wTW5QBG4M2KWk+B9WNSSwm8v8mi/Pnh/wNHKblwtRlS/KMzQ Ay3jyrkfXj38Eh37M4Cv7VwmsBNNmqrv9OwKF8lm0f+wSW4Om7abWzDRmsfs9KuyHuU0Imx3Q0AER ZAbNWgHZn5tbTJvEdgqX6vx58Jc1AstSfU9BdUtC5U+O8zrXvOcpy1sMmYqObWFFEt0xJw9Ase7ZL 24pyTndrtdkUUd3SbhFseygDv/Okmg+4zGC/X9a2KfIdvJud/46SLd6TpOspXAPAEoF1aQEjJW7ON WDwf8KDw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1ppypq-00Bv2r-1H; Fri, 21 Apr 2023 22:02:30 +0000 Date: Fri, 21 Apr 2023 15:02:30 -0700 From: Luis Chamberlain To: Matthew Wilcox Cc: axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, hch@infradead.org, djwong@kernel.org, minchan@kernel.org, senozhatsky@chromium.org, patches@lists.linux.dev, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, da.gomez@samsung.com, kbusch@kernel.org Subject: Re: [PATCH 3/5] iomap: simplify iomap_init() with PAGE_SECTORS Message-ID: References: <20230421195807.2804512-1-mcgrof@kernel.org> <20230421195807.2804512-4-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote: > On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote: > > Just use the PAGE_SECTORS generic define. This produces no functional > > changes. While at it use left shift to simplify this even further. > > How is FOO << 2 simpler than FOO * 4? > > > - return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE), > > + return bioset_init(&iomap_ioend_bioset, PAGE_SECTORS << 2, We could just do: - return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE), + return bioset_init(&iomap_ioend_bioset, 4 * PAGE_SECTORS, The shift just seemed optimal if we're just going to change it. Luis