Commit 79be4a28 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: convert __unlock_for_delalloc() to take a folio

All of the callers have a folio at this point, update
__unlock_for_delalloc to take a folio so that it's consistent with its
callers.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e4d80ebe
...@@ -216,18 +216,18 @@ static void __process_pages_contig(struct address_space *mapping, ...@@ -216,18 +216,18 @@ static void __process_pages_contig(struct address_space *mapping,
} }
static noinline void __unlock_for_delalloc(const struct inode *inode, static noinline void __unlock_for_delalloc(const struct inode *inode,
const struct page *locked_page, const struct folio *locked_folio,
u64 start, u64 end) u64 start, u64 end)
{ {
unsigned long index = start >> PAGE_SHIFT; unsigned long index = start >> PAGE_SHIFT;
unsigned long end_index = end >> PAGE_SHIFT; unsigned long end_index = end >> PAGE_SHIFT;
ASSERT(locked_page); ASSERT(locked_folio);
if (index == locked_page->index && end_index == index) if (index == locked_folio->index && end_index == index)
return; return;
__process_pages_contig(inode->i_mapping, locked_page, start, end, __process_pages_contig(inode->i_mapping, &locked_folio->page, start,
PAGE_UNLOCK); end, PAGE_UNLOCK);
} }
static noinline int lock_delalloc_folios(struct inode *inode, static noinline int lock_delalloc_folios(struct inode *inode,
...@@ -281,7 +281,7 @@ static noinline int lock_delalloc_folios(struct inode *inode, ...@@ -281,7 +281,7 @@ static noinline int lock_delalloc_folios(struct inode *inode,
out: out:
folio_batch_release(&fbatch); folio_batch_release(&fbatch);
if (processed_end > start) if (processed_end > start)
__unlock_for_delalloc(inode, &locked_folio->page, start, __unlock_for_delalloc(inode, locked_folio, start,
processed_end); processed_end);
return -EAGAIN; return -EAGAIN;
} }
...@@ -383,8 +383,8 @@ noinline_for_stack bool find_lock_delalloc_range(struct inode *inode, ...@@ -383,8 +383,8 @@ noinline_for_stack bool find_lock_delalloc_range(struct inode *inode,
unlock_extent(tree, delalloc_start, delalloc_end, &cached_state); unlock_extent(tree, delalloc_start, delalloc_end, &cached_state);
if (!ret) { if (!ret) {
__unlock_for_delalloc(inode, &locked_folio->page, __unlock_for_delalloc(inode, locked_folio, delalloc_start,
delalloc_start, delalloc_end); delalloc_end);
cond_resched(); cond_resched();
goto again; goto again;
} }
...@@ -1266,7 +1266,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode, ...@@ -1266,7 +1266,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,
*/ */
unlock_extent(&inode->io_tree, found_start, unlock_extent(&inode->io_tree, found_start,
found_start + found_len - 1, NULL); found_start + found_len - 1, NULL);
__unlock_for_delalloc(&inode->vfs_inode, &folio->page, __unlock_for_delalloc(&inode->vfs_inode, folio,
found_start, found_start,
found_start + found_len - 1); found_start + found_len - 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment