Skip to content

Commit f8e0b8f

Browse files
committed
btrfs: unwrap folio locking helpers
Another conversion to folio API, use the folio locking directly instead of back and forth page <-> folio conversions. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 549a88a commit f8e0b8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/btrfs/extent_io.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3131,7 +3131,7 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
31313131
* live buffer and won't free them prematurely.
31323132
*/
31333133
for (int i = 0; i < num_folios; i++)
3134-
unlock_page(folio_page(eb->folios[i], 0));
3134+
folio_unlock(eb->folios[i]);
31353135
return eb;
31363136

31373137
out:
@@ -3155,7 +3155,7 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
31553155
for (int i = 0; i < attached; i++) {
31563156
ASSERT(eb->folios[i]);
31573157
detach_extent_buffer_folio(eb, eb->folios[i]);
3158-
unlock_page(folio_page(eb->folios[i], 0));
3158+
folio_unlock(eb->folios[i]);
31593159
folio_put(eb->folios[i]);
31603160
eb->folios[i] = NULL;
31613161
}
@@ -3364,12 +3364,12 @@ void set_extent_buffer_dirty(struct extent_buffer *eb)
33643364
* the above race.
33653365
*/
33663366
if (subpage)
3367-
lock_page(folio_page(eb->folios[0], 0));
3367+
folio_lock(eb->folios[0]);
33683368
for (int i = 0; i < num_folios; i++)
33693369
btrfs_folio_set_dirty(eb->fs_info, eb->folios[i],
33703370
eb->start, eb->len);
33713371
if (subpage)
3372-
unlock_page(folio_page(eb->folios[0], 0));
3372+
folio_unlock(eb->folios[0]);
33733373
percpu_counter_add_batch(&eb->fs_info->dirty_metadata_bytes,
33743374
eb->len,
33753375
eb->fs_info->dirty_metadata_batch);

0 commit comments

Comments
 (0)