diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-15 15:48:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-15 15:48:41 -0500 |
commit | 16008d641670571ff4cd750b416c7caf2d89f467 (patch) | |
tree | 6dc32821bd4576106cee50d52a90a8106a9d481f /include/xen/interface | |
parent | b3c9dd182ed3bdcdaf0e42625a35924b0497afdc (diff) | |
parent | 85a0f7b220777cd3c232fd2f079db5c4a874c4ee (diff) |
Merge branch 'for-3.3/drivers' of git://git.kernel.dk/linux-block
* 'for-3.3/drivers' of git://git.kernel.dk/linux-block:
mtip32xx: do rebuild monitoring asynchronously
xen-blkfront: Use kcalloc instead of kzalloc to allocate array
mtip32xx: uninitialized variable in mtip_quiesce_io()
mtip32xx: updates based on feedback
xen-blkback: convert hole punching to discard request on loop devices
xen/blkback: Move processing of BLKIF_OP_DISCARD from dispatch_rw_block_io
xen/blk[front|back]: Enhance discard support with secure erasing support.
xen/blk[front|back]: Squash blkif_request_rw and blkif_request_discard together
mtip32xx: update to new ->make_request() API
mtip32xx: add module.h include to avoid conflict with moduleh tree
mtip32xx: mark a few more items static
mtip32xx: ensure that all local functions are static
mtip32xx: cleanup compat ioctl handling
mtip32xx: fix warnings/errors on 32-bit compiles
block: Add driver for Micron RealSSD pcie flash cards
Diffstat (limited to 'include/xen/interface')
-rw-r--r-- | include/xen/interface/io/blkif.h | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 9324488f23f0..ee338bfde18b 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 | ||
@@ -95,6 +110,12 @@ typedef uint64_t blkif_sector_t; | |||
95 | #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 | 110 | #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 |
96 | 111 | ||
97 | struct blkif_request_rw { | 112 | struct blkif_request_rw { |
113 | uint8_t nr_segments; /* number of segments */ | ||
114 | blkif_vdev_t handle; /* only for read/write requests */ | ||
115 | #ifdef CONFIG_X86_64 | ||
116 | uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */ | ||
117 | #endif | ||
118 | uint64_t id; /* private guest value, echoed in resp */ | ||
98 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ | 119 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ |
99 | struct blkif_request_segment { | 120 | struct blkif_request_segment { |
100 | grant_ref_t gref; /* reference to I/O buffer frame */ | 121 | grant_ref_t gref; /* reference to I/O buffer frame */ |
@@ -102,23 +123,28 @@ struct blkif_request_rw { | |||
102 | /* @last_sect: last sector in frame to transfer (inclusive). */ | 123 | /* @last_sect: last sector in frame to transfer (inclusive). */ |
103 | uint8_t first_sect, last_sect; | 124 | uint8_t first_sect, last_sect; |
104 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 125 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
105 | }; | 126 | } __attribute__((__packed__)); |
106 | 127 | ||
107 | struct blkif_request_discard { | 128 | struct blkif_request_discard { |
129 | uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ | ||
130 | #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ | ||
131 | blkif_vdev_t _pad1; /* only for read/write requests */ | ||
132 | #ifdef CONFIG_X86_64 | ||
133 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ | ||
134 | #endif | ||
135 | uint64_t id; /* private guest value, echoed in resp */ | ||
108 | blkif_sector_t sector_number; | 136 | blkif_sector_t sector_number; |
109 | uint64_t nr_sectors; | 137 | uint64_t nr_sectors; |
110 | }; | 138 | uint8_t _pad3; |
139 | } __attribute__((__packed__)); | ||
111 | 140 | ||
112 | struct blkif_request { | 141 | struct blkif_request { |
113 | uint8_t operation; /* BLKIF_OP_??? */ | 142 | uint8_t operation; /* BLKIF_OP_??? */ |
114 | uint8_t nr_segments; /* number of segments */ | ||
115 | blkif_vdev_t handle; /* only for read/write requests */ | ||
116 | uint64_t id; /* private guest value, echoed in resp */ | ||
117 | union { | 143 | union { |
118 | struct blkif_request_rw rw; | 144 | struct blkif_request_rw rw; |
119 | struct blkif_request_discard discard; | 145 | struct blkif_request_discard discard; |
120 | } u; | 146 | } u; |
121 | }; | 147 | } __attribute__((__packed__)); |
122 | 148 | ||
123 | struct blkif_response { | 149 | struct blkif_response { |
124 | uint64_t id; /* copied from request */ | 150 | uint64_t id; /* copied from request */ |