Commit e0eadfc
btrfs: raid56: prepare verify_one_sector() to support bs > ps cases
The function verify_one_sector() assume each fs block can be mapped by
one page, blocking bs > ps support for raid56.
Prepare it for bs > ps cases by:
- Introduce helpers to get a paddrs pointer
Thankfully all the higher layer bio should still be aligned to fs
block size, thus a fs block should still be fully covered by the bio.
Introduce sector_paddrs_in_rbio() and rbio_stripe_paddrs(), which will
return a paddrs pointer inside btrfs_raid_bio::bio_paddrs[] or
stripe_paddrs[].
The pointer can be directly passed to
btrfs_calculate_block_csum_pages() to verify the checksum.
- Open code btrfs_check_block_csum()
btrfs_check_block_csum() only supports fs blocks backed by large
folios.
But for raid56 we can have fs blocks backed by multiple non-contiguous
pages, e.g. direct IO, encoded read/write/send.
So instead of using btrfs_check_block_csum(), open code it to use
btrfs_calculate_block_csum_pages().
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 9ba67fd commit e0eadfc
1 file changed
Lines changed: 49 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
735 | 742 | | |
736 | 743 | | |
737 | 744 | | |
| |||
1003 | 1010 | | |
1004 | 1011 | | |
1005 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1006 | 1048 | | |
1007 | 1049 | | |
1008 | 1050 | | |
| |||
1832 | 1874 | | |
1833 | 1875 | | |
1834 | 1876 | | |
1835 | | - | |
| 1877 | + | |
1836 | 1878 | | |
1837 | 1879 | | |
1838 | | - | |
1839 | 1880 | | |
1840 | 1881 | | |
1841 | 1882 | | |
| |||
1848 | 1889 | | |
1849 | 1890 | | |
1850 | 1891 | | |
1851 | | - | |
| 1892 | + | |
1852 | 1893 | | |
1853 | | - | |
| 1894 | + | |
1854 | 1895 | | |
1855 | 1896 | | |
1856 | 1897 | | |
1857 | 1898 | | |
1858 | 1899 | | |
1859 | | - | |
1860 | | - | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
1861 | 1904 | | |
1862 | 1905 | | |
1863 | 1906 | | |
| |||
0 commit comments