diff options
Diffstat (limited to 'fs/btrfs/defrag.c')
| -rw-r--r-- | fs/btrfs/defrag.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/defrag.c b/fs/btrfs/defrag.c index faa563ee3000..701b6b51ea85 100644 --- a/fs/btrfs/defrag.c +++ b/fs/btrfs/defrag.c @@ -886,7 +886,7 @@ again: } lock_start = folio_pos(folio); - lock_end = folio_pos(folio) + folio_size(folio) - 1; + lock_end = folio_end(folio) - 1; /* Wait for any existing ordered extent in the range */ while (1) { struct btrfs_ordered_extent *ordered; @@ -1178,8 +1178,7 @@ static int defrag_one_locked_target(struct btrfs_inode *inode, if (!folio) break; - if (start >= folio_pos(folio) + folio_size(folio) || - start + len <= folio_pos(folio)) + if (start >= folio_end(folio) || start + len <= folio_pos(folio)) continue; btrfs_folio_clamp_clear_checked(fs_info, folio, start, len); btrfs_folio_clamp_set_dirty(fs_info, folio, start, len); @@ -1220,7 +1219,7 @@ static int defrag_one_range(struct btrfs_inode *inode, u64 start, u32 len, folios[i] = NULL; goto free_folios; } - cur = folio_pos(folios[i]) + folio_size(folios[i]); + cur = folio_end(folios[i]); } for (int i = 0; i < nr_pages; i++) { if (!folios[i]) |
