WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH V3 3/3] xen-blkback: handle trim request in backe

To: Li Dongyang <lidongyang@xxxxxxxxxx>, keir@xxxxxxx
Subject: Re: [Xen-devel] [PATCH V3 3/3] xen-blkback: handle trim request in backend driver
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Fri, 26 Aug 2011 13:18:03 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, owen.smith@xxxxxxxxxx, JBeulich@xxxxxxxxxx
Delivery-date: Fri, 26 Aug 2011 10:19:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1314177825-22360-4-git-send-email-lidongyang@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1314177825-22360-1-git-send-email-lidongyang@xxxxxxxxxx> <1314177825-22360-4-git-send-email-lidongyang@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
> +static void xen_blk_trim(struct xen_blkif *blkif, struct blkif_request *req)

Just call it discard: s/trim/discard/ through all the patches.

Also make sure you do that for the functions. And for the 'tr' - change it to
'discard' maybe?

.. snip..
> +int xen_blkbk_trim(struct xenbus_transaction xbt, struct backend_info *be)

Call it discard.

.. snip ..
> +     err = xenbus_printf(xbt, dev->nodename, "feature-trim",

>From one hand it would be really nice to call this 'feature-discard'
but the Citrix frontends (and perhaps the SuSE ones too?) expect
it as 'feature-trim'. Maybe we should just call it 'feature-discard'
here and add a backwards compatible patch that will call it
'feature-trim'?

Sadly, the 'feature-trim' has been enumareted in the blkif.h so it
kind of is written in stone.

Keir, what is your feeling on this?

Can we change the name to 'feature-discard'?


> +                         "%d", state);
> +     if (err)
> +             xenbus_dev_fatal(dev, err, "writing feature-trim");
> +kfree:
> +     kfree(type);
> +out:
> +     return err;
> +}
> +
>  /*
>   * Entry point to this code when a new device is created.  Allocate the basic
>   * structures, and watch the store waiting for the hotplug scripts to tell us
> @@ -650,6 +708,10 @@ again:
>       if (err)
>               goto abort;
>  
> +     err = xen_blkbk_trim(xbt, be);
> +     if (err)
> +             goto abort;
> +

No need really. We don't need to abort b/c we can't establish discard
support.

>       err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
>                           (unsigned long long)vbd_sz(&be->blkif->vbd));
>       if (err) {
> -- 
> 1.7.6
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

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

<Prev in Thread] Current Thread [Next in Thread>