Qu Wenruo 26fbac2517 btrfs: autodefrag: only scan one inode once
Although we have btrfs_requeue_inode_defrag(), for autodefrag we are
still just exhausting all inode_defrag items in the tree.

This means, it doesn't make much difference to requeue an inode_defrag,
other than scan the inode from the beginning till its end.

Change the behaviour to always scan from offset 0 of an inode, and till
the end.

By this we get the following benefit:

- Straight-forward code

- No more re-queue related check

- Fewer members in inode_defrag

We still keep the same btrfs_get_fs_root() and btrfs_iget() check for
each loop, and added extra should_auto_defrag() check per-loop.

Note: the patch needs to be backported and is intentionally written
to minimize the diff size, code will be cleaned up later.

CC: stable@vger.kernel.org # 5.16
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-23 17:55:01 +01:00
..
2021-11-10 21:16:56 +00:00
2021-12-16 09:10:13 -08:00
2021-08-19 09:02:55 +09:00
2021-11-09 10:02:51 -08:00
2021-10-25 19:11:50 -07:00
2021-04-12 15:04:29 +02:00
2021-11-13 15:32:30 -08:00
2021-11-01 10:25:27 -07:00
2021-12-02 12:41:10 +01:00
2021-08-26 22:28:02 +02:00
2021-11-03 09:23:25 -07:00
2021-12-07 15:47:09 +00:00
2021-11-27 10:33:55 -08:00
2021-12-18 17:11:06 -05:00
2021-11-09 10:51:12 -08:00
\n
2021-11-06 16:40:48 -07:00
\n
2021-11-06 16:40:48 -07:00
2021-11-09 12:53:58 +01:00
2021-08-19 09:02:55 +09:00
2021-12-17 16:56:35 +09:00
2021-11-17 09:26:09 +01:00
2021-10-18 14:43:22 -06:00
2021-08-31 11:13:35 -07:00
2021-09-09 13:25:49 -07:00
2021-11-17 10:36:35 -05:00
2021-10-19 05:49:54 -06:00
2021-08-31 11:06:32 -07:00
2021-10-19 14:11:39 -04:00
2021-11-01 09:06:53 -07:00
2021-12-09 10:49:56 -08:00
2021-08-10 17:57:22 +02:00