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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39CD1C433F5 for ; Sat, 2 Apr 2022 22:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbiDBW7C (ORCPT ); Sat, 2 Apr 2022 18:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbiDBW67 (ORCPT ); Sat, 2 Apr 2022 18:58:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC0CA46B1E for ; Sat, 2 Apr 2022 15:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648940226; 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=q9g7ZsPBUq2KbhsQ1GnRu1ODv/xqvwL/CkNOSGjLsLA=; b=U3y/EWPKnbjyhwfYlVEDXsPzhTBj5lDUaiEbi90ULxVZXnIPuDrJuM86RS4fWuVi8xiB3t S8Ntbol2/mH/pnksvhcEYcjeGpKzF2xzFViBnwTaK20hjc3tr0fmauE6JD8ENX8/XtYMGU eRl25CNZqkthW9DWxmzuOoZv7LMVxz0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-247-GJrQ-8-4Njycu3A-N4UXdg-1; Sat, 02 Apr 2022 18:57:01 -0400 X-MC-Unique: GJrQ-8-4Njycu3A-N4UXdg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88ECA80005D; Sat, 2 Apr 2022 22:57:00 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64493553373; Sat, 2 Apr 2022 22:56:59 +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 Subject: [PATCH] afs: Enable multipage folio support From: David Howells To: willy@infradead.org Cc: Marc Dionne , linux-afs@lists.infradead.org, dhowells@redhat.com, kent.overstreet@gmail.com, asmadeus@codewreck.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 02 Apr 2022 23:56:58 +0100 Message-ID: <164894021882.451253.10589736224896457507.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 2fe402483ad5..c899977493b4 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -104,12 +104,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 6bcf1475511b..445a79db0192 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;