Merge branches 'intel_pstate' and 'pm-domains'
[sfrench/cifs-2.6.git] / ipc / util.c
index 556884bab698c9ea9fe01bfc3dbfa962a77e55e2..1a2cb02467ab5f33f309a4542620cbec8d18361a 100644 (file)
@@ -232,6 +232,7 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size)
 
        idr_preload(GFP_KERNEL);
 
+       atomic_set(&new->refcount, 1);
        spin_lock_init(&new->lock);
        new->deleted = false;
        rcu_read_lock();
@@ -394,27 +395,6 @@ void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp)
        ipcp->deleted = true;
 }
 
-/**
- * ipc_rcu_alloc - allocate ipc space
- * @size: size desired
- *
- * Allocate memory for an ipc object.
- * The first member must be struct kern_ipc_perm.
- */
-struct kern_ipc_perm *ipc_rcu_alloc(int size)
-{
-       /*
-        * We prepend the allocation with the rcu struct
-        */
-       struct kern_ipc_perm *out = kvmalloc(size, GFP_KERNEL);
-       if (unlikely(!out))
-               return NULL;
-
-       memset(out, 0, size);
-       atomic_set(&out->refcount, 1);
-       return out;
-}
-
 int ipc_rcu_getref(struct kern_ipc_perm *ptr)
 {
        return atomic_inc_not_zero(&ptr->refcount);