mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block/nvme: add support for write zeros
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-id: 20190913133627.28450-2-mlevitsk@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
0e2402452f
commit
e0dd95e373
3 changed files with 90 additions and 2 deletions
|
@ -653,12 +653,29 @@ typedef struct NvmeIdNs {
|
|||
uint8_t mc;
|
||||
uint8_t dpc;
|
||||
uint8_t dps;
|
||||
uint8_t res30[98];
|
||||
|
||||
uint8_t nmic;
|
||||
uint8_t rescap;
|
||||
uint8_t fpi;
|
||||
uint8_t dlfeat;
|
||||
|
||||
uint8_t res34[94];
|
||||
NvmeLBAF lbaf[16];
|
||||
uint8_t res192[192];
|
||||
uint8_t vs[3712];
|
||||
} NvmeIdNs;
|
||||
|
||||
|
||||
/*Deallocate Logical Block Features*/
|
||||
#define NVME_ID_NS_DLFEAT_GUARD_CRC(dlfeat) ((dlfeat) & 0x10)
|
||||
#define NVME_ID_NS_DLFEAT_WRITE_ZEROES(dlfeat) ((dlfeat) & 0x08)
|
||||
|
||||
#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR(dlfeat) ((dlfeat) & 0x7)
|
||||
#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR_UNDEFINED 0
|
||||
#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR_ZEROES 1
|
||||
#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR_ONES 2
|
||||
|
||||
|
||||
#define NVME_ID_NS_NSFEAT_THIN(nsfeat) ((nsfeat & 0x1))
|
||||
#define NVME_ID_NS_FLBAS_EXTENDED(flbas) ((flbas >> 4) & 0x1)
|
||||
#define NVME_ID_NS_FLBAS_INDEX(flbas) ((flbas & 0xf))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue