mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 14:44:10 +08:00
target: use bvec_set_page to initialize bvecs
Use the bvec_set_page helper to initialize bvecs. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20230203150634.3199647-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
f1e117cbb0
commit
3c7ebe952f
@ -281,10 +281,8 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
|
||||
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
|
||||
|
||||
for_each_sg(sgl, sg, sgl_nents, i) {
|
||||
aio_cmd->bvecs[i].bv_page = sg_page(sg);
|
||||
aio_cmd->bvecs[i].bv_len = sg->length;
|
||||
aio_cmd->bvecs[i].bv_offset = sg->offset;
|
||||
|
||||
bvec_set_page(&aio_cmd->bvecs[i], sg_page(sg), sg->length,
|
||||
sg->offset);
|
||||
len += sg->length;
|
||||
}
|
||||
|
||||
@ -329,10 +327,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd,
|
||||
}
|
||||
|
||||
for_each_sg(sgl, sg, sgl_nents, i) {
|
||||
bvec[i].bv_page = sg_page(sg);
|
||||
bvec[i].bv_len = sg->length;
|
||||
bvec[i].bv_offset = sg->offset;
|
||||
|
||||
bvec_set_page(&bvec[i], sg_page(sg), sg->length, sg->offset);
|
||||
len += sg->length;
|
||||
}
|
||||
|
||||
@ -465,10 +460,9 @@ fd_execute_write_same(struct se_cmd *cmd)
|
||||
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
|
||||
|
||||
for (i = 0; i < nolb; i++) {
|
||||
bvec[i].bv_page = sg_page(&cmd->t_data_sg[0]);
|
||||
bvec[i].bv_len = cmd->t_data_sg[0].length;
|
||||
bvec[i].bv_offset = cmd->t_data_sg[0].offset;
|
||||
|
||||
bvec_set_page(&bvec[i], sg_page(&cmd->t_data_sg[0]),
|
||||
cmd->t_data_sg[0].length,
|
||||
cmd->t_data_sg[0].offset);
|
||||
len += se_dev->dev_attrib.block_size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user