lkml.org 
[lkml]   [2014]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH v2] xen-blkfront: remove type check from blkfront_setup_discard
>>> On 13.01.14 at 11:14, Olaf Hering <olaf@aepfle.de> wrote:
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -1634,37 +1634,22 @@ blkfront_closing(struct blkfront_info *info)
>
> static void blkfront_setup_discard(struct blkfront_info *info)
> {
> - int err;
> - char *type;
> unsigned int discard_granularity;
> unsigned int discard_alignment;
> unsigned int discard_secure;
>
> - type = xenbus_read(XBT_NIL, info->xbdev->otherend, "type", NULL);
> - if (IS_ERR(type))
> + if (xenbus_gather(XBT_NIL, info->xbdev->otherend,
> + "discard-granularity", "%u", &discard_granularity,
> + "discard-alignment", "%u", &discard_alignment,
> + "discard-secure", "%u", &discard_secure,
> + NULL))
> return;

You can't do this in one go - the first two and the last one may be
set independently (and are independent in their meaning), and
hence need to be queried independently (xenbus_gather() fails
on the first absent value).

Jan



\
 
 \ /
  Last update: 2014-01-13 14:01    [W:0.879 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site