Skip to content

Commit 36da450

Browse files
fdmananakdave
authored andcommitted
btrfs: add btrfs prefix to dio lock and unlock extent functions
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 prefix to their name. 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 5c5948a commit 36da450

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

fs/btrfs/direct-io.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
4242

4343
/* Direct lock must be taken before the extent lock. */
4444
if (nowait) {
45-
if (!try_lock_dio_extent(io_tree, lockstart, lockend, cached_state))
45+
if (!btrfs_try_lock_dio_extent(io_tree, lockstart, lockend, cached_state))
4646
return -EAGAIN;
4747
} else {
48-
lock_dio_extent(io_tree, lockstart, lockend, cached_state);
48+
btrfs_lock_dio_extent(io_tree, lockstart, lockend, cached_state);
4949
}
5050

5151
while (1) {
@@ -131,7 +131,7 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
131131
}
132132

133133
if (ret)
134-
unlock_dio_extent(io_tree, lockstart, lockend, cached_state);
134+
btrfs_unlock_dio_extent(io_tree, lockstart, lockend, cached_state);
135135
return ret;
136136
}
137137

@@ -580,8 +580,8 @@ static int btrfs_dio_iomap_begin(struct inode *inode, loff_t start,
580580

581581
/* We didn't use everything, unlock the dio extent for the remainder. */
582582
if (!write && (start + len) < lockend)
583-
unlock_dio_extent(&BTRFS_I(inode)->io_tree, start + len,
584-
lockend, NULL);
583+
btrfs_unlock_dio_extent(&BTRFS_I(inode)->io_tree, start + len,
584+
lockend, NULL);
585585

586586
return 0;
587587

@@ -615,8 +615,8 @@ static int btrfs_dio_iomap_end(struct inode *inode, loff_t pos, loff_t length,
615615

616616
if (!write && (iomap->type == IOMAP_HOLE)) {
617617
/* If reading from a hole, unlock and return */
618-
unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
619-
pos + length - 1, NULL);
618+
btrfs_unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
619+
pos + length - 1, NULL);
620620
return 0;
621621
}
622622

@@ -627,8 +627,8 @@ static int btrfs_dio_iomap_end(struct inode *inode, loff_t pos, loff_t length,
627627
btrfs_finish_ordered_extent(dio_data->ordered, NULL,
628628
pos, length, false);
629629
else
630-
unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
631-
pos + length - 1, NULL);
630+
btrfs_unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
631+
pos + length - 1, NULL);
632632
ret = -ENOTBLK;
633633
}
634634
if (write) {
@@ -660,8 +660,8 @@ static void btrfs_dio_end_io(struct btrfs_bio *bbio)
660660
dip->file_offset, dip->bytes,
661661
!bio->bi_status);
662662
} else {
663-
unlock_dio_extent(&inode->io_tree, dip->file_offset,
664-
dip->file_offset + dip->bytes - 1, NULL);
663+
btrfs_unlock_dio_extent(&inode->io_tree, dip->file_offset,
664+
dip->file_offset + dip->bytes - 1, NULL);
665665
}
666666

667667
bbio->bio.bi_private = bbio->private;

fs/btrfs/extent-io-tree.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,20 +223,20 @@ int find_contiguous_extent_bit(struct extent_io_tree *tree, u64 start,
223223
bool btrfs_find_delalloc_range(struct extent_io_tree *tree, u64 *start,
224224
u64 *end, u64 max_bytes,
225225
struct extent_state **cached_state);
226-
static inline int lock_dio_extent(struct extent_io_tree *tree, u64 start,
227-
u64 end, struct extent_state **cached)
226+
static inline int btrfs_lock_dio_extent(struct extent_io_tree *tree, u64 start,
227+
u64 end, struct extent_state **cached)
228228
{
229229
return __lock_extent(tree, start, end, EXTENT_DIO_LOCKED, cached);
230230
}
231231

232-
static inline bool try_lock_dio_extent(struct extent_io_tree *tree, u64 start,
233-
u64 end, struct extent_state **cached)
232+
static inline bool btrfs_try_lock_dio_extent(struct extent_io_tree *tree, u64 start,
233+
u64 end, struct extent_state **cached)
234234
{
235235
return __try_lock_extent(tree, start, end, EXTENT_DIO_LOCKED, cached);
236236
}
237237

238-
static inline int unlock_dio_extent(struct extent_io_tree *tree, u64 start,
239-
u64 end, struct extent_state **cached)
238+
static inline int btrfs_unlock_dio_extent(struct extent_io_tree *tree, u64 start,
239+
u64 end, struct extent_state **cached)
240240
{
241241
return __clear_extent_bit(tree, start, end, EXTENT_DIO_LOCKED, cached, NULL);
242242
}

0 commit comments

Comments
 (0)