[CRIU] Re: [PATCH 1/2] ipc: add new flag for preset shmem id on creation

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 3 11:06:05 EST 2012


On Thu, Feb 02, 2012 at 05:07:49PM +0400, Stanislav Kinsbursky wrote:
> This patch is required for checkpoint/restore of IPC shared memory segments.
> 
...
> diff --git a/ipc/util.c b/ipc/util.c
> index 75261a3..9078560 100644
> --- a/ipc/util.c
> +++ b/ipc/util.c
> @@ -264,7 +264,7 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
>  	rcu_read_lock();
>  	spin_lock(&new->lock);
>  
> -	err = idr_get_new(&ids->ipcs_idr, new, &id);
> +	err = idr_get_new_above(&ids->ipcs_idr, new, ipcid_to_idx(new->id), &id);

Stas, I somehow don't understand this change. Why idr_get_new_above is called
now and does it mean we choose _not_ first free id but some new one greater
than some minimum?

	Cyrill


More information about the CRIU mailing list