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=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 B84FFC636C8 for ; Thu, 15 Jul 2021 22:11:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65B8C6117A for ; Thu, 15 Jul 2021 22:11:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65B8C6117A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C78308D00F5; Thu, 15 Jul 2021 18:11:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C27E88D00EC; Thu, 15 Jul 2021 18:11:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC96C8D00F5; Thu, 15 Jul 2021 18:11:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 880D88D00EC for ; Thu, 15 Jul 2021 18:11:27 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6898C1854BA06 for ; Thu, 15 Jul 2021 22:11:26 +0000 (UTC) X-FDA: 78366219372.36.DE0FDAE Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 27820B00009A for ; Thu, 15 Jul 2021 22:11:26 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 49D436117A; Thu, 15 Jul 2021 22:11:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626387085; bh=mU8IxQLXIJVg/zkRJqgrYqRpoPatjq8fJe0GfF1JrvE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IPKe3q105/TOxOYPtJTTOwkQ2S2H8ZphuTtkriYun61+2wdi0Mzgz4vXxxe7Suy2j DpetdcbMIUT/px8vmMx5FzwTD8FNWp8kKVPKQe6jyJ66oDBw/1zyOL0Y1NxV1m3vt0 mNMLwq81F5fFiRYstSfU3z9HxuKIF+tEcYONMMyCl0c3IofjC6DzOkEhkj0kuR3whn jufl3KN1egpswiqxexvZEo53XdGzhrEBNTullMAIokX6cOxaEjuiFqrMEji6Yc0XT2 kux9DD8+4mue5DltD1KKbi2WWp1hdBXnCmL4ufRrJ+xcX4wmOa6uWEO4ttmOcIwv+n GvPpwOyxgZE4Q== Date: Thu, 15 Jul 2021 15:11:25 -0700 From: "Darrick J. Wong" To: "Matthew Wilcox (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v14 129/138] xfs: Support THPs Message-ID: <20210715221125.GU22357@magnolia> References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-130-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-130-willy@infradead.org> Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IPKe3q10; spf=pass (imf24.hostedemail.com: domain of djwong@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: gko9stdn3w4i73kc9b4usgnp3fk6t3oc X-Rspamd-Queue-Id: 27820B00009A X-Rspamd-Server: rspam01 X-HE-Tag: 1626387086-886450 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jul 15, 2021 at 04:36:55AM +0100, Matthew Wilcox (Oracle) wrote: > There is one place which assumes the size of a page; fix it. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/xfs/xfs_aops.c | 11 ++++++----- > fs/xfs/xfs_super.c | 3 ++- > 2 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index cb4e0fcf4c76..9ffbd116592a 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c > @@ -432,10 +432,11 @@ xfs_discard_page( > struct page *page, > loff_t fileoff) /me wonders if this parameter ought to become pos like most other places, but as a straight-up conversion it looks fine to me. Reviewed-by: Darrick J. Wong --D > { > - struct inode *inode = page->mapping->host; > + struct folio *folio = page_folio(page); > + struct inode *inode = folio->mapping->host; > struct xfs_inode *ip = XFS_I(inode); > struct xfs_mount *mp = ip->i_mount; > - unsigned int pageoff = offset_in_page(fileoff); > + size_t pageoff = offset_in_folio(folio, fileoff); > xfs_fileoff_t start_fsb = XFS_B_TO_FSBT(mp, fileoff); > xfs_fileoff_t pageoff_fsb = XFS_B_TO_FSBT(mp, pageoff); > int error; > @@ -445,14 +446,14 @@ xfs_discard_page( > > xfs_alert_ratelimited(mp, > "page discard on page "PTR_FMT", inode 0x%llx, offset %llu.", > - page, ip->i_ino, fileoff); > + folio, ip->i_ino, fileoff); > > error = xfs_bmap_punch_delalloc_range(ip, start_fsb, > - i_blocks_per_page(inode, page) - pageoff_fsb); > + i_blocks_per_folio(inode, folio) - pageoff_fsb); > if (error && !XFS_FORCED_SHUTDOWN(mp)) > xfs_alert(mp, "page discard unable to remove delalloc mapping."); > out_invalidate: > - iomap_invalidatepage(page, pageoff, PAGE_SIZE - pageoff); > + iomap_invalidatepage(&folio->page, pageoff, folio_size(folio) - pageoff); > } > > static const struct iomap_writeback_ops xfs_writeback_ops = { > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index 2c9e26a44546..24adea02b887 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -1891,7 +1891,8 @@ static struct file_system_type xfs_fs_type = { > .init_fs_context = xfs_init_fs_context, > .parameters = xfs_fs_parameters, > .kill_sb = kill_block_super, > - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, > + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | \ > + FS_THP_SUPPORT, > }; > MODULE_ALIAS_FS("xfs"); > > -- > 2.30.2 >