bdev/nvme: set bdev write cache flag according to NVMe capability
Change-Id: Iad307b0d1883d00b2e68bbdfaa94f05955a8314d Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
44e60dc47d
commit
c8ce161852
@ -594,7 +594,12 @@ nvme_ctrlr_initialize_blockdevs(struct spdk_nvme_ctrlr *ctrlr, int bdev_per_ns,
|
||||
bdev->disk.max_unmap_bdesc_count =
|
||||
NVME_DEFAULT_MAX_UNMAP_BDESC_COUNT;
|
||||
}
|
||||
bdev->disk.write_cache = 1;
|
||||
|
||||
bdev->disk.write_cache = 0;
|
||||
if (cdata->vwc.present) {
|
||||
/* Enable if the Volatile Write Cache exists */
|
||||
bdev->disk.write_cache = 1;
|
||||
}
|
||||
bdev->blocklen = spdk_nvme_ns_get_sector_size(ns);
|
||||
bdev->disk.blocklen = bdev->blocklen;
|
||||
bdev->disk.blockcnt = bdev->lba_end - bdev->lba_start + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user