dm writecache: skip writecache_wait when using pmem mode

The array bio_in_progress is only used with ssd mode. So skip
writecache_wait_for_ios in writecache_discard when pmem mode.

Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
Huaisheng Ye 2020-06-12 23:55:44 +08:00 committed by Mike Snitzer
parent 39495b12ef
commit a143e172b6
1 changed files with 4 additions and 2 deletions

View File

@ -849,8 +849,10 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_
if (likely(!e->write_in_progress)) {
if (!discarded_something) {
writecache_wait_for_ios(wc, READ);
writecache_wait_for_ios(wc, WRITE);
if (!WC_MODE_PMEM(wc)) {
writecache_wait_for_ios(wc, READ);
writecache_wait_for_ios(wc, WRITE);
}
discarded_something = true;
}
if (!writecache_entry_is_committed(wc, e))