summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorBodo Stroesser <bostroesser@gmail.com>2020-10-19 14:51:18 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-10-27 01:27:44 +0300
commitc8ed1ff88c02e55bf9fa3244624e431f4f374077 (patch)
tree443941fd57f0b4339a69dc1a2ef6ecdb3bee45e2 /fs/fuse
parentb9dd44fd79a1ed7ee8e7c7644ddbd803b6acfd9c (diff)
downloadlinux-c8ed1ff88c02e55bf9fa3244624e431f4f374077.tar.xz
scsi: target: tcmu: scatter_/gather_data_area() rework
scatter_data_area() and gather_data_area() are not easy to understand since data is copied in nested loops over sg_list and tcmu dbi list. Since sg list can contain only partly filled pages, the loop has to be prepared to handle sg pages not matching dbi pages one by one. Existing implementation uses kmap_atomic()/kunmap_atomic() due to performance reasons. But instead of using these calls strictly nested for sg and dpi pages, the code holds the mappings in an overlapping way, which indeed is a bug that would trigger on archs using highmem. The scatterlist lib contains the sg_miter_start/_next/_stop functions which can be used to simplify such complicated loops. The new code now processes the dbi list in the outer loop, while sg list is handled by the inner one. That way the code can take advantage of the sg_miter_* family calls. Calling sg_miter_stop() after the end of the inner loop enforces strict nesting of atomic kmaps. Since the nested loops in scatter_/gather_data_area were very similar, I replaced them by the new helper function tcmu_copy_data(). Link: https://lore.kernel.org/r/20201019115118.11949-1-bostroesser@gmail.com Acked-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Bodo Stroesser <bostroesser@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'fs/fuse')
0 files changed, 0 insertions, 0 deletions