btrfs: remove orig_bytes from reserve_ticket
authorJosef Bacik <josef@toxicpanda.com>
Thu, 22 Aug 2019 19:11:01 +0000 (15:11 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:18 +0000 (14:59 +0200)
Now that we do not do partial filling of tickets simply remove
orig_bytes, it is no longer needed.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c
fs/btrfs/space-info.h

index 3ab7a4810bef1e83c9703d69ee9ab88a96c0fbb4..af53c3344598bdbddaa93b90911324a313bad1a6 100644 (file)
@@ -920,7 +920,6 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info,
                                 struct reserve_ticket *ticket,
                                 enum btrfs_reserve_flush_enum flush)
 {
-       u64 reclaim_bytes = 0;
        int ret;
 
        switch (flush) {
@@ -945,17 +944,11 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info,
        spin_lock(&space_info->lock);
        ret = ticket->error;
        if (ticket->bytes || ticket->error) {
-               if (ticket->bytes < ticket->orig_bytes)
-                       reclaim_bytes = ticket->orig_bytes - ticket->bytes;
                list_del_init(&ticket->list);
                if (!ret)
                        ret = -ENOSPC;
        }
        spin_unlock(&space_info->lock);
-
-       if (reclaim_bytes)
-               btrfs_space_info_add_old_bytes(fs_info, space_info,
-                                              reclaim_bytes);
        ASSERT(list_empty(&ticket->list));
        return ret;
 }
@@ -1015,7 +1008,6 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
         * the list and we will do our own flushing further down.
         */
        if (ret && flush != BTRFS_RESERVE_NO_FLUSH) {
-               ticket.orig_bytes = orig_bytes;
                ticket.bytes = orig_bytes;
                ticket.error = 0;
                init_waitqueue_head(&ticket.wait);
index b844e50a6a49383e2c8c8651022a656b051f6e8c..dc6ee66ed6003ad435dc55390c521b9d71b0decf 100644 (file)
@@ -70,7 +70,6 @@ struct btrfs_space_info {
 };
 
 struct reserve_ticket {
-       u64 orig_bytes;
        u64 bytes;
        int error;
        struct list_head list;