]> git.hungrycats.org Git - linux/commitdiff
Revert "Btrfs: track transid for delayed ref flushing"
authorZygo Blaxell <zblaxell@thirteen.furryterror.org>
Sun, 1 May 2016 20:34:11 +0000 (16:34 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Sun, 1 May 2016 20:34:11 +0000 (16:34 -0400)
This reverts commit e1a2af4b63a4e3df2d9ce14a1f99104443ee31fd.

fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/transaction.c

index 80166fc2209403e83ceb83e162ebfcc0c09238ad..585c3b5d56ea01a323ca05ba2bcd69be74a8f9b6 100644 (file)
@@ -3400,7 +3400,7 @@ void btrfs_put_block_group(struct btrfs_block_group_cache *cache);
 int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
                           struct btrfs_root *root, unsigned long count);
 int btrfs_async_run_delayed_refs(struct btrfs_root *root,
-                                unsigned long count, u64 transid, int wait);
+                                unsigned long count, int wait);
 int btrfs_lookup_data_extent(struct btrfs_root *root, u64 start, u64 len);
 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
                             struct btrfs_root *root, u64 bytenr,
index 69296d4b70c7c1ec82ec0bc152141999081f3da0..22027794591afd353344ea927d5713c709781b5d 100644 (file)
@@ -2782,7 +2782,6 @@ int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans,
 
 struct async_delayed_refs {
        struct btrfs_root *root;
-       u64 transid;
        int count;
        int error;
        int sync;
@@ -2798,16 +2797,9 @@ static void delayed_ref_async_start(struct btrfs_work *work)
 
        async = container_of(work, struct async_delayed_refs, work);
 
-       trans = btrfs_attach_transaction(async->root);
+       trans = btrfs_join_transaction(async->root);
        if (IS_ERR(trans)) {
-               if (PTR_ERR(trans) != -ENOENT)
-                       async->error = PTR_ERR(trans);
-               goto done;
-       }
-
-       /* Don't bother flushing if we got into a different transaction */
-       if (trans->transid != async->transid) {
-               btrfs_end_transaction(trans, async->root);
+               async->error = PTR_ERR(trans);
                goto done;
        }
 
@@ -2831,7 +2823,7 @@ done:
 }
 
 int btrfs_async_run_delayed_refs(struct btrfs_root *root,
-                                unsigned long count, u64 transid, int wait)
+                                unsigned long count, int wait)
 {
        struct async_delayed_refs *async;
        int ret;
@@ -2843,7 +2835,6 @@ int btrfs_async_run_delayed_refs(struct btrfs_root *root,
        async->root = root->fs_info->tree_root;
        async->count = count;
        async->error = 0;
-       async->transid = transid;
        if (wait)
                async->sync = 1;
        else
index efc44a9c4cee609121bf3d9b9bc7a1098df7dde4..489a73908310f76fbe4887c0fdf1002fd653d986 100644 (file)
@@ -4469,7 +4469,6 @@ delete:
                        BUG_ON(ret);
                        if (btrfs_should_throttle_delayed_refs(trans, root))
                                btrfs_async_run_delayed_refs(root,
-                                                            trans->transid,
                                        trans->delayed_ref_updates * 2, 0);
                        if (be_nice) {
                                if (truncate_space_check(trans, root,
index e64faed85ad79de21bd2e7298ac40daaee848511..e77e367137862ed440f751df03773fe2cf525e46 100644 (file)
@@ -825,7 +825,6 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
 {
        struct btrfs_transaction *cur_trans = trans->transaction;
        struct btrfs_fs_info *info = root->fs_info;
-       u64 transid = trans->transid;
        unsigned long cur = trans->delayed_ref_updates;
        int lock = (trans->type != TRANS_JOIN_NOLOCK);
        int err = 0;
@@ -917,7 +916,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
 
        kmem_cache_free(btrfs_trans_handle_cachep, trans);
        if (must_run_delayed_refs) {
-               btrfs_async_run_delayed_refs(root, cur, transid,
+               btrfs_async_run_delayed_refs(root, cur,
                                             must_run_delayed_refs == 1);
        }
        return err;