]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/delayed-ref.h
Merge tag 'drm-intel-next-2017-05-29' of git://anongit.freedesktop.org/git/drm-intel...
[karo-tx-linux.git] / fs / btrfs / delayed-ref.h
index 0e537f98f1a1c63c529c118baed1cac26efa194e..c0264ff01b53cfe9e2fa44a7cdd7e9352012f0ee 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef __DELAYED_REF__
 #define __DELAYED_REF__
 
+#include <linux/refcount.h>
+
 /* these are the possible values of struct btrfs_delayed_ref_node->action */
 #define BTRFS_ADD_DELAYED_REF    1 /* add one backref to the tree */
 #define BTRFS_DROP_DELAYED_REF   2 /* delete one backref from the tree */
@@ -53,7 +55,7 @@ struct btrfs_delayed_ref_node {
        u64 seq;
 
        /* ref count on this data structure */
-       atomic_t refs;
+       refcount_t refs;
 
        /*
         * how many refs is this entry adding or deleting.  For
@@ -220,8 +222,8 @@ btrfs_free_delayed_extent_op(struct btrfs_delayed_extent_op *op)
 
 static inline void btrfs_put_delayed_ref(struct btrfs_delayed_ref_node *ref)
 {
-       WARN_ON(atomic_read(&ref->refs) == 0);
-       if (atomic_dec_and_test(&ref->refs)) {
+       WARN_ON(refcount_read(&ref->refs) == 0);
+       if (refcount_dec_and_test(&ref->refs)) {
                WARN_ON(ref->in_tree);
                switch (ref->type) {
                case BTRFS_TREE_BLOCK_REF_KEY: