summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-ref.h
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-12-19 08:10:10 +0000
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 09:36:41 -0500
commit093486c453a55230ccdad4b48863b872fe68c46e (patch)
tree5e66183feabea18cca133d4688d7adbdf0110360 /fs/btrfs/delayed-ref.h
parent0e8c36a9fd8169a8b96c2ddc8446894bcd07b6b1 (diff)
downloadop-kernel-dev-093486c453a55230ccdad4b48863b872fe68c46e.zip
op-kernel-dev-093486c453a55230ccdad4b48863b872fe68c46e.tar.gz
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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index fe50392..7939149 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,
OpenPOWER on IntegriCloud