All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: use IS_ALIGNED() for assertion in btrfs_lookup_csums_range() for simplicity
@ 2014-07-25  8:07 Satoru Takeuchi
  0 siblings, 0 replies; only message in thread
From: Satoru Takeuchi @ 2014-07-25  8:07 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

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>

---
 fs/btrfs/file-item.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index f46cfe4..4b9e40f 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -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)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-25  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25  8:07 [PATCH] btrfs: use IS_ALIGNED() for assertion in btrfs_lookup_csums_range() for simplicity Satoru Takeuchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.