diff options
author | Qu Wenruo <wqu@suse.com> | 2022-02-22 18:20:59 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-02-23 17:55:01 +0100 |
commit | 26fbac2517fcad34fa3f950151fd4c0240fb2935 (patch) | |
tree | 55111ce5c59cf94c95b57dd1398526cc2a56c079 /fs/btrfs/tree-log.c | |
parent | 199257a78bb01341c3ba6e85bdcf3a2e6e452c6d (diff) |
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>
Diffstat (limited to 'fs/btrfs/tree-log.c')
0 files changed, 0 insertions, 0 deletions