From: Nikolay Borisov Date: Wed, 27 Mar 2019 12:24:15 +0000 (+0200) Subject: btrfs: Factor out in_range macro X-Git-Tag: v5.4-rc1~779^2~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e74e3993bcf6a1d119a2bbe7af2cc278a147f930;p=platform%2Fkernel%2Flinux-rpi.git btrfs: Factor out in_range macro This is used in more than one places so let's factor it out in ctree.h. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 93270e2..1a6c5ce 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3806,6 +3806,8 @@ static inline int btrfs_defrag_cancelled(struct btrfs_fs_info *fs_info) return signal_pending(current); } +#define in_range(b, first, len) ((b) >= (first) && (b) < (first) + (len)) + /* Sanity test specific functions */ #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS void btrfs_test_inode_set_ops(struct inode *inode); diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 8de4dde..7500728 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1905,7 +1905,6 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans, return ret; } -#define in_range(b, first, len) ((b) >= (first) && (b) < (first) + (len)) static int btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len, u64 *discarded_bytes) { diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d5e8ac6..7fabbba 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1505,7 +1505,6 @@ error_bdev_put: * Try to find a chunk that intersects [start, start + len] range and when one * such is found, record the end of it in *start */ -#define in_range(b, first, len) ((b) >= (first) && (b) < (first) + (len)) static bool contains_pending_extent(struct btrfs_device *device, u64 *start, u64 len) {