diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2025-07-09 06:46:13 +0300 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2025-07-10 12:08:26 +0300 |
commit | f5443d0d1ad775927f1473b1c256ef68f2515b9c (patch) | |
tree | 99d8407b5946c47edffe2b6f92fb76533b63faf6 | |
parent | 99f7619a77a0a2e3e2bcae676d0f301769167754 (diff) | |
download | linux-f5443d0d1ad775927f1473b1c256ef68f2515b9c.tar.xz |
erofs: use memcpy_to_folio() to replace copy_to_iter()
Using copy_to_iter() here is overkill and even messy.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250709034614.2780117-1-hsiangkao@linux.alibaba.com
-rw-r--r-- | fs/erofs/fileio.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c index df5cc63f2c01..fe2cd2982b4b 100644 --- a/fs/erofs/fileio.c +++ b/fs/erofs/fileio.c @@ -96,8 +96,6 @@ static int erofs_fileio_scan_folio(struct erofs_fileio *io, struct folio *folio) struct erofs_map_blocks *map = &io->map; unsigned int cur = 0, end = folio_size(folio), len, attached = 0; loff_t pos = folio_pos(folio), ofs; - struct iov_iter iter; - struct bio_vec bv; int err = 0; erofs_onlinefolio_init(folio); @@ -122,13 +120,7 @@ static int erofs_fileio_scan_folio(struct erofs_fileio *io, struct folio *folio) err = PTR_ERR(src); break; } - bvec_set_folio(&bv, folio, len, cur); - iov_iter_bvec(&iter, ITER_DEST, &bv, 1, len); - if (copy_to_iter(src, len, &iter) != len) { - erofs_put_metabuf(&buf); - err = -EIO; - break; - } + memcpy_to_folio(folio, cur, src, len); erofs_put_metabuf(&buf); } else if (!(map->m_flags & EROFS_MAP_MAPPED)) { folio_zero_segment(folio, cur, cur + len); |