@@ -774,11 +774,12 @@ static int iomap_write_begin_inline(const struct iomap_iter *iter,
774
774
return iomap_read_inline_data (iter , folio );
775
775
}
776
776
777
- static int iomap_write_begin (struct iomap_iter * iter , loff_t pos ,
778
- size_t len , struct folio * * foliop )
777
+ static int iomap_write_begin (struct iomap_iter * iter , size_t len ,
778
+ struct folio * * foliop )
779
779
{
780
780
const struct iomap_folio_ops * folio_ops = iter -> iomap .folio_ops ;
781
781
const struct iomap * srcmap = iomap_iter_srcmap (iter );
782
+ loff_t pos = iter -> pos ;
782
783
struct folio * folio ;
783
784
int status = 0 ;
784
785
@@ -883,10 +884,11 @@ static void iomap_write_end_inline(const struct iomap_iter *iter,
883
884
* Returns true if all copied bytes have been written to the pagecache,
884
885
* otherwise return false.
885
886
*/
886
- static bool iomap_write_end (struct iomap_iter * iter , loff_t pos , size_t len ,
887
- size_t copied , struct folio * folio )
887
+ static bool iomap_write_end (struct iomap_iter * iter , size_t len , size_t copied ,
888
+ struct folio * folio )
888
889
{
889
890
const struct iomap * srcmap = iomap_iter_srcmap (iter );
891
+ loff_t pos = iter -> pos ;
890
892
891
893
if (srcmap -> type == IOMAP_INLINE ) {
892
894
iomap_write_end_inline (iter , folio , pos , copied );
@@ -949,7 +951,7 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
949
951
break ;
950
952
}
951
953
952
- status = iomap_write_begin (iter , iter -> pos , bytes , & folio );
954
+ status = iomap_write_begin (iter , bytes , & folio );
953
955
if (unlikely (status )) {
954
956
iomap_write_failed (iter -> inode , iter -> pos , bytes );
955
957
break ;
@@ -966,7 +968,7 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
966
968
flush_dcache_folio (folio );
967
969
968
970
copied = copy_folio_from_iter_atomic (folio , offset , bytes , i );
969
- written = iomap_write_end (iter , pos , bytes , copied , folio ) ?
971
+ written = iomap_write_end (iter , bytes , copied , folio ) ?
970
972
copied : 0 ;
971
973
972
974
/*
@@ -1281,7 +1283,7 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
1281
1283
bool ret ;
1282
1284
1283
1285
bytes = min_t (u64 , SIZE_MAX , bytes );
1284
- status = iomap_write_begin (iter , iter -> pos , bytes , & folio );
1286
+ status = iomap_write_begin (iter , bytes , & folio );
1285
1287
if (unlikely (status ))
1286
1288
return status ;
1287
1289
if (iomap -> flags & IOMAP_F_STALE )
@@ -1292,7 +1294,7 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
1292
1294
if (bytes > folio_size (folio ) - offset )
1293
1295
bytes = folio_size (folio ) - offset ;
1294
1296
1295
- ret = iomap_write_end (iter , pos , bytes , bytes , folio );
1297
+ ret = iomap_write_end (iter , bytes , bytes , folio );
1296
1298
__iomap_put_folio (iter , pos , bytes , folio );
1297
1299
if (WARN_ON_ONCE (!ret ))
1298
1300
return - EIO ;
@@ -1357,7 +1359,7 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
1357
1359
bool ret ;
1358
1360
1359
1361
bytes = min_t (u64 , SIZE_MAX , bytes );
1360
- status = iomap_write_begin (iter , iter -> pos , bytes , & folio );
1362
+ status = iomap_write_begin (iter , bytes , & folio );
1361
1363
if (status )
1362
1364
return status ;
1363
1365
if (iter -> iomap .flags & IOMAP_F_STALE )
@@ -1373,7 +1375,7 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
1373
1375
folio_zero_range (folio , offset , bytes );
1374
1376
folio_mark_accessed (folio );
1375
1377
1376
- ret = iomap_write_end (iter , pos , bytes , bytes , folio );
1378
+ ret = iomap_write_end (iter , bytes , bytes , folio );
1377
1379
__iomap_put_folio (iter , pos , bytes , folio );
1378
1380
if (WARN_ON_ONCE (!ret ))
1379
1381
return - EIO ;
0 commit comments