From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH V3 1/3] xen-blkback: add BLKIF_OP_TRIM and backend types Date: Thu, 25 Aug 2011 08:00:46 +0100 Message-ID: <4E560F3E020000780005324C@nat28.tlf.novell.com> References: <1314177825-22360-1-git-send-email-lidongyang@novell.com> <1314177825-22360-2-git-send-email-lidongyang@novell.com> <4E54EE080200007800052DEC@victor.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dong Yang Li Cc: xen-devel@lists.xensource.com, owen.smith@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 25.08.11 at 08:34, Li Dongyang wrote: > On Wed, Aug 24, 2011 at 6:26 PM, Jan Beulich = wrote: >>>>> On 24.08.11 at 11:23, Li Dongyang wrote: >>> This adds the BLKIF_OP_TRIM for blkfront and blkback, also 2 enums = telling >>> us the type of the backend, used in blkback to determine what to do = when we >>> see a trim request. >>> The BLKIF_OP_TRIM part is just taken from Owen Smith, Thanks >>> >>> Signed-off-by: Owen Smith >>> Signed-off-by: Li Dongyang >>> --- >>> drivers/block/xen-blkback/common.h | 10 +++++++++- >>> include/xen/interface/io/blkif.h | 19 +++++++++++++++++++ >>> 2 files changed, 28 insertions(+), 1 deletions(-) >>> >>> diff --git a/drivers/block/xen-blkback/common.h >>> b/drivers/block/xen-blkback/common.h >>> index 9e40b28..146d325 100644 >>> --- a/drivers/block/xen-blkback/common.h >>> +++ b/drivers/block/xen-blkback/common.h >>> @@ -113,6 +113,11 @@ enum blkif_protocol { >>> BLKIF_PROTOCOL_X86_64 =3D 3, >>> }; >>> >>> +enum blkif_backend_type { >>> + BLKIF_BACKEND_PHY =3D 1, >>> + BLKIF_BACKEND_FILE =3D 2, >>> +}; >>> + >>> struct xen_vbd { >>> /* What the domain refers to this vbd as. */ >>> blkif_vdev_t handle; >>> @@ -138,6 +143,7 @@ struct xen_blkif { >>> unsigned int irq; >>> /* Comms information. */ >>> enum blkif_protocol blk_protocol; >>> + enum blkif_backend_type blk_backend_type; >>> union blkif_back_rings blk_rings; >>> struct vm_struct *blk_ring_area; >>> /* The VBD attached to this interface. */ >>> @@ -159,8 +165,10 @@ struct xen_blkif { >>> int st_wr_req; >>> int st_oo_req; >>> int st_f_req; >>> + int st_tr_req; >>> int st_rd_sect; >>> int st_wr_sect; >>> + int st_tr_sect; >> >> Just to repeat - I don't think this piece of statistic is very useful, = the >> more that you use "int" here while ... >> >>> >>> wait_queue_head_t waiting_to_free; >>> >>> @@ -182,7 +190,7 @@ struct xen_blkif { >>> >>> struct phys_req { >>> unsigned short dev; >>> - unsigned short nr_sects; >>> + blkif_sector_t nr_sects; >> >> ... you specifically widen the field to 64 bits here. >> > sounds reasonable, gonna kill the stat stuff I didn't mean to say kill it all - the st_tr_req is quite reasonable to have (in line with st_f_req). Jan