Re: [PATCH 4/8] pid.c: Add implementation for find_ge_pid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 <gs051095@xxxxxxxxx>
> ---
>  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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux