summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-01-18 14:47:06 +0200
committerDavid Sterba <dsterba@suse.com>2018-01-22 16:08:22 +0100
commitb03ebd992ff329889d2e1f342cb75ee3ebc21adc (patch)
treee2daf1f5a598820b95b7831166b3c8304fc0b757 /fs
parent5f4791f4a6479cdeb8caae1a3e5895c8a6e99c09 (diff)
downloadlinux-stable-b03ebd992ff329889d2e1f342cb75ee3ebc21adc.tar.gz
linux-stable-b03ebd992ff329889d2e1f342cb75ee3ebc21adc.tar.bz2
linux-stable-b03ebd992ff329889d2e1f342cb75ee3ebc21adc.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d55aef46e8ae..c5f31817778b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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);