diff options
Diffstat (limited to 'include/xen/interface/io/blkif.h')
| -rw-r--r-- | include/xen/interface/io/blkif.h | 46 | 
1 files changed, 20 insertions, 26 deletions
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 65e12099ef8..c33e1c489eb 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h @@ -86,7 +86,7 @@ typedef uint64_t blkif_sector_t;   *     Interface%20manuals/100293068c.pdf   * The backend can optionally provide three extra XenBus attributes to   * further optimize the discard functionality: - * 'discard-aligment' - Devices that support discard functionality may + * 'discard-alignment' - Devices that support discard functionality may   * internally allocate space in units that are bigger than the exported   * logical block size. The discard-alignment parameter indicates how many bytes   * the beginning of the partition is offset from the internal allocation unit's @@ -113,13 +113,13 @@ typedef uint64_t blkif_sector_t;   * it's less than the number provided by the backend. The indirect_grefs field   * in blkif_request_indirect should be filled by the frontend with the   * grant references of the pages that are holding the indirect segments. - * This pages are filled with an array of blkif_request_segment_aligned - * that hold the information about the segments. The number of indirect - * pages to use is determined by the maximum number of segments - * a indirect request contains. Every indirect page can contain a maximum - * of 512 segments (PAGE_SIZE/sizeof(blkif_request_segment_aligned)), - * so to calculate the number of indirect pages to use we have to do - * ceil(indirect_segments/512). + * These pages are filled with an array of blkif_request_segment that hold the + * information about the segments. The number of indirect pages to use is + * determined by the number of segments an indirect request contains. Every + * indirect page can contain a maximum of + * (PAGE_SIZE / sizeof(struct blkif_request_segment)) segments, so to + * calculate the number of indirect pages to use we have to do + * ceil(indirect_segments / (PAGE_SIZE / sizeof(struct blkif_request_segment))).   *   * If a backend does not recognize BLKIF_OP_INDIRECT, it should *not*   * create the "feature-max-indirect-segments" node! @@ -135,35 +135,29 @@ typedef uint64_t blkif_sector_t;  #define BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST 8 -struct blkif_request_segment_aligned { -	grant_ref_t gref;        /* reference to I/O buffer frame        */ -	/* @first_sect: first sector in frame to transfer (inclusive).   */ -	/* @last_sect: last sector in frame to transfer (inclusive).     */ -	uint8_t     first_sect, last_sect; -	uint16_t    _pad; /* padding to make it 8 bytes, so it's cache-aligned */ -} __attribute__((__packed__)); +struct blkif_request_segment { +		grant_ref_t gref;        /* reference to I/O buffer frame        */ +		/* @first_sect: first sector in frame to transfer (inclusive).   */ +		/* @last_sect: last sector in frame to transfer (inclusive).     */ +		uint8_t     first_sect, last_sect; +};  struct blkif_request_rw {  	uint8_t        nr_segments;  /* number of segments                   */  	blkif_vdev_t   handle;       /* only for read/write requests         */ -#ifdef CONFIG_X86_64 +#ifndef CONFIG_X86_32  	uint32_t       _pad1;	     /* offsetof(blkif_request,u.rw.id) == 8 */  #endif  	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 { -		grant_ref_t gref;        /* reference to I/O buffer frame        */ -		/* @first_sect: first sector in frame to transfer (inclusive).   */ -		/* @last_sect: last sector in frame to transfer (inclusive).     */ -		uint8_t     first_sect, last_sect; -	} seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; +	struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];  } __attribute__((__packed__));  struct blkif_request_discard {  	uint8_t        flag;         /* BLKIF_DISCARD_SECURE or zero.        */  #define BLKIF_DISCARD_SECURE (1<<0)  /* ignored if discard-secure=0          */  	blkif_vdev_t   _pad1;        /* only for read/write requests         */ -#ifdef CONFIG_X86_64 +#ifndef CONFIG_X86_32  	uint32_t       _pad2;        /* offsetof(blkif_req..,u.discard.id)==8*/  #endif  	uint64_t       id;           /* private guest value, echoed in resp  */ @@ -175,7 +169,7 @@ struct blkif_request_discard {  struct blkif_request_other {  	uint8_t      _pad1;  	blkif_vdev_t _pad2;        /* only for read/write requests         */ -#ifdef CONFIG_X86_64 +#ifndef CONFIG_X86_32  	uint32_t     _pad3;        /* offsetof(blkif_req..,u.other.id)==8*/  #endif  	uint64_t     id;           /* private guest value, echoed in resp  */ @@ -184,7 +178,7 @@ struct blkif_request_other {  struct blkif_request_indirect {  	uint8_t        indirect_op;  	uint16_t       nr_segments; -#ifdef CONFIG_X86_64 +#ifndef CONFIG_X86_32  	uint32_t       _pad1;        /* offsetof(blkif_...,u.indirect.id) == 8 */  #endif  	uint64_t       id; @@ -192,7 +186,7 @@ struct blkif_request_indirect {  	blkif_vdev_t   handle;  	uint16_t       _pad2;  	grant_ref_t    indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST]; -#ifdef CONFIG_X86_64 +#ifndef CONFIG_X86_32  	uint32_t      _pad3;         /* make it 64 byte aligned */  #else  	uint64_t      _pad3;         /* make it 64 byte aligned */  | 
