aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-12-05btrfs: search for delalloc more efficiently during lseek/fiemapFilipe Manana1-104/+48
During lseek (SEEK_HOLE/DATA) and fiemap, when processing a file range that corresponds to a hole or a prealloc extent, we have to check if there's any delalloc in the range. We do it by searching for delalloc ranges in the inode's io_tree (for unflushed delalloc) and in the inode's extent map tree (for delalloc that is flushing). We avoid searching the extent map tree if the number of outstanding extents is 0, as in that case we can't have extent maps for our search range in the tree that correspond to delalloc that is flushing. However if we have any unflushed delalloc, due to buffered writes or mmap writes, then the outstanding extents counter is not 0 and we'll search the extent map tree. The tree may be large because it can have lots of extent maps that were loaded by reads or created by previous writes, therefore taking a significant time to search the tree, specially if have a file with a lot of holes and/or prealloc extents. We can improve on this by instead of searching the extent map tree, searching the ordered extents tree of the inode, since when delalloc is flushing we create an ordered extent along with the new extent map, while holding the respective file range locked in the inode's io_tree. The ordered extents tree is typically much smaller, since ordered extents have a short life and get removed from the tree once they are completed, while extent maps can stay for a very long time in the extent map tree, either created by previous writes or loaded by read operations. So use the ordered extents tree instead of the extent maps tree. This change is part of a patchset that has the goal to make performance better for applications that use lseek's SEEK_HOLE and SEEK_DATA modes to iterate over the extents of a file. Two examples are the cp program from coreutils 9.0+ and the tar program (when using its --sparse / -S option). A sample test and results are listed in the changelog of the last patch in the series: 1/9 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree 2/9 btrfs: add an early exit when searching for delalloc range for lseek/fiemap 3/9 btrfs: skip unnecessary delalloc searches during lseek/fiemap 4/9 btrfs: search for delalloc more efficiently during lseek/fiemap 5/9 btrfs: remove no longer used btrfs_next_extent_map() 6/9 btrfs: allow passing a cached state record to count_range_bits() 7/9 btrfs: update stale comment for count_range_bits() 8/9 btrfs: use cached state when looking for delalloc ranges with fiemap 9/9 btrfs: use cached state when looking for delalloc ranges with lseek Reported-by: Wang Yugui <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5NSVicm7nYBJ7x8fFkDpno8z3PYt5aPU43Bajc1H0h1Q@mail.gmail.com/ Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: skip unnecessary delalloc searches during lseek/fiemapFilipe Manana1-1/+7
During lseek (SEEK_HOLE/DATA) and fiemap, when processing a file range that corresponds to a hole or a prealloc extent, if we find that there is no delalloc marked in the inode's io_tree but there is delalloc due to an extent map in the io tree, then on the next iteration that calls find_delalloc_subrange() we can skip searching the io tree again, since on the first call we had no delalloc in the io tree for the whole range. This change is part of a patchset that has the goal to make performance better for applications that use lseek's SEEK_HOLE and SEEK_DATA modes to iterate over the extents of a file. Two examples are the cp program from coreutils 9.0+ and the tar program (when using its --sparse / -S option). A sample test and results are listed in the changelog of the last patch in the series: 1/9 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree 2/9 btrfs: add an early exit when searching for delalloc range for lseek/fiemap 3/9 btrfs: skip unnecessary delalloc searches during lseek/fiemap 4/9 btrfs: search for delalloc more efficiently during lseek/fiemap 5/9 btrfs: remove no longer used btrfs_next_extent_map() 6/9 btrfs: allow passing a cached state record to count_range_bits() 7/9 btrfs: update stale comment for count_range_bits() 8/9 btrfs: use cached state when looking for delalloc ranges with fiemap 9/9 btrfs: use cached state when looking for delalloc ranges with lseek Reported-by: Wang Yugui <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5NSVicm7nYBJ7x8fFkDpno8z3PYt5aPU43Bajc1H0h1Q@mail.gmail.com/ Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: add an early exit when searching for delalloc range for lseek/fiemapFilipe Manana1-6/+16
During fiemap and lseek (SEEK_HOLE/DATA), when looking for delalloc in a range corresponding to a hole or a prealloc extent, if we found the whole range marked as delalloc in the inode's io_tree, then we can terminate immediately and avoid searching the extent map tree. If not, and if the found delalloc starts at the same offset of our search start but ends before our search range's end, then we can adjust the search range for the search in the extent map tree. So implement those changes. This change is part of a patchset that has the goal to make performance better for applications that use lseek's SEEK_HOLE and SEEK_DATA modes to iterate over the extents of a file. Two examples are the cp program from coreutils 9.0+ and the tar program (when using its --sparse / -S option). A sample test and results are listed in the changelog of the last patch in the series: 1/9 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree 2/9 btrfs: add an early exit when searching for delalloc range for lseek/fiemap 3/9 btrfs: skip unnecessary delalloc searches during lseek/fiemap 4/9 btrfs: search for delalloc more efficiently during lseek/fiemap 5/9 btrfs: remove no longer used btrfs_next_extent_map() 6/9 btrfs: allow passing a cached state record to count_range_bits() 7/9 btrfs: update stale comment for count_range_bits() 8/9 btrfs: use cached state when looking for delalloc ranges with fiemap 9/9 btrfs: use cached state when looking for delalloc ranges with lseek Reported-by: Wang Yugui <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5NSVicm7nYBJ7x8fFkDpno8z3PYt5aPU43Bajc1H0h1Q@mail.gmail.com/ Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_treeFilipe Manana2-23/+3
We don't need to set the EXTENT_UPDATE bit in an inode's io_tree to mark a range as uptodate, we rely on the pages themselves being uptodate - page reading is not triggered for already uptodate pages. Recently we removed most use of the EXTENT_UPTODATE for buffered IO with commit 52b029f42751 ("btrfs: remove unnecessary EXTENT_UPTODATE state in buffered I/O path"), but there were a few leftovers, namely when reading from holes and successfully finishing read repair. These leftovers are unnecessarily making an inode's tree larger and deeper, slowing down searches on it. So remove all the leftovers. This change is part of a patchset that has the goal to make performance better for applications that use lseek's SEEK_HOLE and SEEK_DATA modes to iterate over the extents of a file. Two examples are the cp program from coreutils 9.0+ and the tar program (when using its --sparse / -S option). A sample test and results are listed in the changelog of the last patch in the series: 1/9 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree 2/9 btrfs: add an early exit when searching for delalloc range for lseek/fiemap 3/9 btrfs: skip unnecessary delalloc searches during lseek/fiemap 4/9 btrfs: search for delalloc more efficiently during lseek/fiemap 5/9 btrfs: remove no longer used btrfs_next_extent_map() 6/9 btrfs: allow passing a cached state record to count_range_bits() 7/9 btrfs: update stale comment for count_range_bits() 8/9 btrfs: use cached state when looking for delalloc ranges with fiemap 9/9 btrfs: use cached state when looking for delalloc ranges with lseek Reported-by: Wang Yugui <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5NSVicm7nYBJ7x8fFkDpno8z3PYt5aPU43Bajc1H0h1Q@mail.gmail.com/ Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: move tree block parentness check into validate_extent_buffer()Qu Wenruo4-28/+93
[BACKGROUND] Although both btrfs metadata and data has their read time verification done at endio time (btrfs_validate_metadata_buffer() and btrfs_verify_data_csum()), metadata has extra verification, mostly parentness check including first key/transid/owner_root/level, done at read_tree_block() and btrfs_read_extent_buffer(). On the other hand, all the data verification is done at endio context. [ENHANCEMENT] This patch will make a new union in btrfs_bio, taking the space of the old data checksums, thus it will not increase the memory usage. With that extra btrfs_tree_parent_check inside btrfs_bio, we can just pass the check parameter into read_extent_buffer_pages(), and before submitting the bio, we can copy the check structure into btrfs_bio. And finally at endio time, we can grab btrfs_bio::parent_check and pass it to validate_extent_buffer(), to move the remaining checks into it. This brings the following benefits: - Much simpler btrfs_read_extent_buffer() Now it only needs to iterate through all mirrors. - Simpler read-time transid check Previously we go verify_parent_transid() after reading out the extent buffer. Now the transid check is done inside the endio function, no other code can modify the content. Thus no need to use the extent lock anymore. Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: concentrate all tree block parentness check parameters into one structureQu Wenruo10-72/+159
There are several different tree block parentness check parameters used across several helpers: - level Mandatory - transid Under most cases it's mandatory, but there are several backref cases which skips this check. - owner_root - first_key Utilized by most top-down tree search routine. Otherwise can be skipped. Those four members are not always mandatory checks, and some of them are the same u64, which means if some arguments got swapped compiler will not catch it. Furthermore if we're going to further expand the parentness check, we need to modify quite some helpers just to add one more parameter. This patch will concentrate all these members into a structure called btrfs_tree_parent_check, and pass that structure for the following helpers: - btrfs_read_extent_buffer() - read_tree_block() Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: move device->name RCU allocation and assign to btrfs_alloc_device()Anand Jain3-48/+34
There is a repeating code section in the parent function after calling btrfs_alloc_device(), as below: name = rcu_string_strdup(path, GFP_...); if (!name) { btrfs_free_device(device); return ERR_PTR(-ENOMEM); } rcu_assign_pointer(device->name, name); Except in add_missing_dev() for obvious reasons. This patch consolidates that repeating code into the btrfs_alloc_device() itself so that the parent function doesn't have to duplicate code. This consolidation also helps to review issues regarding RCU lock violation with device->name. Parent function device_list_add() and add_missing_dev() use GFP_NOFS for the allocation, whereas the rest of the parent functions use GFP_KERNEL, so bring the NOFS allocation context using memalloc_nofs_save() in the function device_list_add() and add_missing_dev() is already doing it. Signed-off-by: Anand Jain <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: constify input buffer parameter in compression codeDavid Sterba5-9/+9
The input buffers passed down to compression must never be changed, switch type to u8 as it's a raw byte buffer and use const. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: raid56: remove the old error tracking systemQu Wenruo2-189/+53
Since all the recovery paths have been migrated to the new error bitmap based system, we can remove the old stripe number based system. This cleanup involves one behavior change: - Rebuild rbio can no longer be merged Previously a rebuild rbio (caused by retry after data csum mismatch) can be merged, if the error happens in the same stripe. But with the new error bitmap based solution, it's much harder to compare error bitmaps. So here we just don't merge rebuild rbio at all. This may introduce some performance impact at extreme corner cases, but we're willing to take it. Other than that, this patch will cleanup the following members: - rbio::faila - rbio::failb They will be replaced by per-vertical stripe check, which is more accurate. - rbio::error It will be replace by per-vertical stripe error bitmap check. - Allow get_rbio_vertical_errors() to accept NULL pointers for @faila and @failb Some call sites only want to check if we have errors beyond the tolerance. Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: raid56: migrate recovery and scrub recovery path to use error_bitmapQu Wenruo1-86/+193
Since we have rbio::error_bitmap to indicate exactly where the errors are (including read error and csum mismatch error), we can make recovery path more accurate. For example: 0 32K 64K Data 1 |XXXXXXXX| | Data 2 | |XXXXXXXXX| Parity | | | 1) Get csum mismatch when reading data 1 [0, 32K) 2) Mark corresponding range error The old code will mark the whole data 1 stripe as error. While the new code will only mark data 1 [0, 32K) as error. 3) Recovery path The old code will recover data 1 [0, 64K), all using Data 2 and parity. This means, Data 1 [32K, 64K) will be corrupted data, as data 2 [32K, 64K) is already corrupted. While the new code will only recover data 1 [0, 32K), as only that range has error so far. This new behavior can avoid populating rbio cache with incorrect data. Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: raid56: introduce btrfs_raid_bio::error_bitmapQu Wenruo2-7/+103
Currently btrfs raid56 uses btrfs_raid_bio::faila and failb to indicate which stripe(s) had IO errors. But that has some problems: - If one sector failed csum check, the whole stripe where the corruption is will be marked error. This can reduce the chance we do recover, like this: 0 4K 8K Data 1 |XX| | Data 2 | |XX| Parity | | | In above case, 0~4K in data 1 should be recovered using data 2 and parity, while 4K~8K in data 2 should be recovered using data 1 and parity. Currently if we trigger read on 0~4K of data 1, we will also recover 4K~8K of data 1 using corrupted data 2 and parity, causing wrong result in rbio cache. - Harder to expand for future M-N scheme As we're limited to just faila/b, two corruptions. - Harder to expand to handle extra csum errors This can be problematic if we start to do csum verification. This patch will introduce an extra @error_bitmap, where one bit represents error that happened for that sector. The choice to introduce a new error bitmap other than reusing sector_ptr, is to avoid extra search between rbio::stripe_sectors[] and rbio::bio_sectors[]. Since we can submit bio using sectors from both sectors, doing proper search on both array will more complex. Although the new bitmap will take extra memory, later we can remove things like @error and faila/b to save some memory. Currently the new error bitmap and failab mechanism coexists, the error bitmap is only updated at endio time and recover entrance. Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_add_delayed_iputDavid Sterba7-29/+28
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: use btrfs_inode inside btrfs_verify_data_csumDavid Sterba1-6/+6
The function is mostly using internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: use btrfs_inode inside compress_file_rangeDavid Sterba1-19/+18
The function is mostly using internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: switch async_chunk::inode to btrfs_inodeDavid Sterba1-6/+6
The async_chunk::inode structure is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_inherit_iflagsDavid Sterba1-11/+11
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to inode_tree_addDavid Sterba1-7/+7
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to fixup_tree_root_locationDavid Sterba1-5/+5
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_inode_by_nameDavid Sterba1-6/+6
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_unlink_subvolDavid Sterba1-16/+16
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_clear_delalloc_extentDavid Sterba3-5/+4
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_split_delalloc_extentDavid Sterba3-7/+7
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_set_delalloc_extentDavid Sterba3-19/+18
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_merge_delalloc_extentDavid Sterba3-13/+11
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: switch extent_io_tree::private_data to btrfs_inode and renameDavid Sterba4-33/+31
The extent_io_tree::private_data was meant to be a preparatory work for the metadata inode rework but that never materialized. Now it's used only for an inode so it's better to change the appropriate type and rename it. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: drop private_data parameter from extent_io_tree_initDavid Sterba9-20/+17
All callers except one pass NULL, so the parameter can be dropped and the inode::io_tree initialization can be open coded. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_delete_subvolumeDavid Sterba3-7/+7
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to __unlink_start_transDavid Sterba1-4/+4
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_check_data_csumDavid Sterba3-12/+9
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: switch btrfs_writepage_fixup::inode to btrfs_inodeDavid Sterba1-3/+3
The btrfs_writepage_fixup structure is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_add_delalloc_inodesDavid Sterba1-9/+6
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_dirty_inodeDavid Sterba1-10/+10
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_inode_unlockDavid Sterba8-36/+36
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_inode_lockDavid Sterba8-22/+22
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_truncateDavid Sterba1-21/+20
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_dio_bioDavid Sterba1-7/+7
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: switch btrfs_dio_private::inode to btrfs_inodeDavid Sterba1-8/+8
The btrfs_dio_private structure is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_repair_one_sectorDavid Sterba4-12/+11
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to submit_one_bioDavid Sterba1-6/+6
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_dio_repair_bioDavid Sterba3-5/+5
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_data_read_bioDavid Sterba3-7/+8
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_data_write_bioDavid Sterba3-11/+10
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_metadata_bioDavid Sterba3-6/+6
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_wq_submit_bioDavid Sterba3-7/+7
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_bio_start_direct_ioDavid Sterba3-4/+4
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: pass btrfs_inode to btrfs_submit_bio_startDavid Sterba3-4/+4
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: switch async_submit_bio::inode to btrfs_inodeDavid Sterba1-7/+7
The async bio submit is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: simplify btree_submit_bio_start and btrfs_submit_bio_start parametersDavid Sterba4-14/+6
After previous patches the unused parameters can be removed from btree_submit_bio_start and btrfs_submit_bio_start as they don't need to conform to the extent_submit_bio_start_t typedef. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: change how submit bio callback is passed to btrfs_wq_submit_bioDavid Sterba5-23/+45
There's a callback function parameter for btrfs_wq_submit_bio that can be one of: metadata, buffered data, direct io data. The callback abstraction is unnecessary as we have all functions available. Replace the parameter with a command that leads to a direct call in run_one_async_start. The called functions can be then simplified and we can also remove the extent_submit_bio_start_t typedef. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
2022-12-05btrfs: drop parameter compression_type from btrfs_submit_dio_repair_bioDavid Sterba3-7/+3
Compression and direct io don't work together so the compression parameter can be dropped after previous patch that changed the call to direct. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>