btrfs: add btrfs prefix to dio lock and unlock extent functions
authorFilipe Manana <fdmanana@suse.com>
Mon, 31 Mar 2025 13:38:24 +0000 (14:38 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:43 +0000 (14:30 +0200)
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 <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>
fs/btrfs/direct-io.c
fs/btrfs/extent-io-tree.h

index eef8f0a93e80b2ee380de3d837b3ecadcd7c2a2d..0b421a6a21820d1c4f753c3248138d8d7ad605d9 100644 (file)
@@ -42,10 +42,10 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
 
        /* Direct lock must be taken before the extent lock. */
        if (nowait) {
-               if (!try_lock_dio_extent(io_tree, lockstart, lockend, cached_state))
+               if (!btrfs_try_lock_dio_extent(io_tree, lockstart, lockend, cached_state))
                        return -EAGAIN;
        } else {
-               lock_dio_extent(io_tree, lockstart, lockend, cached_state);
+               btrfs_lock_dio_extent(io_tree, lockstart, lockend, cached_state);
        }
 
        while (1) {
@@ -131,7 +131,7 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
        }
 
        if (ret)
-               unlock_dio_extent(io_tree, lockstart, lockend, cached_state);
+               btrfs_unlock_dio_extent(io_tree, lockstart, lockend, cached_state);
        return ret;
 }
 
@@ -580,8 +580,8 @@ static int btrfs_dio_iomap_begin(struct inode *inode, loff_t start,
 
        /* We didn't use everything, unlock the dio extent for the remainder. */
        if (!write && (start + len) < lockend)
-               unlock_dio_extent(&BTRFS_I(inode)->io_tree, start + len,
-                                 lockend, NULL);
+               btrfs_unlock_dio_extent(&BTRFS_I(inode)->io_tree, start + len,
+                                       lockend, NULL);
 
        return 0;
 
@@ -615,8 +615,8 @@ static int btrfs_dio_iomap_end(struct inode *inode, loff_t pos, loff_t length,
 
        if (!write && (iomap->type == IOMAP_HOLE)) {
                /* If reading from a hole, unlock and return */
-               unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
-                                 pos + length - 1, NULL);
+               btrfs_unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
+                                       pos + length - 1, NULL);
                return 0;
        }
 
@@ -627,8 +627,8 @@ static int btrfs_dio_iomap_end(struct inode *inode, loff_t pos, loff_t length,
                        btrfs_finish_ordered_extent(dio_data->ordered, NULL,
                                                    pos, length, false);
                else
-                       unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
-                                         pos + length - 1, NULL);
+                       btrfs_unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
+                                               pos + length - 1, NULL);
                ret = -ENOTBLK;
        }
        if (write) {
@@ -660,8 +660,8 @@ static void btrfs_dio_end_io(struct btrfs_bio *bbio)
                                            dip->file_offset, dip->bytes,
                                            !bio->bi_status);
        } else {
-               unlock_dio_extent(&inode->io_tree, dip->file_offset,
-                                 dip->file_offset + dip->bytes - 1, NULL);
+               btrfs_unlock_dio_extent(&inode->io_tree, dip->file_offset,
+                                       dip->file_offset + dip->bytes - 1, NULL);
        }
 
        bbio->bio.bi_private = bbio->private;
index 86436ed37ad614a6dcc4c4b406ea7658bb2fb135..83e9c2e0134b3fa5a8a75b757a39e52b5b491cf6 100644 (file)
@@ -223,20 +223,20 @@ int find_contiguous_extent_bit(struct extent_io_tree *tree, u64 start,
 bool btrfs_find_delalloc_range(struct extent_io_tree *tree, u64 *start,
                               u64 *end, u64 max_bytes,
                               struct extent_state **cached_state);
-static inline int lock_dio_extent(struct extent_io_tree *tree, u64 start,
-                                 u64 end, struct extent_state **cached)
+static inline int btrfs_lock_dio_extent(struct extent_io_tree *tree, u64 start,
+                                       u64 end, struct extent_state **cached)
 {
        return __lock_extent(tree, start, end, EXTENT_DIO_LOCKED, cached);
 }
 
-static inline bool try_lock_dio_extent(struct extent_io_tree *tree, u64 start,
-                                      u64 end, struct extent_state **cached)
+static inline bool btrfs_try_lock_dio_extent(struct extent_io_tree *tree, u64 start,
+                                            u64 end, struct extent_state **cached)
 {
        return __try_lock_extent(tree, start, end, EXTENT_DIO_LOCKED, cached);
 }
 
-static inline int unlock_dio_extent(struct extent_io_tree *tree, u64 start,
-                                   u64 end, struct extent_state **cached)
+static inline int btrfs_unlock_dio_extent(struct extent_io_tree *tree, u64 start,
+                                         u64 end, struct extent_state **cached)
 {
        return __clear_extent_bit(tree, start, end, EXTENT_DIO_LOCKED, cached, NULL);
 }