Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3227935pxa; Tue, 25 Aug 2020 15:22:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFw8xH6xbDUma/DOtrFGbVZgfizQpliVF2vfoSYyrFBzGN4IvN9HRI5BFbNqckYRdOWa+f X-Received: by 2002:a17:906:a24f:: with SMTP id bi15mr13232641ejb.379.1598394131513; Tue, 25 Aug 2020 15:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598394131; cv=none; d=google.com; s=arc-20160816; b=vKgdfyRFlY3enfG1V9QgFgc1w6drAbfk+CLNYe7CUlcbhBgll+lMm8Tms17KbHpNIg zNZasYabKpbKmehihXIqNBU0rBwxaiE6wjTnoqOinIZcPeVjQdHXQ1dNcn1gWdFFvbEk uRraSi2fycUsPZEWdIG3GNUQYfNA6+ZzNhEOayIvRl0CrDmNPTIS8MXCnq/MRzqwDwaT dGAr6HLdU4HilKeR9FWnQLG5nVM9jTkkhKgOOx0Nh7NdY9+L3YxliG66YYbQ5jArRZAZ Q9r2Opb3hmgKRuF0cZwrqDadzYQ6luyb5lF6MgFQDWk5A6J6IMml/1qviXECLiIl8APK De8A== 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; bh=WavvcFAkoagnKzDRtV1nN7axf0lPJuZTlIZ7o3K72NQ=; b=0wIxuUrnzoyXnMo9qkYGUH4Uvh6rxrM2A78eiy91OZUOOsdx2Xvd0hdTE6P8WwLj2y u30jS3W8Cm+A6miZ5xiJpnp0OXTT9MSshe+W7i5uGjMCnTxgbuRIu3QKTukY7bPn+fEC jH8HiKGz0GtiDS2qR/LCjFk/Yx4mlufgfh2XzOsgoVFOKXJUtsoysPwU3tmpVIuSLIeI fWBuqp+R9rvlS89W3FZ2G8KhihoDubrBTDHWUiyMrghMTkjwJkxEfcya4yr2rHcMLDuT ujKTSDz68WZNyZsmVxsJGty1Y99wzAcY9B1i/rR7eqX9z/tdZlSUJ/DrO3dMUBf7zHkv jGCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si278114eju.353.2020.08.25.15.21.47; Tue, 25 Aug 2020 15:22:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726697AbgHYWVN (ORCPT + 99 others); Tue, 25 Aug 2020 18:21:13 -0400 Received: from mail104.syd.optusnet.com.au ([211.29.132.246]:45965 "EHLO mail104.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726391AbgHYWVK (ORCPT ); Tue, 25 Aug 2020 18:21:10 -0400 Received: from dread.disaster.area (pa49-181-146-199.pa.nsw.optusnet.com.au [49.181.146.199]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 46746823043; Wed, 26 Aug 2020 08:21:07 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1kAhJS-0000Td-G5; Wed, 26 Aug 2020 08:21:06 +1000 Date: Wed, 26 Aug 2020 08:21:06 +1000 From: Dave Chinner To: "Darrick J. Wong" Cc: "Matthew Wilcox (Oracle)" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH 2/9] fs: Introduce i_blocks_per_page Message-ID: <20200825222106.GP12131@dread.disaster.area> References: <20200824145511.10500-1-willy@infradead.org> <20200824145511.10500-3-willy@infradead.org> <20200825204922.GG6096@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825204922.GG6096@magnolia> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=LPwYv6e9 c=1 sm=1 tr=0 cx=a_idp_d a=GorAHYkI+xOargNMzM6qxQ==:117 a=GorAHYkI+xOargNMzM6qxQ==:17 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=JfrnYn6hAAAA:8 a=7-415B0cAAAA:8 a=Qo8iioWGcHrh27a4tzsA:9 a=CjuIK1q_8ugA:10 a=1CNFftbPRP8L7MoqJWF3:22 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 01:49:22PM -0700, Darrick J. Wong wrote: > On Mon, Aug 24, 2020 at 03:55:03PM +0100, Matthew Wilcox (Oracle) wrote: > > This helper is useful for both THPs and for supporting block size larger > > than page size. Convert all users that I could find (we have a few > > different ways of writing this idiom, and I may have missed some). > > > > Signed-off-by: Matthew Wilcox (Oracle) > > Reviewed-by: Christoph Hellwig > > /me wonders what will happen when someone tries to make blocksz > > pagesize work, I abstract the page/block size stuff into "chunks". i.e. we work on the smallest contiguous chunk of data the current combination of page and inode define. In the context of this patch, it is simply just: s/i_blocks_per_page/iomap_chunks_per_page/g i.e. The helper functions end up looking like this: static inline unsigned iomap_chunk_size(struct inode *inode, struct page *page) { return min_t(unsigned, page_size(page), i_blocksize(inode)); } static inline unsigned iomap_chunk_bits(struct inode *inode, struct page *page) { return min_t(unsigned, page_shift(page), inode->i_blkbits); } static inline unsigned iomap_chunks_per_page(struct inode *inode, struct page *page) { return page_size(page) >> inode->i_blkbits; } and the latter is actually the same as what i_block_per_page() is currently implemented as.... Cheers, Dave. -- Dave Chinner david@fromorbit.com