mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
iomap: drop unnecessary pos param from iomap_write_[begin|end]
iomap_write_begin() and iomap_write_end() both take the iter and iter->pos as parameters. Drop the unnecessary pos parameter and sample iter->pos within each function. Signed-off-by: Brian Foster <bfoster@redhat.com> Link: https://lore.kernel.org/20250506134118.911396-3-bfoster@redhat.com Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
e356c5d5b1
commit
99fe6e61fd
|
|
@ -774,11 +774,12 @@ static int iomap_write_begin_inline(const struct iomap_iter *iter,
|
|||
return iomap_read_inline_data(iter, folio);
|
||||
}
|
||||
|
||||
static int iomap_write_begin(struct iomap_iter *iter, loff_t pos,
|
||||
size_t len, struct folio **foliop)
|
||||
static int iomap_write_begin(struct iomap_iter *iter, size_t len,
|
||||
struct folio **foliop)
|
||||
{
|
||||
const struct iomap_folio_ops *folio_ops = iter->iomap.folio_ops;
|
||||
const struct iomap *srcmap = iomap_iter_srcmap(iter);
|
||||
loff_t pos = iter->pos;
|
||||
struct folio *folio;
|
||||
int status = 0;
|
||||
|
||||
|
|
@ -883,10 +884,11 @@ static void iomap_write_end_inline(const struct iomap_iter *iter,
|
|||
* Returns true if all copied bytes have been written to the pagecache,
|
||||
* otherwise return false.
|
||||
*/
|
||||
static bool iomap_write_end(struct iomap_iter *iter, loff_t pos, size_t len,
|
||||
size_t copied, struct folio *folio)
|
||||
static bool iomap_write_end(struct iomap_iter *iter, size_t len, size_t copied,
|
||||
struct folio *folio)
|
||||
{
|
||||
const struct iomap *srcmap = iomap_iter_srcmap(iter);
|
||||
loff_t pos = iter->pos;
|
||||
|
||||
if (srcmap->type == IOMAP_INLINE) {
|
||||
iomap_write_end_inline(iter, folio, pos, copied);
|
||||
|
|
@ -949,7 +951,7 @@ retry:
|
|||
break;
|
||||
}
|
||||
|
||||
status = iomap_write_begin(iter, iter->pos, bytes, &folio);
|
||||
status = iomap_write_begin(iter, bytes, &folio);
|
||||
if (unlikely(status)) {
|
||||
iomap_write_failed(iter->inode, iter->pos, bytes);
|
||||
break;
|
||||
|
|
@ -966,7 +968,7 @@ retry:
|
|||
flush_dcache_folio(folio);
|
||||
|
||||
copied = copy_folio_from_iter_atomic(folio, offset, bytes, i);
|
||||
written = iomap_write_end(iter, pos, bytes, copied, folio) ?
|
||||
written = iomap_write_end(iter, bytes, copied, folio) ?
|
||||
copied : 0;
|
||||
|
||||
/*
|
||||
|
|
@ -1281,7 +1283,7 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
|
|||
bool ret;
|
||||
|
||||
bytes = min_t(u64, SIZE_MAX, bytes);
|
||||
status = iomap_write_begin(iter, iter->pos, bytes, &folio);
|
||||
status = iomap_write_begin(iter, bytes, &folio);
|
||||
if (unlikely(status))
|
||||
return status;
|
||||
if (iomap->flags & IOMAP_F_STALE)
|
||||
|
|
@ -1292,7 +1294,7 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
|
|||
if (bytes > folio_size(folio) - offset)
|
||||
bytes = folio_size(folio) - offset;
|
||||
|
||||
ret = iomap_write_end(iter, pos, bytes, bytes, folio);
|
||||
ret = iomap_write_end(iter, bytes, bytes, folio);
|
||||
__iomap_put_folio(iter, pos, bytes, folio);
|
||||
if (WARN_ON_ONCE(!ret))
|
||||
return -EIO;
|
||||
|
|
@ -1357,7 +1359,7 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
|
|||
bool ret;
|
||||
|
||||
bytes = min_t(u64, SIZE_MAX, bytes);
|
||||
status = iomap_write_begin(iter, iter->pos, bytes, &folio);
|
||||
status = iomap_write_begin(iter, bytes, &folio);
|
||||
if (status)
|
||||
return status;
|
||||
if (iter->iomap.flags & IOMAP_F_STALE)
|
||||
|
|
@ -1373,7 +1375,7 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
|
|||
folio_zero_range(folio, offset, bytes);
|
||||
folio_mark_accessed(folio);
|
||||
|
||||
ret = iomap_write_end(iter, pos, bytes, bytes, folio);
|
||||
ret = iomap_write_end(iter, bytes, bytes, folio);
|
||||
__iomap_put_folio(iter, pos, bytes, folio);
|
||||
if (WARN_ON_ONCE(!ret))
|
||||
return -EIO;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user