summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2020-11-29 00:49:14 +0000
committerAlexander Motin <mav@FreeBSD.org>2020-11-29 00:49:14 +0000
commit9093e27cc15ad0935de7f3b434439730b13a3b98 (patch)
tree93004560cde8dc05c0cb5bf6246af75a67abf8d1
parenta93d2db0e733ffb6c13b9074eeb4c28c936d4229 (diff)
downloadsrc-test2-9093e27cc15ad0935de7f3b434439730b13a3b98.tar.gz
src-test2-9093e27cc15ad0935de7f3b434439730b13a3b98.zip
Notes
-rw-r--r--sys/cam/cam_periph.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index aaa9bc3eada7..92f7c33cbc75 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -783,7 +783,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo,
u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS];
u_int32_t lengths[CAM_PERIPH_MAXMAPS];
u_int32_t dirs[CAM_PERIPH_MAXMAPS];
- bool misaligned[CAM_PERIPH_MAXMAPS];
bzero(mapinfo, sizeof(*mapinfo));
if (maxmap == 0)
@@ -901,17 +900,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo,
(long)(lengths[i]), (u_long)maxmap);
return (E2BIG);
}
-
- /*
- * The userland data pointer passed in may not be page
- * aligned. vmapbuf() truncates the address to a page
- * boundary, so if the address isn't page aligned, we'll
- * need enough space for the given transfer length, plus
- * whatever extra space is necessary to make it to the page
- * boundary.
- */
- misaligned[i] = (lengths[i] +
- (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK) > maxphys);
}
/*
@@ -934,7 +922,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo,
* small allocations malloc is backed by UMA, and so much
* cheaper on SMP systems.
*/
- if ((lengths[i] <= periph_mapmem_thresh || misaligned[i]) &&
+ if (lengths[i] <= periph_mapmem_thresh &&
ccb->ccb_h.func_code != XPT_MMC_IO) {
*data_ptrs[i] = malloc(lengths[i], M_CAMPERIPH,
M_WAITOK);