diff options
author | Nikolay Borisov <nborisov@suse.com> | 2017-07-11 13:25:13 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-08-16 16:12:01 +0200 |
commit | 7bdd6277e0dc2beb4f5db5ea4ff7670ecf0b5879 (patch) | |
tree | 7199cd78b2278196bc07ccf8689b44a2cc13098f /fs/btrfs/extent-tree.c | |
parent | 6c6b5a39c4bf3dbd8cf629c9f5450e983c19dbb9 (diff) | |
download | linux-stable-7bdd6277e0dc2beb4f5db5ea4ff7670ecf0b5879.tar.gz linux-stable-7bdd6277e0dc2beb4f5db5ea4ff7670ecf0b5879.tar.bz2 linux-stable-7bdd6277e0dc2beb4f5db5ea4ff7670ecf0b5879.zip |
btrfs: Remove redundant argument of flush_space
All callers of flush_space pass the same number for orig/num_bytes
arguments. Let's remove one of the numbers and also modify the trace
point to show only a single number - bytes requested.
Seems that last point where the two parameters were treated differently
is before the ticketed enospc rework.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 6d04563585e6..288b38ae8791 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4906,7 +4906,7 @@ struct reserve_ticket { static int flush_space(struct btrfs_fs_info *fs_info, struct btrfs_space_info *space_info, u64 num_bytes, - u64 orig_bytes, int state) + int state) { struct btrfs_root *root = fs_info->extent_root; struct btrfs_trans_handle *trans; @@ -4931,7 +4931,7 @@ static int flush_space(struct btrfs_fs_info *fs_info, break; case FLUSH_DELALLOC: case FLUSH_DELALLOC_WAIT: - shrink_delalloc(fs_info, num_bytes * 2, orig_bytes, + shrink_delalloc(fs_info, num_bytes * 2, num_bytes, state == FLUSH_DELALLOC_WAIT); break; case ALLOC_CHUNK: @@ -4949,15 +4949,15 @@ static int flush_space(struct btrfs_fs_info *fs_info, break; case COMMIT_TRANS: ret = may_commit_transaction(fs_info, space_info, - orig_bytes, 0); + num_bytes, 0); break; default: ret = -ENOSPC; break; } - trace_btrfs_flush_space(fs_info, space_info->flags, num_bytes, - orig_bytes, state, ret); + trace_btrfs_flush_space(fs_info, space_info->flags, num_bytes, state, + ret); return ret; } @@ -5063,8 +5063,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work) struct reserve_ticket *ticket; int ret; - ret = flush_space(fs_info, space_info, to_reclaim, to_reclaim, - flush_state); + ret = flush_space(fs_info, space_info, to_reclaim, flush_state); spin_lock(&space_info->lock); if (list_empty(&space_info->tickets)) { space_info->flush = 0; @@ -5120,8 +5119,7 @@ static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info, spin_unlock(&space_info->lock); do { - flush_space(fs_info, space_info, to_reclaim, to_reclaim, - flush_state); + flush_space(fs_info, space_info, to_reclaim, flush_state); flush_state++; spin_lock(&space_info->lock); if (ticket->bytes == 0) { |