lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1359993993.11144.416.camel@bling.home>
Date:	Mon, 04 Feb 2013 09:06:33 -0700
From:	Alex Williamson <alex.williamson@...hat.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	rusty@...tcorp.com.au, bfields@...ldses.org,
	skinsbursky@...allels.com, ebiederm@...ssion.com,
	jmorris@...ei.org, axboe@...nel.dk, kvm@...r.kernel.org
Subject: Re: [PATCH 50/62] vfio: convert to idr_alloc()

On Sat, 2013-02-02 at 17:20 -0800, Tejun Heo wrote:
> Convert to the much saner new idr interface.
> 
> Only compile tested.
> 
> Signed-off-by: Tejun Heo <tj@...nel.org>
> Cc: Alex Williamson <alex.williamson@...hat.com>
> Cc: kvm@...r.kernel.org
> ---
> This patch depends on an earlier idr changes and I think it would be
> best to route these together through -mm.  Please holler if there's
> any objection.  Thanks.
> 
>  drivers/vfio/vfio.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index 12c264d..0132846 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -139,23 +139,7 @@ EXPORT_SYMBOL_GPL(vfio_unregister_iommu_driver);
>   */
>  static int vfio_alloc_group_minor(struct vfio_group *group)
>  {
> -	int ret, minor;
> -
> -again:
> -	if (unlikely(idr_pre_get(&vfio.group_idr, GFP_KERNEL) == 0))
> -		return -ENOMEM;
> -
> -	/* index 0 is used by /dev/vfio/vfio */

I'd have preferred to keep this comment.  If you do a v2, please keep
it, otherwise I'll add it back later.

Acked-by: Alex Williamson <alex.williamson@...hat.com>

> -	ret = idr_get_new_above(&vfio.group_idr, group, 1, &minor);
> -	if (ret == -EAGAIN)
> -		goto again;
> -	if (ret || minor > MINORMASK) {
> -		if (minor > MINORMASK)
> -			idr_remove(&vfio.group_idr, minor);
> -		return -ENOSPC;
> -	}
> -
> -	return minor;
> +	return idr_alloc(&vfio.group_idr, group, 1, MINORMASK + 1, GFP_KERNEL);
>  }
>  
>  static void vfio_free_group_minor(int minor)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ