btrfs: use IS_ALIGNED() for assertion in btrfs_lookup_csums_range() for simplicity
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Fri, 25 Jul 2014 08:07:48 +0000 (17:07 +0900)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:37:54 +0000 (13:37 -0700)
btrfs_lookup_csums_range() uses ALIGN() to check if "start"
and "end + 1" are aligned to "root->sectorsize". It's better to
replace these with IS_ALIGNED() for simplicity.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file-item.c

index 991f056acab262391a8d0c9ca7ce12f527b40e3d..6e6262eca8b73505baf3071e445a7cfcecb8a6a3 100644 (file)
@@ -329,8 +329,8 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
        u64 csum_end;
        u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy);
 
-       ASSERT(start == ALIGN(start, root->sectorsize) &&
-              (end + 1) == ALIGN(end + 1, root->sectorsize));
+       ASSERT(IS_ALIGNED(start, root->sectorsize) &&
+              IS_ALIGNED(end + 1, root->sectorsize));
 
        path = btrfs_alloc_path();
        if (!path)