Skip to content

Commit 7968120

Browse files
fdmananakdave
authored andcommitted
btrfs: rename __lock_extent() and __try_lock_extent()
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. Their double underscore prefix is also discouraged. So remove their double underscore prefix, add a 'btrfs_' prefix to their name to make it clear they are from btrfs and a '_bits' suffix to avoid collision with btrfs_lock_extent() and btrfs_try_lock_extent(). Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 36da450 commit 7968120

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

fs/btrfs/extent-io-tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,8 +1831,8 @@ int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
18311831
return __clear_extent_bit(tree, start, end, bits, NULL, changeset);
18321832
}
18331833

1834-
bool __try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end, u32 bits,
1835-
struct extent_state **cached)
1834+
bool btrfs_try_lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
1835+
u32 bits, struct extent_state **cached)
18361836
{
18371837
int err;
18381838
u64 failed_start;
@@ -1851,8 +1851,8 @@ bool __try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end, u32 bits
18511851
* Either insert or lock state struct between start and end use mask to tell
18521852
* us if waiting is desired.
18531853
*/
1854-
int __lock_extent(struct extent_io_tree *tree, u64 start, u64 end, u32 bits,
1855-
struct extent_state **cached_state)
1854+
int btrfs_lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, u32 bits,
1855+
struct extent_state **cached_state)
18561856
{
18571857
struct extent_state *failed_state = NULL;
18581858
int err;

fs/btrfs/extent-io-tree.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,21 @@ const struct btrfs_fs_info *extent_io_tree_to_fs_info(const struct extent_io_tre
140140
void extent_io_tree_init(struct btrfs_fs_info *fs_info,
141141
struct extent_io_tree *tree, unsigned int owner);
142142
void extent_io_tree_release(struct extent_io_tree *tree);
143-
int __lock_extent(struct extent_io_tree *tree, u64 start, u64 end, u32 bits,
144-
struct extent_state **cached);
145-
bool __try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end, u32 bits,
146-
struct extent_state **cached);
143+
int btrfs_lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, u32 bits,
144+
struct extent_state **cached);
145+
bool btrfs_try_lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
146+
u32 bits, struct extent_state **cached);
147147

148148
static inline int btrfs_lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
149149
struct extent_state **cached)
150150
{
151-
return __lock_extent(tree, start, end, EXTENT_LOCKED, cached);
151+
return btrfs_lock_extent_bits(tree, start, end, EXTENT_LOCKED, cached);
152152
}
153153

154154
static inline bool btrfs_try_lock_extent(struct extent_io_tree *tree, u64 start,
155155
u64 end, struct extent_state **cached)
156156
{
157-
return __try_lock_extent(tree, start, end, EXTENT_LOCKED, cached);
157+
return btrfs_try_lock_extent_bits(tree, start, end, EXTENT_LOCKED, cached);
158158
}
159159

160160
int __init extent_state_init_cachep(void);
@@ -226,13 +226,13 @@ bool btrfs_find_delalloc_range(struct extent_io_tree *tree, u64 *start,
226226
static inline int btrfs_lock_dio_extent(struct extent_io_tree *tree, u64 start,
227227
u64 end, struct extent_state **cached)
228228
{
229-
return __lock_extent(tree, start, end, EXTENT_DIO_LOCKED, cached);
229+
return btrfs_lock_extent_bits(tree, start, end, EXTENT_DIO_LOCKED, cached);
230230
}
231231

232232
static inline bool btrfs_try_lock_dio_extent(struct extent_io_tree *tree, u64 start,
233233
u64 end, struct extent_state **cached)
234234
{
235-
return __try_lock_extent(tree, start, end, EXTENT_DIO_LOCKED, cached);
235+
return btrfs_try_lock_extent_bits(tree, start, end, EXTENT_DIO_LOCKED, cached);
236236
}
237237

238238
static inline int btrfs_unlock_dio_extent(struct extent_io_tree *tree, u64 start,

fs/btrfs/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,9 +3119,9 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent)
31193119
*/
31203120
if (!test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags)) {
31213121
clear_bits |= EXTENT_LOCKED | EXTENT_FINISHING_ORDERED;
3122-
__lock_extent(io_tree, start, end,
3123-
EXTENT_LOCKED | EXTENT_FINISHING_ORDERED,
3124-
&cached_state);
3122+
btrfs_lock_extent_bits(io_tree, start, end,
3123+
EXTENT_LOCKED | EXTENT_FINISHING_ORDERED,
3124+
&cached_state);
31253125
}
31263126

31273127
if (freespace_inode)

0 commit comments

Comments
 (0)