diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-07-21 17:22:23 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-10-07 13:06:52 +0300 |
commit | 058e6d1d267fe9c7e072533d2e1469d93aec3ec7 (patch) | |
tree | b45ec5d3c6482e47d8ce07b04d54314cf83d8148 /fs/btrfs/ctree.h | |
parent | 448b966b49be55af8f4aa79b24d7896809fd8e67 (diff) | |
download | linux-058e6d1d267fe9c7e072533d2e1469d93aec3ec7.tar.xz |
btrfs: add flushing states for handling data reservations
Currently the way we do data reservations is by seeing if we have enough
space in our space_info. If we do not and we're a normal inode we'll
1) Attempt to force a chunk allocation until we can't anymore.
2) If that fails we'll flush delalloc, then commit the transaction, then
run the delayed iputs.
If we are a free space inode we're only allowed to force a chunk
allocation. In order to use the normal flushing mechanism we need to
encode this into a flush state array for normal inodes. Since both will
start with allocating chunks until the space info is full there is no
need to add this as a flush state, this will be handled specially.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index e2ec4f067857..098f006fc5a3 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2592,6 +2592,8 @@ enum btrfs_reserve_flush_enum { * * Can be interruped by fatal signal. */ + BTRFS_RESERVE_FLUSH_DATA, + BTRFS_RESERVE_FLUSH_FREE_SPACE_INODE, BTRFS_RESERVE_FLUSH_ALL, /* |