@@ -1048,7 +1048,7 @@ EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
10481048
10491049static int iomap_write_delalloc_ifs_punch (struct inode * inode ,
10501050 struct folio * folio , loff_t start_byte , loff_t end_byte ,
1051- iomap_punch_t punch )
1051+ struct iomap * iomap , iomap_punch_t punch )
10521052{
10531053 unsigned int first_blk , last_blk , i ;
10541054 loff_t last_byte ;
@@ -1073,7 +1073,7 @@ static int iomap_write_delalloc_ifs_punch(struct inode *inode,
10731073 for (i = first_blk ; i <= last_blk ; i ++ ) {
10741074 if (!ifs_block_is_dirty (folio , ifs , i )) {
10751075 ret = punch (inode , folio_pos (folio ) + (i << blkbits ),
1076- 1 << blkbits );
1076+ 1 << blkbits , iomap );
10771077 if (ret )
10781078 return ret ;
10791079 }
@@ -1085,7 +1085,7 @@ static int iomap_write_delalloc_ifs_punch(struct inode *inode,
10851085
10861086static int iomap_write_delalloc_punch (struct inode * inode , struct folio * folio ,
10871087 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 )
10891089{
10901090 int ret = 0 ;
10911091
@@ -1095,14 +1095,14 @@ static int iomap_write_delalloc_punch(struct inode *inode, struct folio *folio,
10951095 /* if dirty, punch up to offset */
10961096 if (start_byte > * punch_start_byte ) {
10971097 ret = punch (inode , * punch_start_byte ,
1098- start_byte - * punch_start_byte );
1098+ start_byte - * punch_start_byte , iomap );
10991099 if (ret )
11001100 return ret ;
11011101 }
11021102
11031103 /* 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 );
11061106 if (ret )
11071107 return ret ;
11081108
@@ -1135,7 +1135,7 @@ static int iomap_write_delalloc_punch(struct inode *inode, struct folio *folio,
11351135 */
11361136static int iomap_write_delalloc_scan (struct inode * inode ,
11371137 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 )
11391139{
11401140 while (start_byte < end_byte ) {
11411141 struct folio * folio ;
@@ -1151,7 +1151,7 @@ static int iomap_write_delalloc_scan(struct inode *inode,
11511151 }
11521152
11531153 ret = iomap_write_delalloc_punch (inode , folio , punch_start_byte ,
1154- start_byte , end_byte , punch );
1154+ start_byte , end_byte , iomap , punch );
11551155 if (ret ) {
11561156 folio_unlock (folio );
11571157 folio_put (folio );
@@ -1200,7 +1200,8 @@ static int iomap_write_delalloc_scan(struct inode *inode,
12001200 * the code to subtle off-by-one bugs....
12011201 */
12021202static 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 )
12041205{
12051206 loff_t punch_start_byte = start_byte ;
12061207 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,
12531254 WARN_ON_ONCE (data_end > scan_end_byte );
12541255
12551256 error = iomap_write_delalloc_scan (inode , & punch_start_byte ,
1256- start_byte , data_end , punch );
1257+ start_byte , data_end , iomap , punch );
12571258 if (error )
12581259 goto out_unlock ;
12591260
@@ -1263,7 +1264,7 @@ static int iomap_write_delalloc_release(struct inode *inode, loff_t start_byte,
12631264
12641265 if (punch_start_byte < end_byte )
12651266 error = punch (inode , punch_start_byte ,
1266- end_byte - punch_start_byte );
1267+ end_byte - punch_start_byte , iomap );
12671268out_unlock :
12681269 filemap_invalidate_unlock (inode -> i_mapping );
12691270 return error ;
@@ -1330,7 +1331,7 @@ int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
13301331 return 0 ;
13311332
13321333 return iomap_write_delalloc_release (inode , start_byte , end_byte , flags ,
1333- punch );
1334+ iomap , punch );
13341335}
13351336EXPORT_SYMBOL_GPL (iomap_file_buffered_write_punch_delalloc );
13361337
0 commit comments