diff options
| author | Yushan Zhou <[email protected]> | 2023-01-03 05:11:37 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2023-02-13 16:50:34 +0000 |
| commit | ce394a7f39032bc2a85b070af608e3ae8b2cefda (patch) | |
| tree | 9aad92997d8fb89919c8febb8cb482312648b207 /fs/btrfs/inode.c | |
| parent | btrfs: go to matching label when cleaning em in btrfs_submit_direct (diff) | |
| download | kernel-ce394a7f39032bc2a85b070af608e3ae8b2cefda.tar.gz kernel-ce394a7f39032bc2a85b070af608e3ae8b2cefda.zip | |
btrfs: use PAGE_{ALIGN, ALIGNED, ALIGN_DOWN} macro
The header file linux/mm.h provides PAGE_ALIGN, PAGE_ALIGNED,
PAGE_ALIGN_DOWN macros. Use these macros to make code more
concise.
Signed-off-by: Yushan Zhou <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/inode.c')
| -rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7fa1db6a474a..49a2e118f561 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -10995,9 +10995,8 @@ static int btrfs_add_swap_extent(struct swap_info_struct *sis, return 0; max_pages = sis->max - bsi->nr_pages; - first_ppage = ALIGN(bsi->block_start, PAGE_SIZE) >> PAGE_SHIFT; - next_ppage = ALIGN_DOWN(bsi->block_start + bsi->block_len, - PAGE_SIZE) >> PAGE_SHIFT; + first_ppage = PAGE_ALIGN(bsi->block_start) >> PAGE_SHIFT; + next_ppage = PAGE_ALIGN_DOWN(bsi->block_start + bsi->block_len) >> PAGE_SHIFT; if (first_ppage >= next_ppage) return 0; |
