diff options
author | tangwenji <tang.wenji@zte.com.cn> | 2017-11-28 13:40:27 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2018-01-12 18:07:10 -0500 |
commit | 26d2b3106f6015b1d19ae5f8b0cc1fc7fe8e669e (patch) | |
tree | b13c00c0549d3129c4f2ddade23c2f764a148d69 /drivers/target | |
parent | 094bb5d766cfcdae47e332c6d6713c7029241be1 (diff) |
tcmu: fix page addr in tcmu_flush_dcache_range
The page addr should be update.
Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_user.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index a415d87f22d2..6bcaa8b5684c 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
@@ -455,12 +455,13 @@ static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd) | |||
455 | static inline void tcmu_flush_dcache_range(void *vaddr, size_t size) | 455 | static inline void tcmu_flush_dcache_range(void *vaddr, size_t size) |
456 | { | 456 | { |
457 | unsigned long offset = offset_in_page(vaddr); | 457 | unsigned long offset = offset_in_page(vaddr); |
458 | void *start = vaddr - offset; | ||
458 | 459 | ||
459 | size = round_up(size+offset, PAGE_SIZE); | 460 | size = round_up(size+offset, PAGE_SIZE); |
460 | vaddr -= offset; | ||
461 | 461 | ||
462 | while (size) { | 462 | while (size) { |
463 | flush_dcache_page(virt_to_page(vaddr)); | 463 | flush_dcache_page(virt_to_page(start)); |
464 | start += PAGE_SIZE; | ||
464 | size -= PAGE_SIZE; | 465 | size -= PAGE_SIZE; |
465 | } | 466 | } |
466 | } | 467 | } |