mirror of https://gitee.com/openkylin/linux.git
btrfs: Use IS_ALIGNED in btrfs_truncate_block instead of opencoding it
No functional changes, just makes the code more readable Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
5f4791f4a6
commit
b03ebd992f
|
@ -4769,8 +4769,8 @@ int btrfs_truncate_block(struct inode *inode, loff_t from, loff_t len,
|
|||
u64 block_start;
|
||||
u64 block_end;
|
||||
|
||||
if ((offset & (blocksize - 1)) == 0 &&
|
||||
(!len || ((len & (blocksize - 1)) == 0)))
|
||||
if (IS_ALIGNED(offset, blocksize) &&
|
||||
(!len || IS_ALIGNED(len, blocksize)))
|
||||
goto out;
|
||||
|
||||
block_start = round_down(from, blocksize);
|
||||
|
|
Loading…
Reference in New Issue