@@ -741,21 +741,22 @@ static int __iomap_write_begin(const struct iomap_iter *iter, loff_t pos,
741
741
return 0 ;
742
742
}
743
743
744
- static struct folio * __iomap_get_folio (struct iomap_iter * iter , loff_t pos ,
745
- size_t len )
744
+ static struct folio * __iomap_get_folio (struct iomap_iter * iter , size_t len )
746
745
{
747
746
const struct iomap_folio_ops * folio_ops = iter -> iomap .folio_ops ;
747
+ loff_t pos = iter -> pos ;
748
748
749
749
if (folio_ops && folio_ops -> get_folio )
750
750
return folio_ops -> get_folio (iter , pos , len );
751
751
else
752
752
return iomap_get_folio (iter , pos , len );
753
753
}
754
754
755
- static void __iomap_put_folio (struct iomap_iter * iter , loff_t pos , size_t ret ,
755
+ static void __iomap_put_folio (struct iomap_iter * iter , size_t ret ,
756
756
struct folio * folio )
757
757
{
758
758
const struct iomap_folio_ops * folio_ops = iter -> iomap .folio_ops ;
759
+ loff_t pos = iter -> pos ;
759
760
760
761
if (folio_ops && folio_ops -> put_folio ) {
761
762
folio_ops -> put_folio (iter -> inode , pos , ret , folio );
@@ -793,7 +794,7 @@ static int iomap_write_begin(struct iomap_iter *iter, size_t len,
793
794
if (!mapping_large_folio_support (iter -> inode -> i_mapping ))
794
795
len = min_t (size_t , len , PAGE_SIZE - offset_in_page (pos ));
795
796
796
- folio = __iomap_get_folio (iter , pos , len );
797
+ folio = __iomap_get_folio (iter , len );
797
798
if (IS_ERR (folio ))
798
799
return PTR_ERR (folio );
799
800
@@ -834,7 +835,7 @@ static int iomap_write_begin(struct iomap_iter *iter, size_t len,
834
835
return 0 ;
835
836
836
837
out_unlock :
837
- __iomap_put_folio (iter , pos , 0 , folio );
838
+ __iomap_put_folio (iter , 0 , folio );
838
839
839
840
return status ;
840
841
}
@@ -983,7 +984,7 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
983
984
i_size_write (iter -> inode , pos + written );
984
985
iter -> iomap .flags |= IOMAP_F_SIZE_CHANGED ;
985
986
}
986
- __iomap_put_folio (iter , pos , written , folio );
987
+ __iomap_put_folio (iter , written , folio );
987
988
988
989
if (old_size < pos )
989
990
pagecache_isize_extended (iter -> inode , old_size , pos );
@@ -1295,7 +1296,7 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
1295
1296
bytes = folio_size (folio ) - offset ;
1296
1297
1297
1298
ret = iomap_write_end (iter , bytes , bytes , folio );
1298
- __iomap_put_folio (iter , pos , bytes , folio );
1299
+ __iomap_put_folio (iter , bytes , folio );
1299
1300
if (WARN_ON_ONCE (!ret ))
1300
1301
return - EIO ;
1301
1302
@@ -1376,7 +1377,7 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
1376
1377
folio_mark_accessed (folio );
1377
1378
1378
1379
ret = iomap_write_end (iter , bytes , bytes , folio );
1379
- __iomap_put_folio (iter , pos , bytes , folio );
1380
+ __iomap_put_folio (iter , bytes , folio );
1380
1381
if (WARN_ON_ONCE (!ret ))
1381
1382
return - EIO ;
1382
1383
0 commit comments