From patchwork Fri Feb 25 23:53:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 12761119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CC35C433EF for ; Fri, 25 Feb 2022 23:55:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 907FF8D0002; Fri, 25 Feb 2022 18:55:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B6938D0001; Fri, 25 Feb 2022 18:55:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CCD88D0002; Fri, 25 Feb 2022 18:55:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 69BFC8D0001 for ; Fri, 25 Feb 2022 18:55:07 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 29B36181CA083 for ; Fri, 25 Feb 2022 23:55:07 +0000 (UTC) X-FDA: 79182960654.30.3EF8FF2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 8F09C1401E8 for ; Fri, 25 Feb 2022 23:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645833235; 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: content-transfer-encoding:content-transfer-encoding; bh=GrI8ebRYRbXaMx78aEKS9TwwZap85Vbp7OV2dX4WbXo=; b=LtmtKArmEBtUhFYM386XOuvf4a3ZwWKF98UsHGMxkN/4EvyWwBJf+x5bzJkQUS/KsW/WGg pFT/4htjTd/8LKmTruOfVNoeWMXCjGI6h3Bzggs68/yqW4tbU/qWPt6bjvpnbXKhcP3g0v IqqZIOR60oaaBPhhxBuvToQ/ogc/vDk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-3-pF4w_JMh6873ybvnYtww-1; Fri, 25 Feb 2022 18:53:52 -0500 X-MC-Unique: 3-pF4w_JMh6873ybvnYtww-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12C3D801AAD; Fri, 25 Feb 2022 23:53:51 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.0]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B44E34B5D; Fri, 25 Feb 2022 23:53:46 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Matthew Wilcox cc: dhowells@redhat.com, jlayton@kernel.org, Marc Dionne , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] afs: Enable multipage folio support MIME-Version: 1.0 Content-ID: <2274527.1645833226.1@warthog.procyon.org.uk> Date: Fri, 25 Feb 2022 23:53:46 +0000 Message-ID: <2274528.1645833226@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8F09C1401E8 X-Stat-Signature: pzd8tzi6zbcju1c8ks6rz4g8frzr7t58 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LtmtKArm; spf=none (imf26.hostedemail.com: domain of dhowells@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1645833236-431569 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: Enable multipage folio support for the afs filesystem. This is on top of Matthew Wilcox's for-next branch. Signed-off-by: David Howells cc: Matthew Wilcox cc: Marc Dionne cc: linux-afs@lists.infradead.org Reported-by: kernel test robot Acked-by: Matthew Wilcox (Oracle) --- fs/afs/inode.c | 2 ++ fs/afs/write.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 5964f8aee090..7dc7eb5f8e63 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -96,12 +96,14 @@ static int afs_inode_init_from_status(struct afs_operation *op, inode->i_op = &afs_file_inode_operations; inode->i_fop = &afs_file_operations; inode->i_mapping->a_ops = &afs_file_aops; + mapping_set_large_folios(inode->i_mapping); break; case AFS_FTYPE_DIR: inode->i_mode = S_IFDIR | (status->mode & S_IALLUGO); inode->i_op = &afs_dir_inode_operations; inode->i_fop = &afs_dir_file_operations; inode->i_mapping->a_ops = &afs_dir_aops; + mapping_set_large_folios(inode->i_mapping); break; case AFS_FTYPE_SYMLINK: /* Symlinks with a mode of 0644 are actually mountpoints. */ diff --git a/fs/afs/write.c b/fs/afs/write.c index 5e9157d0da29..d6cc0fa44316 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping, goto flush_conflicting_write; } - *_page = &folio->page; + *_page = folio_file_page(folio, pos / PAGE_SIZE); _leave(" = 0"); return 0;