@@ -1048,7 +1048,7 @@ EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
1048
1048
1049
1049
static int iomap_write_delalloc_ifs_punch (struct inode * inode ,
1050
1050
struct folio * folio , loff_t start_byte , loff_t end_byte ,
1051
- iomap_punch_t punch )
1051
+ struct iomap * iomap , iomap_punch_t punch )
1052
1052
{
1053
1053
unsigned int first_blk , last_blk , i ;
1054
1054
loff_t last_byte ;
@@ -1073,7 +1073,7 @@ static int iomap_write_delalloc_ifs_punch(struct inode *inode,
1073
1073
for (i = first_blk ; i <= last_blk ; i ++ ) {
1074
1074
if (!ifs_block_is_dirty (folio , ifs , i )) {
1075
1075
ret = punch (inode , folio_pos (folio ) + (i << blkbits ),
1076
- 1 << blkbits );
1076
+ 1 << blkbits , iomap );
1077
1077
if (ret )
1078
1078
return ret ;
1079
1079
}
@@ -1085,7 +1085,7 @@ static int iomap_write_delalloc_ifs_punch(struct inode *inode,
1085
1085
1086
1086
static int iomap_write_delalloc_punch (struct inode * inode , struct folio * folio ,
1087
1087
loff_t * punch_start_byte , loff_t start_byte , loff_t end_byte ,
1088
- iomap_punch_t punch )
1088
+ struct iomap * iomap , iomap_punch_t punch )
1089
1089
{
1090
1090
int ret = 0 ;
1091
1091
@@ -1095,14 +1095,14 @@ static int iomap_write_delalloc_punch(struct inode *inode, struct folio *folio,
1095
1095
/* if dirty, punch up to offset */
1096
1096
if (start_byte > * punch_start_byte ) {
1097
1097
ret = punch (inode , * punch_start_byte ,
1098
- start_byte - * punch_start_byte );
1098
+ start_byte - * punch_start_byte , iomap );
1099
1099
if (ret )
1100
1100
return ret ;
1101
1101
}
1102
1102
1103
1103
/* Punch non-dirty blocks within folio */
1104
- ret = iomap_write_delalloc_ifs_punch (inode , folio , start_byte ,
1105
- end_byte , punch );
1104
+ ret = iomap_write_delalloc_ifs_punch (inode , folio , start_byte , end_byte ,
1105
+ iomap , punch );
1106
1106
if (ret )
1107
1107
return ret ;
1108
1108
@@ -1135,7 +1135,7 @@ static int iomap_write_delalloc_punch(struct inode *inode, struct folio *folio,
1135
1135
*/
1136
1136
static int iomap_write_delalloc_scan (struct inode * inode ,
1137
1137
loff_t * punch_start_byte , loff_t start_byte , loff_t end_byte ,
1138
- iomap_punch_t punch )
1138
+ struct iomap * iomap , iomap_punch_t punch )
1139
1139
{
1140
1140
while (start_byte < end_byte ) {
1141
1141
struct folio * folio ;
@@ -1151,7 +1151,7 @@ static int iomap_write_delalloc_scan(struct inode *inode,
1151
1151
}
1152
1152
1153
1153
ret = iomap_write_delalloc_punch (inode , folio , punch_start_byte ,
1154
- start_byte , end_byte , punch );
1154
+ start_byte , end_byte , iomap , punch );
1155
1155
if (ret ) {
1156
1156
folio_unlock (folio );
1157
1157
folio_put (folio );
@@ -1200,7 +1200,8 @@ static int iomap_write_delalloc_scan(struct inode *inode,
1200
1200
* the code to subtle off-by-one bugs....
1201
1201
*/
1202
1202
static int iomap_write_delalloc_release (struct inode * inode , loff_t start_byte ,
1203
- loff_t end_byte , unsigned flags , iomap_punch_t punch )
1203
+ loff_t end_byte , unsigned flags , struct iomap * iomap ,
1204
+ iomap_punch_t punch )
1204
1205
{
1205
1206
loff_t punch_start_byte = start_byte ;
1206
1207
loff_t scan_end_byte = min (i_size_read (inode ), end_byte );
@@ -1253,7 +1254,7 @@ static int iomap_write_delalloc_release(struct inode *inode, loff_t start_byte,
1253
1254
WARN_ON_ONCE (data_end > scan_end_byte );
1254
1255
1255
1256
error = iomap_write_delalloc_scan (inode , & punch_start_byte ,
1256
- start_byte , data_end , punch );
1257
+ start_byte , data_end , iomap , punch );
1257
1258
if (error )
1258
1259
goto out_unlock ;
1259
1260
@@ -1263,7 +1264,7 @@ static int iomap_write_delalloc_release(struct inode *inode, loff_t start_byte,
1263
1264
1264
1265
if (punch_start_byte < end_byte )
1265
1266
error = punch (inode , punch_start_byte ,
1266
- end_byte - punch_start_byte );
1267
+ end_byte - punch_start_byte , iomap );
1267
1268
out_unlock :
1268
1269
filemap_invalidate_unlock (inode -> i_mapping );
1269
1270
return error ;
@@ -1330,7 +1331,7 @@ int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
1330
1331
return 0 ;
1331
1332
1332
1333
return iomap_write_delalloc_release (inode , start_byte , end_byte , flags ,
1333
- punch );
1334
+ iomap , punch );
1334
1335
}
1335
1336
EXPORT_SYMBOL_GPL (iomap_file_buffered_write_punch_delalloc );
1336
1337
0 commit comments