Commit e38ae7a0 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Make flush_space return void

The return value of flush_space was used to have significance in the
early days when the code was first introduced and before the ticketed
enospc rework. Since the latter got introduced the return value lost any
significance whatsoever to its callers. So let's remove it. While at it
also remove the unused ticket variable in
btrfs_async_reclaim_metadata_space. It was used in the initial version
of the ticketed ENOSPC work, however Wang Xiaoguang detected a problem
with this and fixed it in ce129655 ("btrfs: introduce tickets_id to
determine whether asynchronous metadata reclaim work makes progress").
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
[ add comment ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3558d4f8
...@@ -4897,7 +4897,12 @@ struct reserve_ticket { ...@@ -4897,7 +4897,12 @@ struct reserve_ticket {
wait_queue_head_t wait; wait_queue_head_t wait;
}; };
static int flush_space(struct btrfs_fs_info *fs_info, /*
* Try to flush some data based on policy set by @state. This is only advisory
* and may fail for various reasons. The caller is supposed to examine the
* state of @space_info to detect the outcome.
*/
static void flush_space(struct btrfs_fs_info *fs_info,
struct btrfs_space_info *space_info, u64 num_bytes, struct btrfs_space_info *space_info, u64 num_bytes,
int state) int state)
{ {
...@@ -4951,7 +4956,7 @@ static int flush_space(struct btrfs_fs_info *fs_info, ...@@ -4951,7 +4956,7 @@ static int flush_space(struct btrfs_fs_info *fs_info,
trace_btrfs_flush_space(fs_info, space_info->flags, num_bytes, state, trace_btrfs_flush_space(fs_info, space_info->flags, num_bytes, state,
ret); ret);
return ret; return;
} }
static inline u64 static inline u64
...@@ -5053,10 +5058,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work) ...@@ -5053,10 +5058,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work)
flush_state = FLUSH_DELAYED_ITEMS_NR; flush_state = FLUSH_DELAYED_ITEMS_NR;
do { do {
struct reserve_ticket *ticket; flush_space(fs_info, space_info, to_reclaim, flush_state);
int ret;
ret = flush_space(fs_info, space_info, to_reclaim, flush_state);
spin_lock(&space_info->lock); spin_lock(&space_info->lock);
if (list_empty(&space_info->tickets)) { if (list_empty(&space_info->tickets)) {
space_info->flush = 0; space_info->flush = 0;
...@@ -5066,8 +5068,6 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work) ...@@ -5066,8 +5068,6 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work)
to_reclaim = btrfs_calc_reclaim_metadata_size(fs_info, to_reclaim = btrfs_calc_reclaim_metadata_size(fs_info,
space_info, space_info,
false); false);
ticket = list_first_entry(&space_info->tickets,
struct reserve_ticket, list);
if (last_tickets_id == space_info->tickets_id) { if (last_tickets_id == space_info->tickets_id) {
flush_state++; flush_state++;
} else { } else {
......
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