summaryrefslogtreecommitdiff
path: root/fs/btrfs/locking.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-04-04 02:52:31 +0300
committerDavid Sterba <dsterba@suse.com>2019-02-25 16:13:27 +0300
commitaa12c02778a9719283fc3c32cfe5cffb902a7685 (patch)
tree3e16f94482bf883da2f9ed4f0bac7bb4ea17d0d8 /fs/btrfs/locking.h
parentb95be2d9fb2a6120958b777e13d2328f9770bc2d (diff)
downloadlinux-aa12c02778a9719283fc3c32cfe5cffb902a7685.tar.xz
btrfs: split btrfs_clear_lock_blocking_rw to read and write helpers
There are many callers that hardcode the desired lock type so we can avoid the switch and call them directly. Split the current function to two. There are no remaining users of btrfs_clear_lock_blocking_rw so it's removed. The call sites will be converted in followup patches. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/locking.h')
-rw-r--r--fs/btrfs/locking.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h
index 0453a4797693..3f81d6900c71 100644
--- a/fs/btrfs/locking.h
+++ b/fs/btrfs/locking.h
@@ -19,7 +19,8 @@ void btrfs_tree_read_unlock(struct extent_buffer *eb);
void btrfs_tree_read_unlock_blocking(struct extent_buffer *eb);
void btrfs_set_lock_blocking_read(struct extent_buffer *eb);
void btrfs_set_lock_blocking_write(struct extent_buffer *eb);
-void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw);
+void btrfs_clear_lock_blocking_read(struct extent_buffer *eb);
+void btrfs_clear_lock_blocking_write(struct extent_buffer *eb);
void btrfs_assert_tree_locked(struct extent_buffer *eb);
int btrfs_try_tree_read_lock(struct extent_buffer *eb);
int btrfs_try_tree_write_lock(struct extent_buffer *eb);
@@ -55,8 +56,4 @@ static inline void btrfs_set_lock_blocking(struct extent_buffer *eb)
btrfs_set_lock_blocking_rw(eb, BTRFS_WRITE_LOCK);
}
-static inline void btrfs_clear_lock_blocking(struct extent_buffer *eb)
-{
- btrfs_clear_lock_blocking_rw(eb, BTRFS_WRITE_LOCK_BLOCKING);
-}
#endif