diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-12-19 12:10:10 +0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-20 18:36:41 +0400 |
commit | 093486c453a55230ccdad4b48863b872fe68c46e (patch) | |
tree | 5e66183feabea18cca133d4688d7adbdf0110360 /fs/btrfs/delayed-ref.h | |
parent | 0e8c36a9fd8169a8b96c2ddc8446894bcd07b6b1 (diff) | |
download | linux-093486c453a55230ccdad4b48863b872fe68c46e.tar.xz |
Btrfs: make delayed ref lock logic more readable
Locking and unlocking delayed ref mutex are in the different functions,
and the name of lock functions is not uniform, so the readability is not
so good, this patch optimizes the lock logic and makes it more readable.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/delayed-ref.h')
-rw-r--r-- | fs/btrfs/delayed-ref.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h index fe50392cdf76..7939149f8f27 100644 --- a/fs/btrfs/delayed-ref.h +++ b/fs/btrfs/delayed-ref.h @@ -211,8 +211,14 @@ struct btrfs_delayed_ref_head * btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr); int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans, struct btrfs_delayed_ref_head *head); +static inline void btrfs_delayed_ref_unlock(struct btrfs_delayed_ref_head *head) +{ + mutex_unlock(&head->mutex); +} + int btrfs_find_ref_cluster(struct btrfs_trans_handle *trans, struct list_head *cluster, u64 search_start); +void btrfs_release_ref_cluster(struct list_head *cluster); int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, struct btrfs_delayed_ref_root *delayed_refs, |