aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2011-12-25 10:46:46 -0500
committerJens Axboe <axboe@kernel.dk>2011-12-25 10:46:46 -0500
commitf748040bb875a0d94c3ceef180ab704bdf43079f (patch)
treeb4f91bfaafc1e714e5ff95782b6fe4081a6c7e49 /include/xen
parentfd63836811d6e5b5f5f608abf865bc9e91762c8c (diff)
parentf094148a1751d6ece9374851eb2926bc3cfd16ef (diff)
Merge branch 'stable/for-jens-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-3.3/drivers
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/interface/io/blkif.h40
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
97struct blkif_request_rw { 112struct 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
107struct blkif_request_discard { 128struct 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
112struct blkif_request { 141struct 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
123struct blkif_response { 149struct blkif_response {
124 uint64_t id; /* copied from request */ 150 uint64_t id; /* copied from request */