Commit def936e5 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: remove orig_bytes from reserve_ticket

Now that we do not do partial filling of tickets simply remove
orig_bytes, it is no longer needed.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 00c0135e
...@@ -920,7 +920,6 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info, ...@@ -920,7 +920,6 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info,
struct reserve_ticket *ticket, struct reserve_ticket *ticket,
enum btrfs_reserve_flush_enum flush) enum btrfs_reserve_flush_enum flush)
{ {
u64 reclaim_bytes = 0;
int ret; int ret;
switch (flush) { switch (flush) {
...@@ -945,17 +944,11 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info, ...@@ -945,17 +944,11 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info,
spin_lock(&space_info->lock); spin_lock(&space_info->lock);
ret = ticket->error; ret = ticket->error;
if (ticket->bytes || 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); list_del_init(&ticket->list);
if (!ret) if (!ret)
ret = -ENOSPC; ret = -ENOSPC;
} }
spin_unlock(&space_info->lock); 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)); ASSERT(list_empty(&ticket->list));
return ret; return ret;
} }
...@@ -1015,7 +1008,6 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info, ...@@ -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. * the list and we will do our own flushing further down.
*/ */
if (ret && flush != BTRFS_RESERVE_NO_FLUSH) { if (ret && flush != BTRFS_RESERVE_NO_FLUSH) {
ticket.orig_bytes = orig_bytes;
ticket.bytes = orig_bytes; ticket.bytes = orig_bytes;
ticket.error = 0; ticket.error = 0;
init_waitqueue_head(&ticket.wait); init_waitqueue_head(&ticket.wait);
......
...@@ -70,7 +70,6 @@ struct btrfs_space_info { ...@@ -70,7 +70,6 @@ struct btrfs_space_info {
}; };
struct reserve_ticket { struct reserve_ticket {
u64 orig_bytes;
u64 bytes; u64 bytes;
int error; int error;
struct list_head list; struct list_head list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment