diff options
author | Christoph Hellwig <hch@lst.de> | 2023-02-03 16:06:22 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-03 16:20:55 +0100 |
commit | a8173be1863e57393edb5c158860ec43a1f21ed7 (patch) | |
tree | 2ad4d446f390f28ec7ff20f7d3ae1bd45c237780 /fs/afs | |
parent | zram: use bvec_set_page to initialize bvecs (diff) | |
download | linux-a8173be1863e57393edb5c158860ec43a1f21ed7.tar.xz linux-a8173be1863e57393edb5c158860ec43a1f21ed7.zip |
afs: use bvec_set_folio to initialize a bvec
Use the bvec_set_folio helper to initialize a bvec.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-12-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/write.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c index 19df10d63323..2d17891b618e 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -992,7 +992,7 @@ int afs_launder_folio(struct folio *folio) { struct afs_vnode *vnode = AFS_FS_I(folio_inode(folio)); struct iov_iter iter; - struct bio_vec bv[1]; + struct bio_vec bv; unsigned long priv; unsigned int f, t; int ret = 0; @@ -1008,10 +1008,8 @@ int afs_launder_folio(struct folio *folio) t = afs_folio_dirty_to(folio, priv); } - bv[0].bv_page = &folio->page; - bv[0].bv_offset = f; - bv[0].bv_len = t - f; - iov_iter_bvec(&iter, ITER_SOURCE, bv, 1, bv[0].bv_len); + bvec_set_folio(&bv, folio, t - f, f); + iov_iter_bvec(&iter, ITER_SOURCE, &bv, 1, bv.bv_len); trace_afs_folio_dirty(vnode, tracepoint_string("launder"), folio); ret = afs_store_data(vnode, &iter, folio_pos(folio) + f, true); |