diff options
author | royger <royger@FreeBSD.org> | 2015-07-21 07:22:18 +0000 |
---|---|---|
committer | royger <royger@FreeBSD.org> | 2015-07-21 07:22:18 +0000 |
commit | 0dafb147a9f694fe943d5634209b52b90a360dcc (patch) | |
tree | 729614725d8a6445e61e2f585f81298e93b7bcd5 /sys/xen | |
parent | 1266acc975217e8ef2550e592dbddc943821fcad (diff) | |
download | FreeBSD-src-0dafb147a9f694fe943d5634209b52b90a360dcc.zip FreeBSD-src-0dafb147a9f694fe943d5634209b52b90a360dcc.tar.gz |
MFC: r284296
xen-blk{front/back}: remove broken FreeBSD extensions
Approved by: re (gjb)
Diffstat (limited to 'sys/xen')
-rw-r--r-- | sys/xen/blkif.h | 8 | ||||
-rw-r--r-- | sys/xen/interface/io/blkif.h | 42 |
2 files changed, 6 insertions, 44 deletions
diff --git a/sys/xen/blkif.h b/sys/xen/blkif.h index 48b71ea..8a19d5d 100644 --- a/sys/xen/blkif.h +++ b/sys/xen/blkif.h @@ -46,7 +46,7 @@ struct blkif_x86_32_request { blkif_vdev_t handle; /* only for read/write requests */ uint64_t id; /* private guest value, echoed in resp */ blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ - struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK]; + struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; }; struct blkif_x86_32_response { uint64_t id; /* copied from request */ @@ -64,7 +64,7 @@ struct blkif_x86_64_request { blkif_vdev_t handle; /* only for read/write requests */ uint64_t __attribute__((__aligned__(8))) id; blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ - struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK]; + struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; }; struct blkif_x86_64_response { uint64_t __attribute__((__aligned__(8))) id; @@ -114,7 +114,7 @@ enum blkif_protocol { static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_request_t *src) { - int i, n = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; + int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST; dst->operation = src->operation; dst->nr_segments = src->nr_segments; dst->handle = src->handle; @@ -129,7 +129,7 @@ static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque static void inline blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_request_t *src) { - int i, n = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; + int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST; dst->operation = src->operation; dst->nr_segments = src->nr_segments; dst->handle = src->handle; diff --git a/sys/xen/interface/io/blkif.h b/sys/xen/interface/io/blkif.h index 9155662..b725776 100644 --- a/sys/xen/interface/io/blkif.h +++ b/sys/xen/interface/io/blkif.h @@ -457,21 +457,9 @@ #define BLKIF_OP_DISCARD 5 /* - * Maximum scatter/gather segments associated with a request header block. - * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE. - * NB. This could be 12 if the ring indexes weren't stored in the same page. - */ -#define BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK 11 - -/* - * Maximum scatter/gather segments associated with a segment block. - */ -#define BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK 14 - -/* * Maximum scatter/gather segments per request (header + segment blocks). */ -#define BLKIF_MAX_SEGMENTS_PER_REQUEST 255 +#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 /* * NB. first_sect and last_sect in blkif_request_segment, as well as @@ -512,22 +500,11 @@ struct blkif_request { blkif_vdev_t handle; /* only for read/write requests */ uint64_t id; /* private guest value, echoed in resp */ blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ - blkif_request_segment_t seg[BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK]; + blkif_request_segment_t seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; }; typedef struct blkif_request blkif_request_t; /* - * A segment block is a ring request structure that contains only - * segment data. - * - * sizeof(struct blkif_segment_block) <= sizeof(struct blkif_request) - */ -struct blkif_segment_block { - blkif_request_segment_t seg[BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK]; -}; -typedef struct blkif_segment_block blkif_segment_block_t; - -/* * Cast to this structure when blkif_request.operation == BLKIF_OP_DISCARD * sizeof(struct blkif_request_discard) <= sizeof(struct blkif_request) */ @@ -564,21 +541,6 @@ typedef struct blkif_response blkif_response_t; */ DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response); -/* - * Index to, and treat as a segment block, an entry in the ring. - */ -#define BLKRING_GET_SEG_BLOCK(_r, _idx) \ - (((blkif_segment_block_t *)RING_GET_REQUEST(_r, _idx))->seg) - -/* - * The number of ring request blocks required to handle an I/O - * request containing _segs segments. - */ -#define BLKIF_SEGS_TO_BLOCKS(_segs) \ - ((((_segs - BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK) \ - + (BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK - 1)) \ - / BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK) + /*header_block*/1) - #define VDISK_CDROM 0x1 #define VDISK_REMOVABLE 0x2 #define VDISK_READONLY 0x4 |