Skip to content

Commit 3ceb65b

Browse files
Brian Fosterbrauner
authored andcommitted
iomap: drop pos param from __iomap_[get|put]_folio()
Both helpers take the iter and pos as parameters. All callers effectively pass iter->pos, so drop the unnecessary pos parameter. Signed-off-by: Brian Foster <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: "Darrick J. Wong" <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 99fe6e6 commit 3ceb65b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

fs/iomap/buffered-io.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -741,21 +741,22 @@ static int __iomap_write_begin(const struct iomap_iter *iter, loff_t pos,
741741
return 0;
742742
}
743743

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)
746745
{
747746
const struct iomap_folio_ops *folio_ops = iter->iomap.folio_ops;
747+
loff_t pos = iter->pos;
748748

749749
if (folio_ops && folio_ops->get_folio)
750750
return folio_ops->get_folio(iter, pos, len);
751751
else
752752
return iomap_get_folio(iter, pos, len);
753753
}
754754

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,
756756
struct folio *folio)
757757
{
758758
const struct iomap_folio_ops *folio_ops = iter->iomap.folio_ops;
759+
loff_t pos = iter->pos;
759760

760761
if (folio_ops && folio_ops->put_folio) {
761762
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,
793794
if (!mapping_large_folio_support(iter->inode->i_mapping))
794795
len = min_t(size_t, len, PAGE_SIZE - offset_in_page(pos));
795796

796-
folio = __iomap_get_folio(iter, pos, len);
797+
folio = __iomap_get_folio(iter, len);
797798
if (IS_ERR(folio))
798799
return PTR_ERR(folio);
799800

@@ -834,7 +835,7 @@ static int iomap_write_begin(struct iomap_iter *iter, size_t len,
834835
return 0;
835836

836837
out_unlock:
837-
__iomap_put_folio(iter, pos, 0, folio);
838+
__iomap_put_folio(iter, 0, folio);
838839

839840
return status;
840841
}
@@ -983,7 +984,7 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
983984
i_size_write(iter->inode, pos + written);
984985
iter->iomap.flags |= IOMAP_F_SIZE_CHANGED;
985986
}
986-
__iomap_put_folio(iter, pos, written, folio);
987+
__iomap_put_folio(iter, written, folio);
987988

988989
if (old_size < pos)
989990
pagecache_isize_extended(iter->inode, old_size, pos);
@@ -1295,7 +1296,7 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
12951296
bytes = folio_size(folio) - offset;
12961297

12971298
ret = iomap_write_end(iter, bytes, bytes, folio);
1298-
__iomap_put_folio(iter, pos, bytes, folio);
1299+
__iomap_put_folio(iter, bytes, folio);
12991300
if (WARN_ON_ONCE(!ret))
13001301
return -EIO;
13011302

@@ -1376,7 +1377,7 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
13761377
folio_mark_accessed(folio);
13771378

13781379
ret = iomap_write_end(iter, bytes, bytes, folio);
1379-
__iomap_put_folio(iter, pos, bytes, folio);
1380+
__iomap_put_folio(iter, bytes, folio);
13801381
if (WARN_ON_ONCE(!ret))
13811382
return -EIO;
13821383

0 commit comments

Comments
 (0)