Commit 51ea66c
committed
xfs: use byte ranges for write cleanup ranges
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2155605
Tested: With xfstests and bz reproducer
xfs_buffered_write_iomap_end() currently converts the byte ranges
passed to it to filesystem blocks to pass them to the bmap code to
punch out delalloc blocks, but then has to convert filesytem
blocks back to byte ranges for page cache truncate.
We're about to make the page cache truncate go away and replace it
with a page cache walk, so having to convert everything to/from/to
filesystem blocks is messy and error-prone. It is much easier to
pass around byte ranges and convert to page indexes and/or
filesystem blocks only where those units are needed.
In preparation for the page cache walk being added, add a helper
that converts byte ranges to filesystem blocks and calls
xfs_bmap_punch_delalloc_range() and convert
xfs_buffered_write_iomap_end() to calculate limits in byte ranges.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
(cherry picked from commit b71f889)
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>1 parent 0ff4cae commit 51ea66c
1 file changed
+25
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
1078 | 1092 | | |
1079 | 1093 | | |
1080 | 1094 | | |
| |||
1084 | 1098 | | |
1085 | 1099 | | |
1086 | 1100 | | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1091 | 1104 | | |
1092 | 1105 | | |
1093 | 1106 | | |
| |||
1112 | 1125 | | |
1113 | 1126 | | |
1114 | 1127 | | |
1115 | | - | |
| 1128 | + | |
1116 | 1129 | | |
1117 | | - | |
1118 | | - | |
| 1130 | + | |
| 1131 | + | |
1119 | 1132 | | |
1120 | 1133 | | |
1121 | | - | |
| 1134 | + | |
1122 | 1135 | | |
1123 | 1136 | | |
1124 | 1137 | | |
| |||
1128 | 1141 | | |
1129 | 1142 | | |
1130 | 1143 | | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
| 1144 | + | |
| 1145 | + | |
1136 | 1146 | | |
1137 | 1147 | | |
1138 | | - | |
1139 | | - | |
| 1148 | + | |
| 1149 | + | |
1140 | 1150 | | |
1141 | 1151 | | |
1142 | 1152 | | |
| |||
0 commit comments