linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anna Schumaker <schumaker.anna@gmail.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-block@vger.kernel.org, linux-aio@kvack.org,
	linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-mm@kvack.org, linux-xfs <linux-xfs@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	linux-ntfs-dev@lists.sourceforge.net, ocfs2-devel@oss.oracle.com,
	linux-mtd@lists.infradead.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 07/20] nfs: Convert to migrate_folio
Date: Tue, 7 Jun 2022 15:02:59 -0400	[thread overview]
Message-ID: <CAFX2Jf=ugChaWF0Je=ew_-shhdSJYXy5dkjqsoL=9B37QWv3bA@mail.gmail.com> (raw)
In-Reply-To: <20220606204050.2625949-8-willy@infradead.org>

On Mon, Jun 6, 2022 at 7:37 PM Matthew Wilcox (Oracle)
<willy@infradead.org> wrote:
>
> Use a folio throughout this function.  migrate_page() will be converted
> later.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Looks fairly straightforward.

Acked-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

> ---
>  fs/nfs/file.c     |  4 +---
>  fs/nfs/internal.h |  6 ++++--
>  fs/nfs/write.c    | 16 ++++++++--------
>  3 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> index 2d72b1b7ed74..549baed76351 100644
> --- a/fs/nfs/file.c
> +++ b/fs/nfs/file.c
> @@ -533,9 +533,7 @@ const struct address_space_operations nfs_file_aops = {
>         .write_end = nfs_write_end,
>         .invalidate_folio = nfs_invalidate_folio,
>         .release_folio = nfs_release_folio,
> -#ifdef CONFIG_MIGRATION
> -       .migratepage = nfs_migrate_page,
> -#endif
> +       .migrate_folio = nfs_migrate_folio,
>         .launder_folio = nfs_launder_folio,
>         .is_dirty_writeback = nfs_check_dirty_writeback,
>         .error_remove_page = generic_error_remove_page,
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index 8f8cd6e2d4db..437ebe544aaf 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -578,8 +578,10 @@ void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo)
>  #endif
>
>  #ifdef CONFIG_MIGRATION
> -extern int nfs_migrate_page(struct address_space *,
> -               struct page *, struct page *, enum migrate_mode);
> +int nfs_migrate_folio(struct address_space *, struct folio *dst,
> +               struct folio *src, enum migrate_mode);
> +#else
> +#define nfs_migrate_folio NULL
>  #endif
>
>  static inline int
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 1c706465d090..649b9e633459 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -2119,27 +2119,27 @@ int nfs_wb_page(struct inode *inode, struct page *page)
>  }
>
>  #ifdef CONFIG_MIGRATION
> -int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
> -               struct page *page, enum migrate_mode mode)
> +int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
> +               struct folio *src, enum migrate_mode mode)
>  {
>         /*
> -        * If PagePrivate is set, then the page is currently associated with
> +        * If the private flag is set, the folio is currently associated with
>          * an in-progress read or write request. Don't try to migrate it.
>          *
>          * FIXME: we could do this in principle, but we'll need a way to ensure
>          *        that we can safely release the inode reference while holding
> -        *        the page lock.
> +        *        the folio lock.
>          */
> -       if (PagePrivate(page))
> +       if (folio_test_private(src))
>                 return -EBUSY;
>
> -       if (PageFsCache(page)) {
> +       if (folio_test_fscache(src)) {
>                 if (mode == MIGRATE_ASYNC)
>                         return -EBUSY;
> -               wait_on_page_fscache(page);
> +               folio_wait_fscache(src);
>         }
>
> -       return migrate_page(mapping, newpage, page, mode);
> +       return migrate_page(mapping, &dst->page, &src->page, mode);
>  }
>  #endif
>
> --
> 2.35.1
>

  reply	other threads:[~2022-06-07 21:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 20:40 [PATCH 00/20] Convert aops->migratepage to aops->migrate_folio Matthew Wilcox (Oracle)
2022-06-06 20:40 ` [PATCH 01/20] fs: Add aops->migrate_folio Matthew Wilcox (Oracle)
2022-06-08  8:09   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 02/20] mm/migrate: Convert fallback_migrate_page() to fallback_migrate_folio() Matthew Wilcox (Oracle)
2022-06-08  8:11   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 03/20] mm/migrate: Convert writeout() to take a folio Matthew Wilcox (Oracle)
2022-06-08  8:11   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 04/20] mm/migrate: Convert buffer_migrate_page() to buffer_migrate_folio() Matthew Wilcox (Oracle)
2022-06-07  3:37   ` kernel test robot
2022-06-07 14:57     ` Matthew Wilcox
2022-06-07  8:01   ` kernel test robot
2022-06-08  8:12   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 05/20] mm/migrate: Convert expected_page_refs() to folio_expected_refs() Matthew Wilcox (Oracle)
2022-06-07 13:41   ` Brian Foster
2022-06-07 14:11     ` Matthew Wilcox
2022-06-08  8:14   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 06/20] btrfs: Convert btree_migratepage to migrate_folio Matthew Wilcox (Oracle)
2022-06-08  8:16   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 07/20] nfs: Convert " Matthew Wilcox (Oracle)
2022-06-07 19:02   ` Anna Schumaker [this message]
2022-06-08  8:17   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 08/20] mm/migrate: Convert migrate_page() to migrate_folio() Matthew Wilcox (Oracle)
2022-06-08  8:18   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 09/20] mm/migrate: Add filemap_migrate_folio() Matthew Wilcox (Oracle)
2022-06-08  8:19   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 10/20] btrfs: Convert btrfs_migratepage to migrate_folio Matthew Wilcox (Oracle)
2022-06-08  8:19   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 11/20] ubifs: Convert to filemap_migrate_folio() Matthew Wilcox (Oracle)
2022-06-06 20:40 ` [PATCH 12/20] f2fs: " Matthew Wilcox (Oracle)
2022-06-06 20:40 ` [PATCH 13/20] aio: Convert to migrate_folio Matthew Wilcox (Oracle)
2022-06-08  8:20   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 14/20] hugetlb: " Matthew Wilcox (Oracle)
2022-06-07  6:13   ` kernel test robot
2022-06-07 15:02     ` Matthew Wilcox
2022-06-06 20:40 ` [PATCH 15/20] balloon: " Matthew Wilcox (Oracle)
2022-06-07  7:36   ` David Hildenbrand
2022-06-07 14:24     ` Matthew Wilcox
2022-06-07 19:21       ` Matthew Wilcox
2022-06-08  9:59         ` David Hildenbrand
2022-06-08 13:06           ` Rafael Aquini
2022-06-06 20:40 ` [PATCH 16/20] secretmem: " Matthew Wilcox (Oracle)
2022-06-06 20:40 ` [PATCH 17/20] z3fold: " Matthew Wilcox (Oracle)
2022-06-06 20:40 ` [PATCH 18/20] zsmalloc: " Matthew Wilcox (Oracle)
2022-06-06 20:40 ` [PATCH 19/20] fs: Remove aops->migratepage() Matthew Wilcox (Oracle)
2022-06-08  8:21   ` Christoph Hellwig
2022-06-06 20:40 ` [PATCH 20/20] mm/folio-compat: Remove migration compatibility functions Matthew Wilcox (Oracle)
2022-06-08  8:22   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFX2Jf=ugChaWF0Je=ew_-shhdSJYXy5dkjqsoL=9B37QWv3bA@mail.gmail.com' \
    --to=schumaker.anna@gmail.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).