[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/5] xen/blkback: don't add m2p overrides when using autotranslated physmap



On Tue, 2011-10-18 at 21:26 +0100, Daniel De Graaf wrote:
> This is the same logic as used in grant-table.c, which blkback bypasses.

It would be better to make blkback use grant-table.c.

Ian.

> 
> Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
> ---
>  drivers/block/xen-blkback/blkback.c |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c 
> b/drivers/block/xen-blkback/blkback.c
> index a0d3cbd..d8232e7 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -336,6 +336,10 @@ static void xen_blkbk_unmap(struct pending_req *req)
>       ret = HYPERVISOR_grant_table_op(
>               GNTTABOP_unmap_grant_ref, unmap, invcount);
>       BUG_ON(ret);
> +
> +     if (xen_feature(XENFEAT_auto_translated_physmap))
> +             return;
> +
>       /*
>        * Note, we use invcount, so nr->pages, so we can't index
>        * using vaddr(req, i).
> @@ -396,6 +400,12 @@ static int xen_blkbk_map(struct blkif_request *req,
>               if (ret)
>                       continue;
>  
> +             seg[i].buf  = map[i].dev_bus_addr |
> +                     (req->u.rw.seg[i].first_sect << 9);
> +
> +             if (xen_feature(XENFEAT_auto_translated_physmap))
> +                     continue;
> +
>               ret = m2p_add_override(PFN_DOWN(map[i].dev_bus_addr),
>                       blkbk->pending_page(pending_req, i), false);
>               if (ret) {
> @@ -404,9 +414,6 @@ static int xen_blkbk_map(struct blkif_request *req,
>                       /* We could switch over to GNTTABOP_copy */
>                       continue;
>               }
> -
> -             seg[i].buf  = map[i].dev_bus_addr |
> -                     (req->u.rw.seg[i].first_sect << 9);
>       }
>       return ret;
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.