From: Boris Burkov <boris@bur.io>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-btrfs@vger.kernel.org, Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: Re: [PATCH 2/4] btrfs: page to folio conversion: prealloc_file_extent_cluster()
Date: Thu, 18 Jan 2024 13:34:40 -0800 [thread overview]
Message-ID: <20240118213440.GB1356080@zen.localdomain> (raw)
In-Reply-To: <55f236028fe97c2119ad8aa51cc6e5fe0cb04d0b.1705605787.git.rgoldwyn@suse.com>
On Thu, Jan 18, 2024 at 01:46:38PM -0600, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@suse.com>
>
> Convert usage of page to folio in prealloc_file_extent_cluster(). This converts
> all page-based function calls to folio-based.
>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
> ---
> fs/btrfs/relocation.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> index abe594f77f99..c365bfc60652 100644
> --- a/fs/btrfs/relocation.c
> +++ b/fs/btrfs/relocation.c
> @@ -2858,7 +2858,7 @@ static noinline_for_stack int prealloc_file_extent_cluster(
> struct address_space *mapping = inode->vfs_inode.i_mapping;
> struct btrfs_fs_info *fs_info = inode->root->fs_info;
> const u32 sectorsize = fs_info->sectorsize;
> - struct page *page;
> + struct folio *folio;
>
> ASSERT(sectorsize < PAGE_SIZE);
> ASSERT(IS_ALIGNED(i_size, sectorsize));
> @@ -2889,16 +2889,16 @@ static noinline_for_stack int prealloc_file_extent_cluster(
> clear_extent_bits(&inode->io_tree, i_size,
> round_up(i_size, PAGE_SIZE) - 1,
> EXTENT_UPTODATE);
> - page = find_lock_page(mapping, i_size >> PAGE_SHIFT);
> + folio = filemap_lock_folio(mapping, i_size >> PAGE_SHIFT);
> /*
> * If page is freed we don't need to do anything then, as we
> * will re-read the whole page anyway.
> */
> - if (page) {
> - btrfs_subpage_clear_uptodate(fs_info, page_folio(page), i_size,
> + if (!IS_ERR(folio)) {
> + btrfs_subpage_clear_uptodate(fs_info, folio, i_size,
> round_up(i_size, PAGE_SIZE) - i_size);
> - unlock_page(page);
> - put_page(page);
> + folio_unlock(folio);
> + folio_put(folio);
> }
> }
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-01-18 21:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1705605787.git.rgoldwyn@suse.com>
2024-01-18 19:46 ` [PATCH 1/4] btrfs: Use IS_ERR() instead of checking folio for NULL Goldwyn Rodrigues
2024-01-18 21:31 ` Boris Burkov
2024-01-19 14:53 ` David Sterba
2024-01-19 14:58 ` Goldwyn Rodrigues
2024-01-18 19:46 ` [PATCH 2/4] btrfs: page to folio conversion: prealloc_file_extent_cluster() Goldwyn Rodrigues
2024-01-18 21:34 ` Boris Burkov [this message]
2024-01-22 20:44 ` David Sterba
2024-01-18 19:46 ` [PATCH 3/4] btrfs: convert relocate_one_page() to relocate_one_folio() Goldwyn Rodrigues
2024-01-18 21:43 ` Boris Burkov
2024-01-22 20:53 ` David Sterba
2024-01-22 20:52 ` David Sterba
2024-01-23 16:36 ` Goldwyn Rodrigues
2024-01-18 19:46 ` [PATCH 4/4] btrfs: page to folio conversion in put_file_data() Goldwyn Rodrigues
2024-01-18 21:48 ` Boris Burkov
2024-01-22 20:55 ` David Sterba
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=20240118213440.GB1356080@zen.localdomain \
--to=boris@bur.io \
--cc=linux-btrfs@vger.kernel.org \
--cc=rgoldwyn@suse.com \
--cc=rgoldwyn@suse.de \
/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