diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-10-12 16:23:30 -0400 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-11-18 13:28:01 -0500 |
| commit | 5ea42986694a96542644f9cae8b122d3a00c508f (patch) | |
| tree | dd74685d8cd41e39ad14e708cb6e00e0ed016fb1 /include/xen/interface | |
| parent | 97e36834f5a106459ab1b290e663a4eb6264639e (diff) | |
xen/blk[front|back]: Enhance discard support with secure erasing support.
Part of the blkdev_issue_discard(xx) operation is that it can also
issue a secure discard operation that will permanantly remove the
sectors in question. We advertise that we can support that via the
'discard-secure' attribute and on the request, if the 'secure' bit
is set, we will attempt to pass in REQ_DISCARD | REQ_SECURE.
CC: Li Dongyang <lidongyang@novell.com>
[v1: Used 'flag' instead of 'secure:1' bit]
[v2: Use 'reserved' uint8_t instead of adding a new value]
[v3: Check for nseg when mapping instead of operation]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'include/xen/interface')
| -rw-r--r-- | include/xen/interface/io/blkif.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index f88e28b6a27..ee338bfde18 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
| @@ -84,6 +84,21 @@ typedef uint64_t blkif_sector_t; | |||
| 84 | * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc | 84 | * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc |
| 85 | * http://www.seagate.com/staticfiles/support/disc/manuals/ | 85 | * http://www.seagate.com/staticfiles/support/disc/manuals/ |
| 86 | * Interface%20manuals/100293068c.pdf | 86 | * Interface%20manuals/100293068c.pdf |
| 87 | * The backend can optionally provide three extra XenBus attributes to | ||
| 88 | * further optimize the discard functionality: | ||
| 89 | * 'discard-aligment' - Devices that support discard functionality may | ||
| 90 | * internally allocate space in units that are bigger than the exported | ||
| 91 | * logical block size. The discard-alignment parameter indicates how many bytes | ||
| 92 | * the beginning of the partition is offset from the internal allocation unit's | ||
| 93 | * natural alignment. | ||
| 94 | * 'discard-granularity' - Devices that support discard functionality may | ||
| 95 | * internally allocate space using units that are bigger than the logical block | ||
| 96 | * size. The discard-granularity parameter indicates the size of the internal | ||
| 97 | * allocation unit in bytes if reported by the device. Otherwise the | ||
| 98 | * discard-granularity will be set to match the device's physical block size. | ||
| 99 | * 'discard-secure' - All copies of the discarded sectors (potentially created | ||
| 100 | * by garbage collection) must also be erased. To use this feature, the flag | ||
| 101 | * BLKIF_DISCARD_SECURE must be set in the blkif_request_trim. | ||
| 87 | */ | 102 | */ |
| 88 | #define BLKIF_OP_DISCARD 5 | 103 | #define BLKIF_OP_DISCARD 5 |
| 89 | 104 | ||
| @@ -111,7 +126,8 @@ struct blkif_request_rw { | |||
| 111 | } __attribute__((__packed__)); | 126 | } __attribute__((__packed__)); |
| 112 | 127 | ||
| 113 | struct blkif_request_discard { | 128 | struct blkif_request_discard { |
| 114 | uint8_t nr_segments; /* number of segments */ | 129 | uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ |
| 130 | #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ | ||
| 115 | blkif_vdev_t _pad1; /* only for read/write requests */ | 131 | blkif_vdev_t _pad1; /* only for read/write requests */ |
| 116 | #ifdef CONFIG_X86_64 | 132 | #ifdef CONFIG_X86_64 |
| 117 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ | 133 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ |
