Skip to content

Commit 60b0dc3

Browse files
fdmananakdave
authored andcommitted
btrfs: rename the functions to get inode and fs_info from an extent io tree
These functions are exported so they should have a 'btrfs_' prefix by convention, to make it clear they are btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So add a 'btrfs_' prefix to their name to make it clear they are from btrfs. Also remove the 'const' suffix from extent_io_tree_to_inode_const() since there's no non-const variant anymore and makes the naming consistent with extent_io_tree_to_fs_info() (no 'const' suffix and returns a const pointer). Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 9d05b11 commit 60b0dc3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

fs/btrfs/extent-io-tree.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static inline void __btrfs_debug_check_extent_io_range(const char *caller,
6565
if (tree->owner != IO_TREE_INODE_IO)
6666
return;
6767

68-
inode = extent_io_tree_to_inode_const(tree);
68+
inode = btrfs_extent_io_tree_to_inode(tree);
6969
isize = i_size_read(&inode->vfs_inode);
7070
if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) {
7171
btrfs_debug_rl(inode->root->fs_info,
@@ -81,15 +81,15 @@ static inline void __btrfs_debug_check_extent_io_range(const char *caller,
8181
#endif
8282

8383
/* Read-only access to the inode. */
84-
const struct btrfs_inode *extent_io_tree_to_inode_const(const struct extent_io_tree *tree)
84+
const struct btrfs_inode *btrfs_extent_io_tree_to_inode(const struct extent_io_tree *tree)
8585
{
8686
if (tree->owner == IO_TREE_INODE_IO)
8787
return tree->inode;
8888
return NULL;
8989
}
9090

9191
/* For read-only access to fs_info. */
92-
const struct btrfs_fs_info *extent_io_tree_to_fs_info(const struct extent_io_tree *tree)
92+
const struct btrfs_fs_info *btrfs_extent_io_tree_to_fs_info(const struct extent_io_tree *tree)
9393
{
9494
if (tree->owner == IO_TREE_INODE_IO)
9595
return tree->inode->root->fs_info;
@@ -334,7 +334,7 @@ static void __cold extent_io_tree_panic(const struct extent_io_tree *tree,
334334
const char *opname,
335335
int err)
336336
{
337-
btrfs_panic(extent_io_tree_to_fs_info(tree), err,
337+
btrfs_panic(btrfs_extent_io_tree_to_fs_info(tree), err,
338338
"extent io tree error on %s state start %llu end %llu",
339339
opname, state->start, state->end);
340340
}
@@ -936,7 +936,7 @@ int btrfs_find_contiguous_extent_bit(struct extent_io_tree *tree, u64 start,
936936
struct extent_state *state;
937937
int ret = 1;
938938

939-
ASSERT(!btrfs_fs_incompat(extent_io_tree_to_fs_info(tree), NO_HOLES));
939+
ASSERT(!btrfs_fs_incompat(btrfs_extent_io_tree_to_fs_info(tree), NO_HOLES));
940940

941941
spin_lock(&tree->lock);
942942
state = find_first_extent_bit_state(tree, start, bits);

fs/btrfs/extent-io-tree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ struct extent_state {
134134
#endif
135135
};
136136

137-
const struct btrfs_inode *extent_io_tree_to_inode_const(const struct extent_io_tree *tree);
138-
const struct btrfs_fs_info *extent_io_tree_to_fs_info(const struct extent_io_tree *tree);
137+
const struct btrfs_inode *btrfs_extent_io_tree_to_inode(const struct extent_io_tree *tree);
138+
const struct btrfs_fs_info *btrfs_extent_io_tree_to_fs_info(const struct extent_io_tree *tree);
139139

140140
void extent_io_tree_init(struct btrfs_fs_info *fs_info,
141141
struct extent_io_tree *tree, unsigned int owner);

include/trace/events/btrfs.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,8 +2069,8 @@ TRACE_EVENT(btrfs_set_extent_bit,
20692069
__field( unsigned, set_bits)
20702070
),
20712071

2072-
TP_fast_assign_btrfs(extent_io_tree_to_fs_info(tree),
2073-
const struct btrfs_inode *inode = extent_io_tree_to_inode_const(tree);
2072+
TP_fast_assign_btrfs(btrfs_extent_io_tree_to_fs_info(tree),
2073+
const struct btrfs_inode *inode = btrfs_extent_io_tree_to_inode(tree);
20742074

20752075
__entry->owner = tree->owner;
20762076
__entry->ino = inode ? btrfs_ino(inode) : 0;
@@ -2102,8 +2102,8 @@ TRACE_EVENT(btrfs_clear_extent_bit,
21022102
__field( unsigned, clear_bits)
21032103
),
21042104

2105-
TP_fast_assign_btrfs(extent_io_tree_to_fs_info(tree),
2106-
const struct btrfs_inode *inode = extent_io_tree_to_inode_const(tree);
2105+
TP_fast_assign_btrfs(btrfs_extent_io_tree_to_fs_info(tree),
2106+
const struct btrfs_inode *inode = btrfs_extent_io_tree_to_inode(tree);
21072107

21082108
__entry->owner = tree->owner;
21092109
__entry->ino = inode ? btrfs_ino(inode) : 0;
@@ -2136,8 +2136,8 @@ TRACE_EVENT(btrfs_convert_extent_bit,
21362136
__field( unsigned, clear_bits)
21372137
),
21382138

2139-
TP_fast_assign_btrfs(extent_io_tree_to_fs_info(tree),
2140-
const struct btrfs_inode *inode = extent_io_tree_to_inode_const(tree);
2139+
TP_fast_assign_btrfs(btrfs_extent_io_tree_to_fs_info(tree),
2140+
const struct btrfs_inode *inode = btrfs_extent_io_tree_to_inode(tree);
21412141

21422142
__entry->owner = tree->owner;
21432143
__entry->ino = inode ? btrfs_ino(inode) : 0;

0 commit comments

Comments
 (0)