public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	rusty@rustcorp.com.au, bfields@fieldses.org,
	skinsbursky@parallels.com, ebiederm@xmission.com,
	jmorris@namei.org, axboe@kernel.dk, kvm@vger.kernel.org
Subject: Re: [PATCH 50/62] vfio: convert to idr_alloc()
Date: Mon, 04 Feb 2013 09:06:33 -0700	[thread overview]
Message-ID: <1359993993.11144.416.camel@bling.home> (raw)
In-Reply-To: <1359854463-2538-51-git-send-email-tj@kernel.org>

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@kernel.org>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: kvm@vger.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@redhat.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)

  reply	other threads:[~2013-02-04 16:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1359854463-2538-1-git-send-email-tj@kernel.org>
2013-02-03  1:20 ` [PATCH 50/62] vfio: convert to idr_alloc() Tejun Heo
2013-02-04 16:06   ` Alex Williamson [this message]
2013-02-04 16:48   ` [PATCH v2 " Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359993993.11144.416.camel@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bfields@fieldses.org \
    --cc=ebiederm@xmission.com \
    --cc=jmorris@namei.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=skinsbursky@parallels.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox