Skip to content

Commit

Permalink
btrfs: remove unused btrfs_try_tree_write_lock()
Browse files Browse the repository at this point in the history
btrfs_try_tree_write_lock() has been unused since commit
50b21d7 ("btrfs: submit a writeback bio per extent_buffer").
Remove it as we don't need it anymore.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Dr. David Alan Gilbert authored and David Sterba committed Nov 11, 2024
1 parent 441ffe8 commit b628c13
Showing 3 changed files with 0 additions and 17 deletions.
15 changes: 0 additions & 15 deletions fs/btrfs/locking.c
Original file line number Diff line number Diff line change
@@ -161,21 +161,6 @@ int btrfs_try_tree_read_lock(struct extent_buffer *eb)
return 0;
}

/*
* Try-lock for write.
*
* Return 1 if the rwlock has been taken, 0 otherwise
*/
int btrfs_try_tree_write_lock(struct extent_buffer *eb)
{
if (down_write_trylock(&eb->lock)) {
btrfs_set_eb_lock_owner(eb, current->pid);
trace_btrfs_try_tree_write_lock(eb);
return 1;
}
return 0;
}

/*
* Release read lock.
*/
1 change: 0 additions & 1 deletion fs/btrfs/locking.h
Original file line number Diff line number Diff line change
@@ -180,7 +180,6 @@ static inline void btrfs_tree_read_lock(struct extent_buffer *eb)

void btrfs_tree_read_unlock(struct extent_buffer *eb);
int btrfs_try_tree_read_lock(struct extent_buffer *eb);
int btrfs_try_tree_write_lock(struct extent_buffer *eb);
struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root);
struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root);
struct extent_buffer *btrfs_try_read_lock_root_node(struct btrfs_root *root);
1 change: 0 additions & 1 deletion include/trace/events/btrfs.h
Original file line number Diff line number Diff line change
@@ -2344,7 +2344,6 @@ DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_unlock_blocking);
DEFINE_BTRFS_LOCK_EVENT(btrfs_set_lock_blocking_read);
DEFINE_BTRFS_LOCK_EVENT(btrfs_set_lock_blocking_write);
DEFINE_BTRFS_LOCK_EVENT(btrfs_try_tree_read_lock);
DEFINE_BTRFS_LOCK_EVENT(btrfs_try_tree_write_lock);
DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_lock_atomic);

DECLARE_EVENT_CLASS(btrfs__space_info_update,

0 comments on commit b628c13

Please sign in to comment.