diff options
author | Christoph Hellwig <hch@lst.de> | 2023-02-03 18:06:25 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-03 20:17:42 +0300 |
commit | cd598003206839ed1354902805b52c3a4f6ead2e (patch) | |
tree | cbac6c5447ebb451192f320d3775bf32eafdc49f /fs/coredump.c | |
parent | 220ae4a5c2ba10333b3b01fbf3dea0d759e77a76 (diff) | |
download | linux-cd598003206839ed1354902805b52c3a4f6ead2e.tar.xz |
coredump: use bvec_set_page to initialize a bvec
Use the bvec_set_page helper to initialize a bvec.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230203150634.3199647-15-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/coredump.c')
-rw-r--r-- | fs/coredump.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/coredump.c b/fs/coredump.c index de78bde2991b..0a6873a9c4d0 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -840,11 +840,7 @@ static int __dump_skip(struct coredump_params *cprm, size_t nr) static int dump_emit_page(struct coredump_params *cprm, struct page *page) { - struct bio_vec bvec = { - .bv_page = page, - .bv_offset = 0, - .bv_len = PAGE_SIZE, - }; + struct bio_vec bvec; struct iov_iter iter; struct file *file = cprm->file; loff_t pos; @@ -860,6 +856,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page) if (dump_interrupted()) return 0; pos = file->f_pos; + bvec_set_page(&bvec, page, PAGE_SIZE, 0); iov_iter_bvec(&iter, ITER_SOURCE, &bvec, 1, PAGE_SIZE); n = __kernel_write_iter(cprm->file, &iter, &pos); if (n != PAGE_SIZE) |