On Fri, 14 Jul 2017, Gargi Sharma wrote:

> Earlier bitmap was traversed to find the pid greater or equal to nr
> (passed as a parameter). Now a call to idr_get_next fetches the id
> greater than or equal to nr.
>
> Signed-off-by: Gargi Sharma <gs051...@gmail.com>
> ---
>  kernel/pid.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/kernel/pid.c b/kernel/pid.c
> index 5060266..a437b88 100644
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -574,13 +574,7 @@ struct pid *find_ge_pid(int nr, struct pid_namespace *ns)
>  {
>       struct pid *pid;
>
> -     do {
> -             pid = find_pid_ns(nr, ns);
> -             if (pid)
> -                     break;
> -             nr = next_pidmap(ns, nr);
> -     } while (nr > 0);
> -
> +     pid = idr_get_next(ns->idr, &nr);
>       return pid;

Do you even need the pid variable?

julia

>  }
>
> --
> 2.7.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to