Skip to content

Commit

Permalink
btrfs: Factor out in_range macro
Browse files Browse the repository at this point in the history
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 <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Nikolay Borisov authored and David Sterba committed Apr 29, 2019
1 parent 60dfdf2 commit e74e399
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,6 @@ struct btrfs_device *btrfs_scan_one_device(const char *path, fmode_t flags,
* 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)
{
Expand Down

0 comments on commit e74e399

Please sign in to comment.