Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2864963rwr; Fri, 21 Apr 2023 15:53:05 -0700 (PDT) X-Google-Smtp-Source: AKy350YKIdedR+TvUoGglA8ptH/brXpGMbn+1wZU5Gc3ns8K69u4aE/XjGjC0szCo7hGcGCquTPb X-Received: by 2002:a17:902:f690:b0:1a6:e00b:c3e5 with SMTP id l16-20020a170902f69000b001a6e00bc3e5mr7727331plg.4.1682117585347; Fri, 21 Apr 2023 15:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682117585; cv=none; d=google.com; s=arc-20160816; b=z1gky4h7IYGZs7stFEBk+LNVKamGwQzL3Idr/QQo6afZlHKFGn2CVLKP9UgIx3GYN4 8Wbc44xo9hS8TZCOiBOA7TzENWBMO+ZSk8hspZXmgldGrYC9nffdIhfdwLiOyvNzPJWj F1fxNetXCqcK2Q1f271pEfpEWpY/Oi6BENOqzPBaEUkFObJiejpYnaZfdcwWfdHoj/jn ieaU2EZJT+m60U5wbY3Ctk+pLnCcawuqoUluySm9sOoAaPgR4QqnMB1I+wkyZKZeF31L +mmgrAK2xP3+P7x+HC1UIZAx+4iztjStX5Qj6ksJXu+Iu2e8mI5z69kepwIconbpCvA9 IgLA== 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=Rk/OYWhW/XAI/I4YNvgkI3t2ZA+2S6o9dTT4l5mLGUU=; b=csYhGZBNzedYlQty+fAZ74eRy4eaQvVdDVq1oKbfklzE/rq8EURbSKA+e1EB0Lr+Q6 5efdAJgHdh8pt1T79eNRiEK+hDol3MRiwSSo405loV6xZujj9JK9fWDUYHSX3A6PRHTz UBHQIBHXa+5f29XfJujOFP9z9kwcDmTI2EMscHJA/CjJLAnHXWnd3gN9eYIXdnLn3gt0 Eq8L/FZF+SiztQGAlRL7voODEkU7tEEmWmUZca8Q9VEc5b5khFK/a1H1+PBDp6KifmCd O4sMMMqsEkC6EK5YnEhj2mvERvlpnmhHs17luuwOTIWryPEqR7iZSaqhx0Eqe4ySUvgt APfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EDk6d+sA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170903244600b0019a95ab6b4esi6150288pls.407.2023.04.21.15.52.52; Fri, 21 Apr 2023 15:53:05 -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=casper.20170209 header.b=EDk6d+sA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233766AbjDUWt7 (ORCPT + 99 others); Fri, 21 Apr 2023 18:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233754AbjDUWt6 (ORCPT ); Fri, 21 Apr 2023 18:49:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F42E60; Fri, 21 Apr 2023 15:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Rk/OYWhW/XAI/I4YNvgkI3t2ZA+2S6o9dTT4l5mLGUU=; b=EDk6d+sAzT9ozbYKqvEeLRubE3 G/qot7oj55X3AiaR2lLLm8yBh8BW3+E56dNXdljzVphWA+lV6sKfQ/0It6JkKoIFogYP5TAtrtu6q i/jd4HkFuKTz2kKi+bKR2g2GByNuISpDskvAbg4Wu/XE4Xgah+lEdR6pdxWq/7QHS0S2peABzdybd qBl9BTxmUjHUI81U7fNU2PXG7Lx4Ef2yGHI7lJZuKxQ/uAYWGjxRoBo/GVDRjTt5mwSwWov9aQBKO RBhTRZHrRSxSccSeyYa41TlJt/1dnR9ZVebBspme9XrLyJMAmQxfE5qxmCe2/UjkutydDYtGSOzYH WS6elVnQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ppzZX-00FiQg-N7; Fri, 21 Apr 2023 22:49:43 +0000 Date: Fri, 21 Apr 2023 23:49:43 +0100 From: Matthew Wilcox To: Luis Chamberlain Cc: hughd@google.com, akpm@linux-foundation.org, brauner@kernel.org, djwong@kernel.org, p.raghav@samsung.com, da.gomez@samsung.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, hare@suse.de, kbusch@kernel.org, patches@lists.linux.dev, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 4/8] shmem: add helpers to get block size Message-ID: References: <20230421214400.2836131-1-mcgrof@kernel.org> <20230421214400.2836131-5-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421214400.2836131-5-mcgrof@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 02:43:56PM -0700, Luis Chamberlain wrote: > struct shmem_sb_info { > +#ifdef CONFIG_TMPFS > + u64 blocksize; > +#endif u64? You're planning on supporting a blocksize larger than 2GB? I would store block_order (in an unsigned char) and then you can avoid the call to ffs(), at the expense of doing 1UL << sbi->block_order;